[
  {
    "path": ".gitignore",
    "content": "bin\nobj\nDebug\nRelease\nBuilds\n.vs\n*.ncb\n*.suo\n*.user\n*.pidb\n*.userprefs\n*.xml\n*.nupkg\n*.svn\n*.opensdf\n*.sdf\n*.vcxproj\n*.vcxproj.filters"
  },
  {
    "path": "ChangeLog.txt",
    "content": "Major changes from v0.2.5 to v0.2.6\n\ndna:\n\n* Command line parameters are now passed to the .NET executable, in the args[] array to Main().\n\n* When calling a method on a null reference, a NullReferenceException is now thrown,\n  rather than crashing. However - note that internally thrown exceptions don't act quite\n  as expected, as their constructors are not yet called.\n\n------------------------------------------------------------------------------\n\nMajor changes from v0.2.4 to v0.2.5\n\nAll Visual Studio solutions have been upgraded to VS2008.\n\ndna:\n\n* Fixed bug with static fields in generic types. The memory location for the field\n  was not being initialised properly.\n\n* Fixed bug with overridding virtual methods in generic types. Virtual method table\n  indexes were being generated for partially defined generic types, which shouldn't\n  be done as virtual method tables are not available for these types.\n\n* Fixed bug where generic method type arguments were not propogated through the type\n  system correctly. (In fact, at all).\n\n* Fixed bug in finding generic methods in another assembly. The generic method\n  signature was not being checked correctly.\n\n* Fixed bug in MetaData_LoadTables() where the blob index size was being read incorrecty.\n  Thanks to Patrick Levesque for report and fix.\n\n* Fixed bug in casting to nullable types.\n\n* Fixed bug in using typeof() on generic arguments.\n\n* Fixed bug in Array.GetValue() and Array.SetValue() when using nullable types.\n\n* Improved error reporting for missing methods. Now shows the correct containing type.\n\n* Improved conversion operations. All conversions are now supported, with more efficient\n  runtime operation. However, checked conversions run as unchecked conversions.\n\n* Implemented all the unsigned branch instructions, long versions.\n\ncorlib:\n\n* Added IComparer[T], IComparer and Comparer.\n\n* Added IEqualityComparer[T], IEqualityComparer and EqualityComparer.\n\n* Dictionary[TKey, TValue], List[T] and ArrayList re-implemented and improved.\n\n* Fixed missing functionality in Nullable[T].Equals() method.\n\n* Implemented Enum.GetNames().\n\nSystem.Core:\n\n* Added System.Core.dll, containing:\n    - Most LINQ to Objects extension methods.\n    - Func[...] and Action[...] delegates.\n\n------------------------------------------------------------------------------\n\nMajor changes from v0.2.3 to v0.2.4\n\nAll parts of this project are now licensed under the MIT license.\n\n------------------------------------------------------------------------------\n\nMajor changes from v0.2.2 to v0.2.3\n\ndna:\n\n* Improved time resolution of DateTime.UtcNow\n\n* Added code to selectively generate combined-opcode versions often-used methods.\n  It is disabled by default, but may be enabled in config.h\n  It currently has the following major problems:\n    - It doesn't appear to actually speed up execution very much (~5% in testing).\n    - It leaks some memory when 'de-optimizing' methods that are no longer\n      frequently used. This won't be too difficult to fix.\n\n* Added support for static fields containing value-types.\n\n* Added support for casting from Int64 to Double.\n\ncorlib:\n\n* DateTimeFormatInfo implemented\n\n* Calendar and GregorianCalendar very basically implemented. Enough that DateTime\n  formatting now works.\n\n* DateTime.ToString() now works properly (except for timezones).\n\n* More of Math class implemented.\n\n* Implemented IComparable, IComparable[T] and IEquatable[T] on Int16, Int32,\n  Int64, Single, Double, UInt16 ,UInt32, UInt64, Byte, SByte and Boolean.\n\nSystem.Drawing:\n\n* Region is very basically implemented. Only infinite and rectangular regions\n  are supported.\n\n* Added clipping support to Graphics.\n\n* Graphics.MeasureString() has some overloads implemented.\n\n* Graphics.DrawEllipse() and FillEllipse() with int and rect arguments implemented.\n\n* Fixed bug with line drawing.\n\nlibIGraph:\n\n* Implemented native parts of region.\n\n* Implemented native clipping support for all Graphics operations.\n\n* Implemented native parts of MeasureString().\n\n* Implemented ellipse drawing and filling.\n\nSystem:\n\n* Stack[T] class added.\n\n------------------------------------------------------------------------------\n\nMajor changes from v0.2.1 to v0.2.2\n\ndna:\n\n* Added native code for DNS class\n\n* Added native code for System.Threading.Interlocked class\n\ncorlib:\n\n* Added all System.Threading.Interlocked methods that operate on Int32 values.\n  Enumerators defined using yield return therefore now work - they need\n  CompareExchange().\n\n* Added delegates: Action[T], Predicate[T]\n\n* Added TimeSpan - complete except for Parse() and TryParse()\n\n* Added DateTime - DateTime.Now is not implemented, DateTime.UtcNow is.\n  Add simple operations are implemented, but not more complex/obscure stuff,\n  e.g. ToFileTime(). ToString() is only crudely implemented, not taking\n  any notice of formatting specified, or culture. It is always shown in\n  UK format (dd/mm/yyyy hh:mm:ss).\n\nSystem:\n\n* Added the beginnings of the Dns class. It is now possible to get the IPv4\n  address for a host-name.\n\n------------------------------------------------------------------------------\n\nMajor changes from v0.2.0 to v0.2.1\n\ndna:\n\n* Fixed bug in constrained virtual calls.\n\n* Fixed bug with how Single and Double types were handled.\n\n* Added array functionality for floating-point types.\n\n* Improved how internal calls are looked up.\n\n* Updated the VS2005 build config for release, to place the executable\n  in the correct place.\n\n* Implemented Nullable types.\n\n* Implemented basic native socket functionality.\n\n* A little more reflection implemented.\n\n* Misc other bug-fixes and improvements.\n\nSystem:\n\n* Implemented Nullable and Nullable[T] classes.\n\n* Implemented the Socket class (and friends). Only the very basic operations\n  are currently implemented. A socket can be created, used to listen or connect\n  and can send and receive data. Only IPv4 is supported and at the moment only\n  TCP is support (UDP to be added later). More will be implemented later.\n\ncorlib:\n\n* A little more reflection implemented.\n\n------------------------------------------------------------------------------\n\nMajor changes from v0.1 to v0.2.0\n\nThe Interpreter:\n\n* The main interpreter loop has changed from a 'loop with switch'\nto use direct threading (see http://en.wikipedia.org/wiki/Threaded_code\nfor details). This gives a performance advantage, although not on Windows\nas having __asm code in a function appears to stop all other optimizations.\nThe assembler code is only required on non-GNU compilers as GNU provides\nthe computed goto statement.\n\n* A dynamic code generator (strictly, just a combiner) has been\nimplemented, which dynamically generates multi-opcode instructions.\nHowever, it is disabled by default because it currently generates\ndynamic code for all JITted methods, which uses large amounts of\nmemory, and is not always faster (due to code caching). An algorithm\nto selectively re-JIT frequently-used methods is being worked on.\n\n* Split out the configuration into a seperate Config.h file.\n\n* Misc other bug-fixes and improvements.\n\nSystem.Drawing:\n\n* Implmented LinearGradiantBrush\n\n* Fixed bug in HatchBrush that caused all hatches to be drawn 90\ndegrees rotated.\n\n"
  },
  {
    "path": "CustomDevice/CustomDevice.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.30729</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{43619745-0A80-499E-907C-E733FF3DA2BE}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>CustomDevice</RootNamespace>\n    <AssemblyName>CustomDevice</AssemblyName>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <UpgradeBackupLocation>\n    </UpgradeBackupLocation>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Windows.Forms\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"DeviceGraphics.cs\" />\n    <Compile Include=\"KeyPad.cs\" />\n    <Compile Include=\"KeyPadKey.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"Utils.cs\" />\n    <Compile Include=\"WindowsScreen.cs\">\n      <SubType>Form</SubType>\n    </Compile>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.2.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <PropertyGroup>\n    <PostBuildEvent>xcopy $(TargetPath) $(SolutionDir)Builds\\$(ConfigurationName)\\ /Y</PostBuildEvent>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "CustomDevice/DeviceGraphics.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Drawing;\nusing System.Threading;\n\nnamespace CustomDevice {\n\n\tpublic static class DeviceGraphics {\n\n\t\tprivate const int ScreenX = 320;\n\t\tprivate const int ScreenY = 240;\n\n\t\tprivate static int whichScreen = 0;\n\n\t\tpublic static int ScreenXSize {\n\t\t\tget {\n\t\t\t\treturn ScreenX;\n\t\t\t}\n\t\t}\n\n\t\tpublic static int ScreenYSize {\n\t\t\tget {\n\t\t\t\treturn ScreenY;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Graphics GetScreen() {\n\t\t\tif (whichScreen == 0) {\n\t\t\t\tif (Utils.IsInterNet2) {\n\t\t\t\t\twhichScreen = 1;\n\t\t\t\t} else {\n\t\t\t\t\twhichScreen = 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (whichScreen == 1) {\n\t\t\t\treturn GetScreen_InterNet2();\n\t\t\t} else {\n\t\t\t\treturn GetScreen_Windows();\n\t\t\t}\n\t\t}\n\n\t\tprivate static Graphics GetScreen_InterNet2() {\n\t\t\t// In the InterNet2 System.Drawing dll Graphics.FromHdc() will always\n\t\t\t// return the Graphics object for the screen.\n\t\t\treturn Graphics.FromHdc(IntPtr.Zero);\n\t\t}\n\n\t\tprivate static Graphics GetScreen_Windows() {\n\n\t\t\tif (WindowsScreen.winScreen == null) {\n\t\t\t\tThread t = new Thread(WindowsScreen.WindowsMessagePump);\n\t\t\t\tt.IsBackground = true;\n\t\t\t\tt.Start();\n\t\t\t\twhile (WindowsScreen.winScreen == null) {\n\t\t\t\t\tThread.Sleep(2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlock (WindowsScreen.winScreen) {\n\t\t\t\tGraphics g = Graphics.FromImage(WindowsScreen.winScreen.FormSurface);\n\t\t\t\treturn g;\n\t\t\t}\n\t\t}\n\n\t}\n\n}\n"
  },
  {
    "path": "CustomDevice/KeyPad.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Runtime.InteropServices;\nusing System.Drawing;\nusing System.Threading;\n\nnamespace CustomDevice {\n\tpublic static class KeyPad {\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern private static bool IsKeyDown_Internal(KeyPadKey key);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern private static int LatestKeyUp_Internal();\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern private static int LatestKeyDown_Internal();\n\n\t\tpublic static bool IsKeyDown(KeyPadKey key) {\n\t\t\tif (Utils.IsInterNet2) {\n\t\t\t\treturn IsKeyDown_Internal(key);\n\t\t\t} else {\n\t\t\t\treturn WindowsScreen.WinScreen.IsKeyDown(key);\n\t\t\t}\n\t\t}\n\n\t\tprivate static bool WindowsLatestKeyUp(out KeyPadKey key) {\n\t\t\treturn WindowsScreen.WinScreen.LatestKeyUp(out key);\n\t\t}\n\n\t\tprivate static bool WindowsLatestKeyDown(out KeyPadKey key) {\n\t\t\treturn WindowsScreen.WinScreen.LatestKeyDown(out key);\n\t\t}\n\n\t\tpublic static bool LatestKeyUp(out KeyPadKey key) {\n\t\t\tif (Utils.IsInterNet2) {\n\t\t\t\tint iKey = LatestKeyUp_Internal();\n\t\t\t\tif (iKey >= 0) {\n\t\t\t\t\tkey = (KeyPadKey)iKey;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tkey = KeyPadKey.B0;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn WindowsLatestKeyUp(out key);\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool LatestKeyDown(out KeyPadKey key) {\n\t\t\tif (Utils.IsInterNet2) {\n\t\t\t\tint iKey = LatestKeyDown_Internal();\n\t\t\t\tif (iKey >= 0) {\n\t\t\t\t\tkey = (KeyPadKey)iKey;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tkey = KeyPadKey.B0;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn WindowsLatestKeyDown(out key);\n\t\t\t}\n\t\t}\n\n\t\tpublic static KeyPadKey? ReadKey(int timeoutMs) {\n\t\t\tDateTime end = DateTime.UtcNow.AddMilliseconds(timeoutMs);\n\t\t\tdo {\n\t\t\t\tKeyPadKey key;\n\t\t\t\tif (LatestKeyDown(out key)) {\n\t\t\t\t\treturn key;\n\t\t\t\t}\n\t\t\t\tThread.Sleep(1);\n\t\t\t} while (DateTime.UtcNow < end && timeoutMs >= 0);\n\t\t\treturn null;\n\t\t}\n\n\t\tpublic static KeyPadKey? ReadKey() {\n\t\t\treturn ReadKey(-1);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "CustomDevice/KeyPadKey.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace CustomDevice {\n\tpublic enum KeyPadKey {\n\n\t\tB0 = 0,\n\t\tB1 = 1,\n\t\tB2 = 2,\n\t\tB3 = 3,\n\t\tB4 = 4,\n\t\tB5 = 5,\n\t\tB6 = 6,\n\t\tB7 = 7,\n\t\tB8 = 8,\n\t\tB9 = 9,\n\t\tC = 10,\n\t\tOK = 11\n\n\t}\n}\n"
  },
  {
    "path": "CustomDevice/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"DeviceGraphics\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Docobo\")]\n[assembly: AssemblyProduct(\"DeviceGraphics\")]\n[assembly: AssemblyCopyright(\"Copyright © Docobo 2007\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"a7a488bb-a22b-4377-ab45-d2139150ff7d\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Revision and Build Numbers \n// by using the '*' as shown below:\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "CustomDevice/Utils.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace CustomDevice {\n\tstatic class Utils {\n\n\t\tprivate static bool isDNA, isDNASet = false;\n\t\tpublic static bool IsInterNet2 {\n\t\t\tget {\n\t\t\t\tif (!isDNASet) {\n\t\t\t\t\tisDNA = Environment.OSVersion.VersionString.EndsWith(\"(DNA)\");\n\t\t\t\t\tisDNASet = true;\n\t\t\t\t}\n\t\t\t\treturn isDNA;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "CustomDevice/WindowsScreen.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Windows.Forms;\nusing System.Drawing;\nusing System.Threading;\nusing System.IO;\nusing System.Runtime.InteropServices;\n\nnamespace CustomDevice {\n\tclass WindowsScreen : Form {\n\n\t\tinternal static WindowsScreen winScreen = null;\n\n\t\tpublic static WindowsScreen WinScreen {\n\t\t\tget {\n\t\t\t\tif (winScreen == null) {\n\t\t\t\t\tusing (Graphics g = DeviceGraphics.GetScreen()) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn winScreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic WindowsScreen(int width, int height) {\n\t\t\tthis.SetStyle(ControlStyles.AllPaintingInWmPaint, true);\n\t\t\tthis.SetStyle(ControlStyles.FixedWidth, true);\n\t\t\tthis.SetStyle(ControlStyles.FixedHeight, true);\n\t\t\tthis.SetStyle(ControlStyles.Opaque, true);\n\t\t\tthis.SetStyle(ControlStyles.UserPaint, true);\n\n\t\t\tthis.formSurface = new Bitmap(width, height);\n\n\t\t\tthis.ClientSize = new Size(width, height);\n\n\t\t\tthis.Show();\n\t\t\tthis.Activate();\n\n\t\t}\n\n\t\tprivate Bitmap formSurface;\n\n\t\tpublic Bitmap FormSurface {\n\t\t\tget {\n\t\t\t\treturn this.formSurface;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void OnPaint(PaintEventArgs e) {\n\t\t\tlock (this) {\n\t\t\t\te.Graphics.DrawImageUnscaled(this.formSurface, new Point());\n\t\t\t}\n\t\t}\n\n\t\tinternal static void WindowsMessagePump(object state) {\n\t\t\tWindowsScreen.winScreen = new WindowsScreen(DeviceGraphics.ScreenXSize, DeviceGraphics.ScreenYSize);\n\t\t\tfor (; ; ) {\n\t\t\t\tApplication.DoEvents();\n\t\t\t\tThread.Sleep(40);\n\t\t\t\tWindowsScreen.winScreen.Refresh();\n\t\t\t}\n\t\t}\n\n\t\tprivate bool[] keyState = new bool[12];\n\n\t\tprivate KeyPadKey MapKey(Keys pcKey, out bool isValid) {\n\t\t\tisValid = true;\n\t\t\tswitch (pcKey) {\n\t\t\t\tcase Keys.D0:\n\t\t\t\tcase Keys.NumPad0:\n\t\t\t\t\treturn KeyPadKey.B0;\n\t\t\t\tcase Keys.D1:\n\t\t\t\tcase Keys.NumPad1:\n\t\t\t\t\treturn KeyPadKey.B1;\n\t\t\t\tcase Keys.D2:\n\t\t\t\tcase Keys.NumPad2:\n\t\t\t\t\treturn KeyPadKey.B2;\n\t\t\t\tcase Keys.D3:\n\t\t\t\tcase Keys.NumPad3:\n\t\t\t\t\treturn KeyPadKey.B3;\n\t\t\t\tcase Keys.D4:\n\t\t\t\tcase Keys.NumPad4:\n\t\t\t\t\treturn KeyPadKey.B4;\n\t\t\t\tcase Keys.D5:\n\t\t\t\tcase Keys.NumPad5:\n\t\t\t\t\treturn KeyPadKey.B5;\n\t\t\t\tcase Keys.D6:\n\t\t\t\tcase Keys.NumPad6:\n\t\t\t\t\treturn KeyPadKey.B6;\n\t\t\t\tcase Keys.D7:\n\t\t\t\tcase Keys.NumPad7:\n\t\t\t\t\treturn KeyPadKey.B7;\n\t\t\t\tcase Keys.D8:\n\t\t\t\tcase Keys.NumPad8:\n\t\t\t\t\treturn KeyPadKey.B8;\n\t\t\t\tcase Keys.D9:\n\t\t\t\tcase Keys.NumPad9:\n\t\t\t\t\treturn KeyPadKey.B9;\n\t\t\t\tcase Keys.Enter:\n\t\t\t\t\treturn KeyPadKey.OK;\n\t\t\t\tcase Keys.Escape:\n\t\t\t\t\treturn KeyPadKey.C;\n\t\t\t\tdefault:\n\t\t\t\t\tisValid = false;\n\t\t\t\t\treturn KeyPadKey.B0;\n\t\t\t}\n\t\t}\n\n\t\tprotected override void OnKeyDown(KeyEventArgs e) {\n\t\t\tbool isValid;\n\t\t\tKeyPadKey key = this.MapKey(e.KeyCode, out isValid);\n\t\t\tif (isValid) {\n\t\t\t\te.Handled = true;\n\t\t\t\tthis.keyState[(int)key] = true;\n\t\t\t\tthis.latestKeyDown = key;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbase.OnKeyDown(e);\n\t\t}\n\n\t\tprotected override void OnKeyUp(KeyEventArgs e) {\n\t\t\tbool isValid;\n\t\t\tKeyPadKey key = this.MapKey(e.KeyCode, out isValid);\n\t\t\tif (isValid) {\n\t\t\t\te.Handled = true;\n\t\t\t\tthis.keyState[(int)key] = false;\n\t\t\t\tthis.latestKeyUp = key;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tbase.OnKeyUp(e);\n\t\t}\n\n\t\tpublic bool IsKeyDown(KeyPadKey key) {\n\t\t\treturn this.keyState[(int)key];\n\t\t}\n\n\t\tprivate KeyPadKey? latestKeyUp = null;\n\t\tpublic bool LatestKeyUp(out KeyPadKey key) {\n\t\t\tif (this.latestKeyUp.HasValue) {\n\t\t\t\tkey = this.latestKeyUp.Value;\n\t\t\t\tthis.latestKeyUp = null;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tkey = KeyPadKey.B0;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tprivate KeyPadKey? latestKeyDown = null;\n\t\tpublic bool LatestKeyDown(out KeyPadKey key) {\n\t\t\tif (this.latestKeyDown.HasValue) {\n\t\t\t\tkey = this.latestKeyDown.Value;\n\t\t\t\tthis.latestKeyDown = null;\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tkey = KeyPadKey.B0;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "License.txt",
    "content": "Copyright (c) 2012 DotNetAnywhere\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n"
  },
  {
    "path": "Managed.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 11\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"corlib\", \"corlib\\corlib.csproj\", \"{6A77A7C0-FB66-4CAA-94EE-142DBA20655D}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"System.Drawing\", \"System.Drawing\\System.Drawing.csproj\", \"{0F7F935F-E3F5-40AD-BD22-0BA43721560F}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"System\", \"System\\System.csproj\", \"{388F5D73-0211-4A64-B501-92CDC4E32ACF}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"Snake\", \"Snake\\Snake.csproj\", \"{C26A3309-7A61-40B6-9998-69B78CF226C1}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"CustomDevice\", \"CustomDevice\\CustomDevice.csproj\", \"{43619745-0A80-499E-907C-E733FF3DA2BE}\"\nEndProject\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"System.Core\", \"System.Core\\System.Core.csproj\", \"{429C3225-3A36-427A-A44E-2AA3563FCD6D}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tLocalTest|Any CPU = LocalTest|Any CPU\n\t\tRelease|Any CPU = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{0F7F935F-E3F5-40AD-BD22-0BA43721560F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{0F7F935F-E3F5-40AD-BD22-0BA43721560F}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{0F7F935F-E3F5-40AD-BD22-0BA43721560F}.LocalTest|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0F7F935F-E3F5-40AD-BD22-0BA43721560F}.LocalTest|Any CPU.Build.0 = Release|Any CPU\n\t\t{0F7F935F-E3F5-40AD-BD22-0BA43721560F}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{0F7F935F-E3F5-40AD-BD22-0BA43721560F}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{388F5D73-0211-4A64-B501-92CDC4E32ACF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{388F5D73-0211-4A64-B501-92CDC4E32ACF}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{388F5D73-0211-4A64-B501-92CDC4E32ACF}.LocalTest|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{388F5D73-0211-4A64-B501-92CDC4E32ACF}.LocalTest|Any CPU.Build.0 = Release|Any CPU\n\t\t{388F5D73-0211-4A64-B501-92CDC4E32ACF}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{388F5D73-0211-4A64-B501-92CDC4E32ACF}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{429C3225-3A36-427A-A44E-2AA3563FCD6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{429C3225-3A36-427A-A44E-2AA3563FCD6D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{429C3225-3A36-427A-A44E-2AA3563FCD6D}.LocalTest|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{429C3225-3A36-427A-A44E-2AA3563FCD6D}.LocalTest|Any CPU.Build.0 = Release|Any CPU\n\t\t{429C3225-3A36-427A-A44E-2AA3563FCD6D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{429C3225-3A36-427A-A44E-2AA3563FCD6D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{43619745-0A80-499E-907C-E733FF3DA2BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{43619745-0A80-499E-907C-E733FF3DA2BE}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{43619745-0A80-499E-907C-E733FF3DA2BE}.LocalTest|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{43619745-0A80-499E-907C-E733FF3DA2BE}.LocalTest|Any CPU.Build.0 = Release|Any CPU\n\t\t{43619745-0A80-499E-907C-E733FF3DA2BE}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{43619745-0A80-499E-907C-E733FF3DA2BE}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{6A77A7C0-FB66-4CAA-94EE-142DBA20655D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{6A77A7C0-FB66-4CAA-94EE-142DBA20655D}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{6A77A7C0-FB66-4CAA-94EE-142DBA20655D}.LocalTest|Any CPU.ActiveCfg = LocalTest|Any CPU\n\t\t{6A77A7C0-FB66-4CAA-94EE-142DBA20655D}.LocalTest|Any CPU.Build.0 = LocalTest|Any CPU\n\t\t{6A77A7C0-FB66-4CAA-94EE-142DBA20655D}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{6A77A7C0-FB66-4CAA-94EE-142DBA20655D}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{C26A3309-7A61-40B6-9998-69B78CF226C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{C26A3309-7A61-40B6-9998-69B78CF226C1}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{C26A3309-7A61-40B6-9998-69B78CF226C1}.LocalTest|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C26A3309-7A61-40B6-9998-69B78CF226C1}.LocalTest|Any CPU.Build.0 = Release|Any CPU\n\t\t{C26A3309-7A61-40B6-9998-69B78CF226C1}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{C26A3309-7A61-40B6-9998-69B78CF226C1}.Release|Any CPU.Build.0 = Release|Any CPU\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "Snake/ASnake.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Drawing;\n\nnamespace Snake {\n\tclass ASnake {\n\n\t\tprivate SnakePit snakePit;\n\t\tprivate Queue<Point> bodyParts = new Queue<Point>();\n\t\tprivate Point head;\n\t\tprivate int xSpeed, ySpeed;\n\t\tprivate Color col;\n\t\tprivate int increaseBy;\n\n\t\tpublic ASnake(SnakePit snakePit, int startLength, Point startPosition, Color col) {\n\t\t\tthis.snakePit = snakePit;\n\t\t\tfor (int i = 0; i < startLength; i++) {\n\t\t\t\tPoint cell = new Point(startPosition.X - startLength + i + 1, startPosition.Y);\n\t\t\t\tsnakePit.SetCell(cell, col);\n\t\t\t\tthis.bodyParts.Enqueue(cell);\n\t\t\t\tthis.head = cell;\n\t\t\t}\n\t\t\tthis.col = col;\n\t\t\tthis.xSpeed = 1;\n\t\t\tthis.ySpeed = 0;\n\t\t\tthis.increaseBy = 0;\n\t\t\tsnakePit.AddSnake(this);\n\t\t}\n\n\t\tpublic CrashType Move() {\n\t\t\tif (this.increaseBy == 0) {\n\t\t\t\tPoint tail = this.bodyParts.Dequeue();\n\t\t\t\tsnakePit.ClearCell(tail);\n\t\t\t} else {\n\t\t\t\tthis.increaseBy--;\n\t\t\t}\n\t\t\tthis.head.X += this.xSpeed;\n\t\t\tthis.head.Y += this.ySpeed;\n\t\t\tif (this.DoesIntersect(this.head)) {\n\t\t\t\tConsole.WriteLine(\"!!!SELF CRASH!!!\");\n\t\t\t\treturn CrashType.Self;\n\t\t\t}\n\t\t\tthis.bodyParts.Enqueue(this.head);\n\t\t\tsnakePit.SetCell(this.head, this.col);\n\t\t\tCrashType crash = this.snakePit.IsCrash(head);\n\t\t\treturn crash;\n\t\t}\n\n\t\tpublic void DrawHead() {\n\t\t\tsnakePit.SetCell(this.head, this.col);\n\t\t}\n\n\t\tpublic void SetDirection(int x, int y) {\n\t\t\t// Do nothing if trying to set current or opposite direction\n\t\t\tif (x != 0 && this.xSpeed != 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (y != 0 && this.ySpeed != 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Set new speeds\n\t\t\tthis.xSpeed = x;\n\t\t\tthis.ySpeed = y;\n\t\t}\n\n\t\tpublic bool DoesIntersect(IEnumerable<Point> cells) {\n\t\t\tforeach (Point cell in cells) {\n\t\t\t\tif (this.DoesIntersect(cell)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic bool DoesIntersect(Point cell) {\n\t\t\tforeach (Point p in this.bodyParts) {\n\t\t\t\tif (p == cell) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void IncreaseLength(int amount) {\n\t\t\tthis.increaseBy += amount;\n\t\t}\n\n\t\tpublic Point Head {\n\t\t\tget {\n\t\t\t\treturn this.head;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "Snake/CrashType.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace Snake {\n\tpublic enum CrashType {\n\t\tNone,\n\t\tSelf,\n\t\tWall,\n\t\tFood,\n\t}\n}\n"
  },
  {
    "path": "Snake/Program.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Drawing;\nusing System.Threading;\nusing CustomDevice;\n\nnamespace Snake {\n\tclass Program {\n\t\tstatic void Main(string[] args) {\n\t\t\tfor (; ; ) {\n\t\t\t\tbool res = Play();\n\t\t\t\tif (!res) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic bool Play() {\n\n\t\t\tFont f = new Font(\"tahoma\", 25);\n\t\t\tSnakePit snakePit = new SnakePit();\n\t\t\tRandom rnd = new Random();\n\t\t\tint delay = 300;\n\n\t\t\tASnake snake = new ASnake(snakePit, 5, snakePit.Centre, Color.Black);\n\n\t\t\tCrashType crashType;\n\t\t\tfor (; ; ) {\n\t\t\t\tThread.Sleep(delay);\n\t\t\t\tKeyPadKey key;\n\t\t\t\tif (KeyPad.LatestKeyDown(out key)) {\n\t\t\t\t\tswitch (key) {\n\t\t\t\t\tcase KeyPadKey.B6: // Left\n\t\t\t\t\t\tsnake.SetDirection(-1, 0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyPadKey.B7: // Down\n\t\t\t\t\t\tsnake.SetDirection(0, 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyPadKey.B8: // Up\n\t\t\t\t\t\tsnake.SetDirection(0, -1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyPadKey.B9: // Right\n\t\t\t\t\t\tsnake.SetDirection(1, 0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase KeyPadKey.C:\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcrashType = snake.Move();\n\t\t\t\tbool finish = false;\n\t\t\t\tswitch (crashType) {\n\t\t\t\tcase CrashType.None:\n\t\t\t\t\tbreak;\n\t\t\t\tcase CrashType.Self:\n\t\t\t\tcase CrashType.Wall:\n\t\t\t\tdefault:\n\t\t\t\t\tfinish = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase CrashType.Food:\n\t\t\t\t\tbool levelUp = snakePit.EatFood();\n\t\t\t\t\tif (levelUp) {\n\t\t\t\t\t\tdelay = (delay * 3) / 4;\n\t\t\t\t\t}\n\t\t\t\t\tsnake.IncreaseLength(4);\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\t\t\t\tsnake.DrawHead();\n\t\t\t\tif (finish) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tint r = rnd.Next(1000);\n\t\t\t\tif (r < 50) {\n\t\t\t\t\tsnakePit.CreateFood(r < 5);\n\t\t\t\t}\n\t\t\t\tr = rnd.Next(1000);\n\t\t\t\tif (r < 20) {\n\t\t\t\t\tsnakePit.AddObstacle();\n\t\t\t\t}\n\t\t\t}\n\t\t\tsnakePit.Msg(crashType.ToString());\n\t\t\tThread.Sleep(5000);\n\n\t\t\treturn true;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "Snake/Properties/AssemblyInfo.cs",
    "content": "﻿using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"Snake\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Docobo\")]\n[assembly: AssemblyProduct(\"Snake\")]\n[assembly: AssemblyCopyright(\"Copyright © Docobo 2007\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"a65d79de-9fdb-4e50-aa31-5aff8c5f8744\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "Snake/Snake.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.30729</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{C26A3309-7A61-40B6-9998-69B78CF226C1}</ProjectGuid>\n    <OutputType>Exe</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>Snake</RootNamespace>\n    <AssemblyName>Snake</AssemblyName>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <UpgradeBackupLocation>\n    </UpgradeBackupLocation>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Reference Include=\"System\" />\n    <Reference Include=\"System.Data\" />\n    <Reference Include=\"System.Drawing\" />\n    <Reference Include=\"System.Xml\" />\n  </ItemGroup>\n  <ItemGroup>\n    <Compile Include=\"ASnake.cs\" />\n    <Compile Include=\"CrashType.cs\" />\n    <Compile Include=\"Program.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"SnakePit.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\CustomDevice\\CustomDevice.csproj\">\n      <Project>{43619745-0A80-499E-907C-E733FF3DA2BE}</Project>\n      <Name>CustomDevice</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.2.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <PropertyGroup>\n    <PostBuildEvent>xcopy $(TargetPath) $(SolutionDir)Builds\\$(ConfigurationName)\\ /Y</PostBuildEvent>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "Snake/SnakePit.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Drawing;\nusing CustomDevice;\nusing System.Drawing.Drawing2D;\n\nnamespace Snake {\n\tclass SnakePit {\n\n\t\tprivate const int cellSize = 8;\n\t\tprivate const int scoreBoardHeight = 48;\n\n\t\tprivate Graphics screen;\n\t\tprivate int cellOfsX, cellOfsY;\n\t\tprivate int numCellsX, numCellsY;\n\t\tprivate Random rnd;\n\t\tprivate Point[] food;\n\t\tprivate List<ASnake> snakes = new List<ASnake>();\n\t\tprivate int score, level;\n\t\tprivate List<Point[]> obstacles = new List<Point[]>();\n\n\t\tpublic SnakePit() {\n\t\t\tthis.screen = DeviceGraphics.GetScreen();\n\t\t\tthis.screen.Clear(Color.White);\n\t\t\tthis.numCellsX = (DeviceGraphics.ScreenXSize / cellSize) - 2;\n\t\t\tthis.numCellsY = ((DeviceGraphics.ScreenYSize - scoreBoardHeight) / cellSize) - 2;\n\t\t\tthis.cellOfsX = cellSize;\n\t\t\tthis.cellOfsY = cellSize;\n\t\t\tthis.rnd = new Random();\n\t\t\tthis.food = null;\n\t\t\tthis.score = 0;\n\t\t\tthis.level = 1;\n\n\t\t\tusing (Brush brush = new HatchBrush(HatchStyle.DiagonalCross, Color.Black, Color.White)) {\n\t\t\t\tthis.screen.FillRectangle(brush, 0, 0, DeviceGraphics.ScreenXSize, cellSize);\n\t\t\t\tthis.screen.FillRectangle(brush, 0, cellSize, cellSize, this.numCellsY * cellSize);\n\t\t\t\tthis.screen.FillRectangle(brush, (1 + this.numCellsX) * cellSize, cellSize, cellSize, this.numCellsY * cellSize);\n\t\t\t\tthis.screen.FillRectangle(brush, 0, (1 + this.numCellsY) * cellSize, DeviceGraphics.ScreenXSize, cellSize);\n\t\t\t}\n\t\t\tthis.screen.DrawRectangle(Pens.Black, cellSize - 1, cellSize - 1,\n\t\t\t\tthis.numCellsX * cellSize + 1, this.numCellsY * cellSize + 1);\n\n\t\t\tusing (Font f = new Font(\"tahoma\", 15)) {\n\t\t\t\tusing (StringFormat sf = new StringFormat()) {\n\t\t\t\t\tsf.Alignment = StringAlignment.Center;\n\t\t\t\t\tsf.LineAlignment = StringAlignment.Center;\n\t\t\t\t\tthis.screen.DrawString(\"<\", f, Brushes.Black, new RectangleF(0, 220, 64, 20), sf);\n\t\t\t\t\tthis.screen.DrawString(\"v\", f, Brushes.Black, new RectangleF(64, 220, 64, 20), sf);\n\t\t\t\t\tthis.screen.DrawString(\"^\", f, Brushes.Black, new RectangleF(128, 220, 64, 20), sf);\n\t\t\t\t\tthis.screen.DrawString(\">\", f, Brushes.Black, new RectangleF(192, 220, 64, 20), sf);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.ShowScore();\n\t\t}\n\n\t\tprivate void FillCell(Point cell, Color col) {\n\t\t\tusing (Brush brush = new SolidBrush(col)) {\n\t\t\t\tscreen.FillRectangle(brush,\n\t\t\t\t\tthis.cellOfsX + cell.X * cellSize, this.cellOfsY + cell.Y * cellSize, cellSize, cellSize);\n\t\t\t}\n\t\t}\n\n\t\tpublic void FillAndOutlineCells(IEnumerable<Point> points, Color fillCol, Color outlineCol) {\n\t\t\tusing (Brush brush = new SolidBrush(fillCol)) {\n\t\t\t\tthis.FillAndOutlineCells(points, brush, outlineCol);\n\t\t\t}\n\t\t}\n\n\t\tpublic void FillAndOutlineCells(IEnumerable<Point> points, Brush fillBrush, Color outlineCol) {\n\t\t\tint minX = int.MaxValue, maxX = int.MinValue;\n\t\t\tint minY = int.MaxValue, maxY = int.MinValue;\n\t\t\tforeach (Point p in points) {\n\t\t\t\tminX = Math.Min(minX, p.X);\n\t\t\t\tmaxX = Math.Max(maxX, p.X);\n\t\t\t\tminY = Math.Min(minY, p.Y);\n\t\t\t\tmaxY = Math.Max(maxY, p.Y);\n\t\t\t}\n\t\t\tint x = this.cellOfsX + minX * cellSize;\n\t\t\tint y = this.cellOfsY + minY * cellSize;\n\t\t\tint width = (maxX - minX + 1) * cellSize;\n\t\t\tint height = (maxY - minY + 1) * cellSize;\n\t\t\tthis.screen.FillRectangle(fillBrush, x, y, width, height);\n\t\t\tusing (Pen pen = new Pen(outlineCol)) {\n\t\t\t\tthis.screen.DrawRectangle(pen, x, y, width - 1, height - 1);\n\t\t\t}\n\t\t}\n\n\t\tpublic void AddSnake(ASnake snake) {\n\t\t\tthis.snakes.Add(snake);\n\t\t}\n\n\t\tpublic Point Centre {\n\t\t\tget {\n\t\t\t\treturn new Point(numCellsX >> 1, numCellsY >> 1);\n\t\t\t}\n\t\t}\n\n\t\tpublic Size Size {\n\t\t\tget {\n\t\t\t\treturn new Size(numCellsX, numCellsY);\n\t\t\t}\n\t\t}\n\n\t\tpublic void SetCell(Point cell, Color col) {\n\t\t\tthis.FillCell(cell, col);\n\t\t}\n\n\t\tpublic void ClearCell(Point cell) {\n\t\t\tthis.FillCell(cell, Color.White);\n\t\t}\n\n\t\tpublic bool IsCrashObstacle(Point cell) {\n\t\t\tforeach (Point[] obs in this.obstacles) {\n\t\t\t\tforeach (Point pt in obs) {\n\t\t\t\t\tif (pt == cell) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic CrashType IsCrash(Point cell) {\n\t\t\tif (cell.X < 0 || cell.X >= this.numCellsX || cell.Y < 0 || cell.Y >= this.numCellsY) {\n\t\t\t\treturn CrashType.Wall;\n\t\t\t}\n\t\t\tif (this.IsCrashObstacle(cell)) {\n\t\t\t\treturn CrashType.Wall;\n\t\t\t}\n\t\t\tif (this.food != null) {\n\t\t\t\tfor (int i = 0; i < this.food.Length; i++) {\n\t\t\t\t\tif (this.food[i] == cell) {\n\t\t\t\t\t\treturn CrashType.Food;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn CrashType.None;\n\t\t}\n\n\t\tpublic void CreateFood(bool canMoveFood) {\n\t\t\tif (this.food != null && !canMoveFood) {\n\t\t\t\t// Don't move the food\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.RemoveFood();\n\t\t\tPoint[] newFood;\n\t\t\tfor (; ; ) {\n\t\t\t\tint x = this.rnd.Next(this.numCellsX - 1);\n\t\t\t\tint y = this.rnd.Next(this.numCellsY - 1);\n\t\t\t\tnewFood = new Point[4];\n\t\t\t\tnewFood[0] = new Point(x, y);\n\t\t\t\tnewFood[1] = new Point(x + 1, y);\n\t\t\t\tnewFood[2] = new Point(x, y + 1);\n\t\t\t\tnewFood[3] = new Point(x + 1, y + 1);\n\t\t\t\tbool ok = true;\n\t\t\t\tforeach (ASnake snake in this.snakes) {\n\t\t\t\t\tif (snake.DoesIntersect(newFood)) {\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ok) {\n\t\t\t\t\tforeach (Point pt in newFood) {\n\t\t\t\t\t\tif (IsCrashObstacle(pt)) {\n\t\t\t\t\t\t\tok = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ok) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.food = newFood;\n\t\t\tthis.FillAndOutlineCells(this.food, Color.Gray, Color.Black);\n\t\t}\n\n\t\tpublic void RemoveFood() {\n\t\t\tif (this.food == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tfor (int i = 0; i < this.food.Length; i++) {\n\t\t\t\tthis.ClearCell(this.food[i]);\n\t\t\t}\n\t\t\tthis.food = null;\n\t\t}\n\n\t\tpublic bool EatFood() {\n\t\t\tthis.RemoveFood();\n\t\t\tthis.score++;\n\t\t\tbool ret = false;\n\t\t\tif (this.score >= this.level * 4) {\n\t\t\t\tthis.level++;\n\t\t\t\tret = true;\n\t\t\t}\n\t\t\tthis.ShowScore();\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic void Msg(string msg) {\n\t\t\tusing (Font f = new Font(\"tahoma\", 40)) {\n\t\t\t\tthis.screen.DrawString(msg, f, Brushes.Black, 30, 80);\n\t\t\t}\n\t\t}\n\n\t\tpublic void ShowScore() {\n\t\t\tthis.screen.FillRectangle(Brushes.White, 0,\n\t\t\t\tDeviceGraphics.ScreenYSize - scoreBoardHeight, DeviceGraphics.ScreenXSize, scoreBoardHeight - 20);\n\t\t\tusing (Font f = new Font(\"tahoma\", 15)) {\n\t\t\t\tstring s = string.Format(\"Level: {0}\", this.level);\n\t\t\t\tthis.screen.DrawString(s, f, Brushes.Black, 0, DeviceGraphics.ScreenYSize - scoreBoardHeight);\n\t\t\t\ts = string.Format(\"Score: {0}\", this.score);\n\t\t\t\tthis.screen.DrawString(s, f, Brushes.Black, DeviceGraphics.ScreenXSize >> 1, DeviceGraphics.ScreenYSize - scoreBoardHeight);\n\t\t\t}\n\t\t}\n\n\t\tpublic int Level {\n\t\t\tget {\n\t\t\t\treturn this.level;\n\t\t\t}\n\t\t}\n\n\t\tprivate int Dist(Point a, Point b) {\n\t\t\tint dx = a.X - b.Y;\n\t\t\tint dy = a.Y - b.Y;\n\t\t\treturn Math.Max(Math.Abs(dx), Math.Abs(dy));\n\t\t}\n\n\t\tpublic void AddObstacle() {\n\t\t\tPoint[] obs;\n\t\t\tfor (; ; ) {\n\t\t\t\tint x = this.rnd.Next(this.numCellsX - 1);\n\t\t\t\tint y = this.rnd.Next(this.numCellsY - 1);\n\t\t\t\tobs = new Point[4];\n\t\t\t\tobs[0] = new Point(x, y);\n\t\t\t\tobs[1] = new Point(x + 1, y);\n\t\t\t\tobs[2] = new Point(x, y + 1);\n\t\t\t\tobs[3] = new Point(x + 1, y + 1);\n\t\t\t\tbool ok = true;\n\t\t\t\tforeach (ASnake snake in this.snakes) {\n\t\t\t\t\tif (snake.DoesIntersect(obs) || this.Dist(snake.Head, obs[0]) < 10) {\n\t\t\t\t\t\tok = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (ok) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tusing (HatchBrush brush = new HatchBrush(HatchStyle.DiagonalCross,Color.Black, Color.White)) {\n\t\t\t\tthis.FillAndOutlineCells(obs, brush, Color.Black);\n\t\t\t}\n\t\t\tthis.obstacles.Add(obs);\n\t\t\tif (this.obstacles.Count > this.Level * 2) {\n\t\t\t\t// Remove an obstacle\n\t\t\t\tobs = this.obstacles[0];\n\t\t\t\tforeach (Point pt in obs) {\n\t\t\t\t\tthis.ClearCell(pt);\n\t\t\t\t}\n\t\t\t\tthis.obstacles.RemoveAt(0);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System/Properties/AssemblyInfo.cs",
    "content": "﻿/*using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"System\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Docobo\")]\n[assembly: AssemblyProduct(\"System\")]\n[assembly: AssemblyCopyright(\"Copyright © Docobo 2007\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"ac7fc7c3-9352-46c9-a145-9737bfab7e1a\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Revision and Build Numbers \n// by using the '*' as shown below:\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n*/"
  },
  {
    "path": "System/System.Collections.Generic/Queue.cs",
    "content": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Collections.Generic {\n\tpublic class Queue<T> : IEnumerable<T>, ICollection, IEnumerable {\n\t\tT[] _array;\n\t\tint _head;\n\t\tint _tail;\n\t\tint _size;\n\t\tint _version;\n\n\t\tprivate const int INITIAL_SIZE = 16;\n\n\t\tpublic Queue() {\n\t\t}\n\n\t\tpublic Queue(int count) {\n\t\t\tif (count < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"count\");\n\n\t\t\t_array = new T[count];\n\t\t}\n\n\t\tpublic Queue(IEnumerable<T> collection) {\n\t\t\tif (collection == null)\n\t\t\t\tthrow new ArgumentNullException(\"collection\");\n\n\t\t\tforeach (T t in collection)\n\t\t\t\tEnqueue(t);\n\t\t}\n\n\t\tpublic void Clear() {\n\t\t\tif (_array != null)\n\t\t\t\tArray.Clear(_array, 0, _array.Length);\n\n\t\t\t_head = _tail = _size = 0;\n\t\t\t_version++;\n\t\t}\n\n\t\tpublic bool Contains(T item) {\n\t\t\tif (item == null) {\n\t\t\t\tforeach (T t in this)\n\t\t\t\t\tif (t == null)\n\t\t\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tforeach (T t in this)\n\t\t\t\t\tif (item.Equals(t))\n\t\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic void CopyTo(T[] array, int idx) {\n\t\t\tif (array == null)\n\t\t\t\tthrow new ArgumentNullException();\n\n\t\t\tif ((uint)idx > (uint)array.Length)\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\n\t\t\tif (array.Length - idx < _size)\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\n\t\t\tif (_size == 0)\n\t\t\t\treturn;\n\n\t\t\tint contents_length = _array.Length;\n\t\t\tint length_from_head = contents_length - _head;\n\n\t\t\tArray.Copy(_array, _head, array, idx, Math.Min(_size, length_from_head));\n\t\t\tif (_size > length_from_head)\n\t\t\t\tArray.Copy(_array, 0, array,\n\t\t\t\t\t\tidx + length_from_head,\n\t\t\t\t\t\t_size - length_from_head);\n\n\t\t}\n\n\t\tvoid ICollection.CopyTo(Array array, int idx) {\n\t\t\tif (array == null)\n\t\t\t\tthrow new ArgumentNullException();\n\n\t\t\tif ((uint)idx < (uint)array.Length)\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\n\t\t\tif (array.Length - idx < _size)\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\n\t\t\tif (_size == 0)\n\t\t\t\treturn;\n\n\t\t\ttry {\n\t\t\t\tint contents_length = _array.Length;\n\t\t\t\tint length_from_head = contents_length - _head;\n\n\t\t\t\tArray.Copy(_array, _head, array, idx, Math.Min(_size, length_from_head));\n\t\t\t\tif (_size > length_from_head)\n\t\t\t\t\tArray.Copy(_array, 0, array,\n\t\t\t\t\t\t\tidx + length_from_head,\n\t\t\t\t\t\t\t_size - length_from_head);\n\t\t\t} catch (ArrayTypeMismatchException) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t}\n\n\t\tpublic T Dequeue() {\n\t\t\tT ret = Peek();\n\n\t\t\t// clear stuff out to make the GC happy\n\t\t\t_array[_head] = default(T);\n\n\t\t\tif (++_head == _array.Length)\n\t\t\t\t_head = 0;\n\t\t\t_size--;\n\t\t\t_version++;\n\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic T Peek() {\n\t\t\tif (_size == 0)\n\t\t\t\tthrow new InvalidOperationException();\n\n\t\t\treturn _array[_head];\n\t\t}\n\n\t\tpublic void Enqueue(T item) {\n\t\t\tif (_array == null || _size == _array.Length)\n\t\t\t\tSetCapacity(Math.Max(_size * 2, 4));\n\n\t\t\t_array[_tail] = item;\n\n\t\t\tif (++_tail == _array.Length)\n\t\t\t\t_tail = 0;\n\n\t\t\t_size++;\n\t\t\t_version++;\n\t\t}\n\n\t\tpublic T[] ToArray() {\n\t\t\tT[] t = new T[_size];\n\t\t\tCopyTo(t, 0);\n\t\t\treturn t;\n\t\t}\n\n\t\tpublic void TrimExcess() {\n\t\t\tif (_array != null && (_size < _array.Length * 0.9))\n\t\t\t\tSetCapacity(_size);\n\t\t}\n\n\t\tvoid SetCapacity(int new_size) {\n\t\t\tif (_array != null && new_size == _array.Length)\n\t\t\t\treturn;\n\n\t\t\tif (new_size < _size)\n\t\t\t\tthrow new InvalidOperationException(\"shouldnt happen\");\n\n\t\t\tT[] new_data = new T[new_size];\n\t\t\tif (_size > 0)\n\t\t\t\tCopyTo(new_data, 0);\n\n\t\t\t_array = new_data;\n\t\t\t_tail = _size;\n\t\t\t_head = 0;\n\t\t\t_version++;\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget { return _size; }\n\t\t}\n\n\t\tbool ICollection.IsSynchronized {\n\t\t\tget { return false; }\n\t\t}\n\n\t\tobject ICollection.SyncRoot {\n\t\t\tget { return this; }\n\t\t}\n\n\t\tpublic Enumerator GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tIEnumerator<T> IEnumerable<T>.GetEnumerator() {\n\t\t\treturn GetEnumerator();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator() {\n\t\t\treturn GetEnumerator();\n\t\t}\n\n\t\tpublic struct Enumerator : IEnumerator<T>, IEnumerator, IDisposable {\n\t\t\tconst int NOT_STARTED = -2;\n\n\t\t\t// this MUST be -1, because we depend on it in move next.\n\t\t\t// we just decr the _size, so, 0 - 1 == FINISHED\n\t\t\tconst int FINISHED = -1;\n\n\t\t\tQueue<T> q;\n\t\t\tint idx;\n\t\t\tint ver;\n\n\t\t\tinternal Enumerator(Queue<T> q) {\n\t\t\t\tthis.q = q;\n\t\t\t\tidx = NOT_STARTED;\n\t\t\t\tver = q._version;\n\t\t\t}\n\n\t\t\tpublic void Dispose() {\n\t\t\t\tidx = NOT_STARTED;\n\t\t\t}\n\n\t\t\tpublic bool MoveNext() {\n\t\t\t\tif (ver != q._version)\n\t\t\t\t\tthrow new InvalidOperationException();\n\n\t\t\t\tif (idx == NOT_STARTED)\n\t\t\t\t\tidx = q._size;\n\n\t\t\t\treturn idx != FINISHED && --idx != FINISHED;\n\t\t\t}\n\n\t\t\tpublic T Current {\n\t\t\t\tget {\n\t\t\t\t\tif (idx < 0)\n\t\t\t\t\t\tthrow new InvalidOperationException();\n\n\t\t\t\t\treturn q._array[(q._size - 1 - idx + q._head) % q._array.Length];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvoid IEnumerator.Reset() {\n\t\t\t\tif (ver != q._version)\n\t\t\t\t\tthrow new InvalidOperationException();\n\n\t\t\t\tidx = NOT_STARTED;\n\t\t\t}\n\n\t\t\tobject IEnumerator.Current {\n\t\t\t\tget { return Current; }\n\t\t\t}\n\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System/System.Collections.Generic/Stack.cs",
    "content": "//\n// System.Collections.Generic.Stack\n//\n// Authors:\n//\tMartin Baulig (martin@ximian.com)\n//\tBen Maurer (bmaurer@ximian.com)\n//\n// (C) 2003, 2004 Novell, Inc.\n//\n\n//\n// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nusing System;\n//using System.Runtime.InteropServices;\n\nnamespace System.Collections.Generic\n{\n\tpublic class Stack <T> : IEnumerable <T>, ICollection, IEnumerable\n\t{\n\t\tT [] _array;\n\t\tint _size;\n\t\tint _version;\n\t\t\n\t\tprivate const int INITIAL_SIZE = 16;\n\n\t\tpublic Stack ()\n\t\t{\n\t\t}\n\t\t\n\t\tpublic Stack (int count)\n\t\t{\n\t\t\tif (count < 0)\n\t\t\t\tthrow new ArgumentOutOfRangeException (\"count\");\n\n\t\t\t_array = new T [count];\n\t\t}\n\t\t\n\t\tpublic Stack (IEnumerable <T> collection)\n\t\t{\n\t\t\tif (collection == null)\n\t\t\t\tthrow new ArgumentNullException (\"collection\");\n\t\t\t\n\t\t\tICollection <T> col = collection as ICollection <T>;\n\t\t\t\n\t\t\tif (col != null) {\n\t\t\t\t_size = col.Count;\n\t\t\t\t_array = new T [_size];\n\t\t\t\tcol.CopyTo (_array, 0);\n\t\t\t} else {\n\t\t\t\tforeach (T t in collection)\n\t\t\t\t\tPush (t);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic void Clear ()\n\t\t{\n\t\t\tif (_array != null)\n\t\t\t\tArray.Clear (_array, 0, _array.Length);\n\t\t\t\n\t\t\t_size = 0;\n\t\t\t_version ++;\n\t\t}\n\t\t\n\t\tpublic bool Contains (T t)\n\t\t{\t\t\n\t\t\treturn _array != null && Array.IndexOf (_array, t, 0, _size) != -1;\n\t\t}\n\t\t\n\t\tpublic void CopyTo (T [] dest, int idx)\n\t\t{\n\t\t\t// this gets copied in the order that it is poped\n\t\t\tif (_array != null) {\n\t\t\t\tArray.Copy (_array, 0, dest, idx, _size);\n\t\t\t\tArray.Reverse (dest, idx, _size);\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic T Peek ()\n\t\t{\n\t\t\tif (_size == 0)\n\t\t\t\tthrow new InvalidOperationException ();\n\t\t\t\n\t\t\treturn _array [_size - 1];\n\t\t}\n\t\t\n\t\tpublic T Pop ()\n\t\t{\n\t\t\tif (_size == 0)\n\t\t\t\tthrow new InvalidOperationException ();\n\t\t\t\n\t\t\t_version ++;\n\t\t\tT popped = _array [--_size];\n\t\t\t// clear stuff out to make the GC happy\n\t\t\t_array [_size] = default(T);\n\t\t\treturn popped;\n\t\t}\n\n\t\tpublic void Push (T t)\n\t\t{\n\t\t\tif (_size == 0 || _size == _array.Length)\n\t\t\t\tArray.Resize <T> (ref _array, _size == 0 ? INITIAL_SIZE : 2 * _size);\n\t\t\t\n\t\t\t_version ++;\n\t\t\t\n\t\t\t_array [_size++] = t;\n\t\t}\n\t\t\n\t\tpublic T [] ToArray ()\n\t\t{\n\t\t\tT [] copy = new T [_size];\n\t\t\tCopyTo (copy, 0);\n\t\t\treturn copy;\n\t\t}\n\n\t\tpublic void TrimExcess ()\n\t\t{\n\t\t\tif (_array != null && (_size < _array.Length * 0.9))\n\t\t\t\tArray.Resize <T> (ref _array, _size);\n\t\t\t_version ++;\n\t\t}\n\t\t\n\t\tpublic int Count {\n\t\t\tget { return _size; }\n\t\t}\n\t\t\n\t\tbool ICollection.IsSynchronized {\n\t\t\tget { return false; }\n\t\t}\n\t\t\n\t\tobject ICollection.SyncRoot {\n\t\t\tget { return this; }\n\t\t}\n\t\t\n\t\tvoid ICollection.CopyTo (Array dest, int idx)\n\t\t{\n\t\t\ttry {\n\t\t\t\tif (_array != null) {\n\t\t\t\t\t_array.CopyTo (dest, idx);\n\t\t\t\t\tArray.Reverse (dest, idx, _size);\n\t\t\t\t}\n\t\t\t} catch (ArrayTypeMismatchException) {\n\t\t\t\tthrow new ArgumentException ();\n\t\t\t}\n\t\t}\n\t\t\n\t\tpublic Enumerator GetEnumerator ()\n\t\t{\n\t\t\treturn new Enumerator (this);\n\t\t}\n\n\t\tIEnumerator <T> IEnumerable<T>.GetEnumerator ()\n\t\t{\n\t\t\treturn GetEnumerator ();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator ()\n\t\t{\n\t\t\treturn GetEnumerator ();\n\t\t}\n\t\t\n\t\tpublic struct Enumerator : IEnumerator <T>, IEnumerator, IDisposable {\n\t\t\tconst int NOT_STARTED = -2;\n\t\t\t\n\t\t\t// this MUST be -1, because we depend on it in move next.\n\t\t\t// we just decr the _size, so, 0 - 1 == FINISHED\n\t\t\tconst int FINISHED = -1;\n\t\t\t\n\t\t\tStack <T> parent;\n\t\t\tint idx;\n\t\t\tint _version;\n\t\t\t\n\t\t\tinternal Enumerator (Stack <T> t)\n\t\t\t{\n\t\t\t\tparent = t;\n\t\t\t\tidx = NOT_STARTED;\n\t\t\t\t_version = t._version;\n\t\t\t}\n\t\t\t\n\t\t\tpublic void Dispose ()\n\t\t\t{\n\t\t\t\tidx = NOT_STARTED;\n\t\t\t}\n\t\t\t\n\t\t\tpublic bool MoveNext ()\n\t\t\t{\n\t\t\t\tif (_version != parent._version)\n\t\t\t\t\tthrow new InvalidOperationException ();\n\t\t\t\t\n\t\t\t\tif (idx == -2)\n\t\t\t\t\tidx = parent._size;\n\t\t\t\t\n\t\t\t\treturn idx != FINISHED && -- idx != FINISHED;\n\t\t\t}\n\t\t\t\n\t\t\tpublic T Current {\n\t\t\t\tget {\n\t\t\t\t\tif (idx < 0)\n\t\t\t\t\t\tthrow new InvalidOperationException ();\n\t\t\t\t\t\n\t\t\t\t\treturn parent._array [idx];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tvoid IEnumerator.Reset ()\n\t\t\t{\n\t\t\t\tif (_version != parent._version)\n\t\t\t\t\tthrow new InvalidOperationException ();\n\t\t\t\t\n\t\t\t\tidx = NOT_STARTED;\n\t\t\t}\n\t\t\t\n\t\t\tobject IEnumerator.Current {\n\t\t\t\tget { return Current; }\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System/System.ComponentModel/Win32Exception.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Runtime.InteropServices;\n\nnamespace System.ComponentModel {\n\tpublic class Win32Exception : ExternalException {\n\n\t\tprivate int nativeError = 0;\n\n\t\tpublic Win32Exception() : base(\"Win32 exception\", 0) { }\n\n\t\tpublic Win32Exception(int err)\n\t\t\t: base(\"Win32 exception\", err) {\n\t\t\tthis.nativeError = err;\n\t\t}\n\n\t\tpublic Win32Exception(int err, string msg)\n\t\t\t: base(msg, err) {\n\t\t\tthis.nativeError = err;\n\t\t}\n\n\t\tpublic int NativeErrorCode {\n\t\t\tget {\n\t\t\t\treturn this.nativeError;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System/System.Net/Dns.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Runtime.CompilerServices;\n\nnamespace System.Net {\n\tpublic static class Dns {\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static int[] Internal_GetHostEnt(string dnsName, out string hostName);\n\n\t\tpublic static IPHostEntry GetHostEntry(string hostNameOrAddress) {\n\t\t\tIPAddress ipAddr;\n\t\t\tbool isIPAddr = IPAddress.TryParse(hostNameOrAddress, out ipAddr);\n\t\t\tif (!isIPAddr) {\n\t\t\t\tstring hostName;\n\t\t\t\tint[] ips = Internal_GetHostEnt(hostNameOrAddress, out hostName);\n\t\t\t\tIPAddress[] addresses = new IPAddress[ips.Length];\n\t\t\t\tfor (int i = 0; i < ips.Length; i++) {\n\t\t\t\t\taddresses[i] = new IPAddress((uint)ips[i]);\n\t\t\t\t}\n\t\t\t\tIPHostEntry hostEnt = new IPHostEntry();\n\t\t\t\thostEnt.AddressList = addresses;\n\t\t\t\thostEnt.HostName = hostName;\n\t\t\t\treturn hostEnt;\n\t\t\t} else {\n\t\t\t\treturn GetHostEntry(ipAddr);\n\t\t\t}\n\t\t}\n\n\t\tpublic static IPHostEntry GetHostEntry(IPAddress addr) {\n\t\t\tif (addr == null) {\n\t\t\t\tthrow new ArgumentNullException(\"address\");\n\t\t\t}\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System/System.Net/EndPoint.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Net.Sockets;\n\nnamespace System.Net {\n\tpublic abstract class EndPoint {\n\n\t\tprotected EndPoint() { }\n\n\t\tpublic virtual EndPoint Create(SocketAddress address) {\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t\tpublic virtual AddressFamily AddressFamily {\n\t\t\tget {\n\t\t\t\tthrow new NotSupportedException();\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual SocketAddress Serialize() {\n\t\t\tthrow new NotSupportedException();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System/System.Net/IPAddress.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Net.Sockets;\n\nnamespace System.Net {\n\tpublic class IPAddress {\n\n\t\tpublic static readonly IPAddress Any = new IPAddress(0);\n\t\tpublic static readonly IPAddress Broadcast = IPAddress.Parse(\"255.255.255.255\");\n\t\tpublic static readonly IPAddress Loopback = IPAddress.Parse(\"127.0.0.1\");\n\t\tpublic static readonly IPAddress None = IPAddress.Parse(\"255.255.255.255\");\n\n\t\tpublic static IPAddress Parse(string ip) {\n\t\t\tIPAddress addr;\n\t\t\tif (TryParse(ip, out addr)) {\n\t\t\t\treturn addr;\n\t\t\t}\n\t\t\tthrow new FormatException(\"An invalid IP address was specified\");\n\t\t}\n\n\t\tpublic static bool TryParse(string ip, out IPAddress address) {\n\t\t\t// Only handle IPv4\n\t\t\tif (ip == null) {\n\t\t\t\tthrow new ArgumentNullException(\"ip\");\n\t\t\t}\n\t\t\tif (ip.Length == 0 || ip == \" \") {\n\t\t\t\taddress = new IPAddress(0);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tstring[] parts = ip.Split('.');\n\t\t\tif (parts.Length != 4) {\n\t\t\t\taddress = null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tuint a = 0;\n\t\t\tfor (int i = 0; i < 4; i++) {\n\t\t\t\tint val;\n\t\t\t\tif (!int.TryParse(parts[i], out val)) {\n\t\t\t\t\taddress = null;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\ta |= ((uint)val) << (i << 3);\n\t\t\t}\n\t\t\taddress = new IPAddress((long)a);\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate uint ip4Address;\n\t\tprivate AddressFamily family = AddressFamily.InterNetwork;\n\n\t\tpublic IPAddress(long addr) {\n\t\t\tthis.ip4Address = (uint)addr;\n\t\t}\n\n\t\tpublic AddressFamily AddressFamily {\n\t\t\tget {\n\t\t\t\treturn this.family;\n\t\t\t}\n\t\t}\n\n\t\tinternal uint InternalIPv4Address {\n\t\t\tget { return this.ip4Address; }\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.ip4Address;\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\tIPAddress a = obj as IPAddress;\n\t\t\treturn a != null && a.ip4Address == this.ip4Address;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn string.Format(\"{0}.{1}.{2}.{3}\",\n\t\t\t\tthis.ip4Address & 0xff, (this.ip4Address >> 8) & 0xff,\n\t\t\t\t(this.ip4Address >> 16) & 0xff, this.ip4Address >> 24);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System/System.Net/IPEndPoint.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Net.Sockets;\n\nnamespace System.Net {\n\tpublic class IPEndPoint : EndPoint {\n\n\t\tpublic const int MinPort = 0;\n\t\tpublic const int MaxPort = 0xffff;\n\n\t\tpublic IPAddress address;\n\t\tpublic int port;\n\n\t\tpublic IPEndPoint(IPAddress addr, int port) {\n\t\t\tif (addr == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tthis.Address = addr;\n\t\t\tthis.Port = port;\n\t\t}\n\n\t\tpublic IPEndPoint(long addr, int port) : this(new IPAddress(addr), port) { }\n\n\t\tpublic IPAddress Address {\n\t\t\tget {\n\t\t\t\treturn this.address;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.address = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Port {\n\t\t\tget {\n\t\t\t\treturn this.port;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value < MinPort || value > MaxPort) {\n\t\t\t\t\tthrow new ArgumentOutOfRangeException(\"Port\");\n\t\t\t\t}\n\t\t\t\tthis.port = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override AddressFamily AddressFamily {\n\t\t\tget {\n\t\t\t\treturn this.address.AddressFamily;\n\t\t\t}\n\t\t}\n\n\t\tpublic override EndPoint Create(SocketAddress sockaddr) {\n\t\t\tif (sockaddr.Size < 8) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (sockaddr.Family != AddressFamily.InterNetwork) {\n\t\t\t\t// Only support IP4\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tint port = (((int)sockaddr[2]) << 8) | (int)sockaddr[3];\n\t\t\tlong address = (((long)sockaddr[7]) << 24) |\n\t\t\t\t(((long)sockaddr[6]) << 16) |\n\t\t\t\t(((long)sockaddr[5]) << 8) |\n\t\t\t\t(long)sockaddr[4];\n\t\t\treturn new IPEndPoint(address, port);\n\t\t}\n\n\t\tpublic override SocketAddress Serialize() {\n\t\t\tSocketAddress sockaddr = null;\n\t\t\tswitch (this.address.AddressFamily) {\n\t\t\t\tcase AddressFamily.InterNetwork:\n\t\t\t\t\t// .net produces a 16 byte buffer, even though\n\t\t\t\t\t// only 8 bytes are used. I guess its just a\n\t\t\t\t\t// holdover from struct sockaddr padding.\n\t\t\t\t\tsockaddr = new SocketAddress(AddressFamily.InterNetwork, 16);\n\n\t\t\t\t\t// bytes 2 and 3 store the port, the rest\n\t\t\t\t\t// stores the address\n\t\t\t\t\tsockaddr[2] = (byte)((this.port >> 8) & 0xff);\n\t\t\t\t\tsockaddr[3] = (byte)(this.port & 0xff);\n\t\t\t\t\tuint addr = this.address.InternalIPv4Address;\n\t\t\t\t\tsockaddr[4] = (byte)(addr & 0xff);\n\t\t\t\t\tsockaddr[5] = (byte)((addr >> 8) & 0xff);\n\t\t\t\t\tsockaddr[6] = (byte)((addr >> 16) & 0xff);\n\t\t\t\t\tsockaddr[7] = (byte)((addr >> 24) & 0xff);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\treturn sockaddr;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn this.address.ToString() + \":\" + this.port.ToString();\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn this.address.GetHashCode() + this.port;\n\t\t}\n\n\t\tpublic override bool Equals(Object obj) {\n\t\t\tIPEndPoint p = obj as IPEndPoint;\n\t\t\treturn p != null &&\n\t\t\t\t   p.port == this.port &&\n\t\t\t\t   p.address.Equals(this.address);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System/System.Net/IPHostEntry.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Net {\n\tpublic class IPHostEntry {\n\n\t\tprivate IPAddress[] addressList;\n\t\tprivate String[] aliases;\n\t\tprivate String hostName;\n\n\t\tpublic IPHostEntry() {\n\t\t}\n\n\t\tpublic IPAddress[] AddressList {\n\t\t\tget { return addressList; }\n\t\t\tset { addressList = value; }\n\t\t}\n\n\t\tpublic string[] Aliases {\n\t\t\tget { return aliases; }\n\t\t\tset { aliases = value; }\n\t\t}\n\n\t\tpublic string HostName {\n\t\t\tget { return hostName; }\n\t\t\tset { hostName = value; }\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System/System.Net/SocketAddress.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Net.Sockets;\n\nnamespace System.Net {\n\tpublic class SocketAddress {\n\t\tprivate byte[] data;\n\n\t\tpublic SocketAddress(AddressFamily family, int size) {\n\t\t\tif (size < 2) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"size is too small\");\n\t\t\t}\n\n\t\t\tdata = new byte[size];\n\t\t\tdata[0] = (byte)family;\n\t\t\tdata[1] = (byte)((int)family >> 8);\n\t\t}\n\n\t\tpublic SocketAddress(AddressFamily family) : this(family, 32) { }\n\n\t\tpublic AddressFamily Family {\n\t\t\tget {\n\t\t\t\treturn (AddressFamily)(data[0] + (data[1] << 8));\n\t\t\t}\n\t\t}\n\n\t\tpublic int Size {\n\t\t\tget {\n\t\t\t\treturn data.Length;\n\t\t\t}\n\t\t}\n\n\t\tpublic byte this[int offset] {\n\t\t\tget {\n\t\t\t\treturn (data[offset]);\n\t\t\t}\n\n\t\t\tset {\n\t\t\t\tdata[offset] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\tstring af = ((AddressFamily)data[0]).ToString();\n\t\t\tint size = data.Length;\n\t\t\tstring ret = af + \":\" + size + \":{\";\n\n\t\t\tfor (int i = 2; i < size; i++) {\n\t\t\t\tint val = (int)data[i];\n\t\t\t\tret = ret + val;\n\t\t\t\tif (i < size - 1) {\n\t\t\t\t\tret = ret + \",\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tret = ret + \"}\";\n\n\t\t\treturn (ret);\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\tif (obj is System.Net.SocketAddress &&\n\t\t\t\t((System.Net.SocketAddress)obj).data.Length == data.Length) {\n\t\t\t\tbyte[] otherData = ((System.Net.SocketAddress)obj).data;\n\t\t\t\tfor (int i = 0; i < data.Length; i++)\n\t\t\t\t\tif (otherData[i] != data[i])\n\t\t\t\t\t\treturn false;\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\tint code = 0;\n\n\t\t\tfor (int i = 0; i < data.Length; i++)\n\t\t\t\tcode += data[i] + i;\n\n\t\t\treturn code;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System/System.Net.Sockets/AddressFamily.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Net.Sockets {\n\tpublic enum AddressFamily {\n\t\tUnknown = -1,\n\t\tUnspecified = 0,\n\t\tUnix = 1,\n\t\tInterNetwork = 2,\n\t\tImpLink = 3,\n\t\tPup = 4,\n\t\tChaos = 5,\n\t\tNS = 6,\n\t\tIpx = 6,\n\t\tIso = 7,\n\t\tOsi = 7,\n\t\tEcma = 8,\n\t\tDataKit = 9,\n\t\tCcitt = 10,\n\t\tSna = 11,\n\t\tDecNet = 12,\n\t\tDataLink = 13,\n\t\tLat = 14,\n\t\tHyperChannel = 15,\n\t\tAppleTalk = 16,\n\t\tNetBios = 17,\n\t\tVoiceView = 18,\n\t\tFireFox = 19,\n\t\tBanyan = 21,\n\t\tAtm = 22,\n\t\tInterNetworkV6 = 23,\n\t\tCluster = 24,\n\t\tIeee12844 = 25,\n\t\tIrda = 26,\n\t\tNetworkDesigners = 28,\n\t\tMax = 29,\n\t}\n}\n"
  },
  {
    "path": "System/System.Net.Sockets/ProtocolType.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Net.Sockets {\n\tpublic enum ProtocolType {\n\t\tIP = 0,\n\t\tIcmp = 1,\n\t\tIgmp = 2,\n\t\tGgp = 3,\n\t\tTcp = 6,\n\t\tPup = 12,\n\t\tUdp = 17,\n\t\tIdp = 22,\n\t\tIPv6 = 41,\n\t\tND = 77,\n\t\tRaw = 255,\n\t\tUnspecified = 0,\n\t\tIpx = 1000,\n\t\tSpx = 1256,\n\t\tSpxII = 1257,\n\t\tUnknown = -1,\n\t\tIPv4 = 4,\n\t\tIPv6RoutingHeader = 43,\n\t\tIPv6FragmentHeader = 44,\n\t\tIPSecEncapsulatingSecurityPayload = 50,\n\t\tIPSecAuthenticationHeader = 51,\n\t\tIcmpV6 = 58,\n\t\tIPv6NoNextHeader = 59,\n\t\tIPv6DestinationOptions = 60,\n\t\tIPv6HopByHopOptions = 0,\n\t}\n}\n"
  },
  {
    "path": "System/System.Net.Sockets/Socket.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Runtime.CompilerServices;\n\nnamespace System.Net.Sockets {\n\tpublic class Socket : IDisposable {\n\n\t\t#region Internal Methods\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static IntPtr Internal_CreateSocket(int family, int type, int proto, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static void Internal_Close(IntPtr native);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static void Internal_Bind(IntPtr native, uint address, int port, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static void Internal_Listen(IntPtr native, int backLog, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static IntPtr Internal_Accept(IntPtr native, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static void Internal_Connect(IntPtr native, uint address, int port, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static int Internal_Receive(IntPtr native, byte[] buffer, int offset, int size, int flags, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static int Internal_Send(IntPtr native, byte[] buffer, int offset, int size, int flags, out int error);\n\n\t\t#endregion\n\n\t\tprivate IntPtr native;\n\t\tprivate AddressFamily family;\n\t\tprivate SocketType type;\n\t\tprivate ProtocolType proto;\n\n\t\tpublic Socket(AddressFamily family, SocketType type, ProtocolType proto) {\n\t\t\tthis.family = family;\n\t\t\tthis.type = type;\n\t\t\tthis.proto = proto;\n\n\t\t\tint error;\n\t\t\tthis.native = Internal_CreateSocket((int)family, (int)type, (int)proto, out error);\n\t\t\tthis.CheckError(error);\n\t\t}\n\n\t\tprivate Socket(AddressFamily family, SocketType type, ProtocolType proto, IntPtr native) {\n\t\t\tthis.family = family;\n\t\t\tthis.type = type;\n\t\t\tthis.proto = proto;\n\t\t\tthis.native = native;\n\t\t}\n\n\t\t~Socket() {\n\t\t\tthis.Dispose(false);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing) {\n\t\t\tif (this.native != IntPtr.Zero) {\n\t\t\t\tInternal_Close(this.native);\n\t\t\t\tthis.native = IntPtr.Zero;\n\t\t\t\tif (disposing) {\n\t\t\t\t\tGC.SuppressFinalize(this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvoid IDisposable.Dispose() {\n\t\t\tthis.Dispose(true);\n\t\t}\n\n\t\tpublic void Close() {\n\t\t\tthis.Dispose(true);\n\t\t}\n\n\t\tprivate void CheckDisposed() {\n\t\t\tif (this.native == IntPtr.Zero) {\n\t\t\t\tthrow new ObjectDisposedException(this.GetType().ToString());\n\t\t\t}\n\t\t}\n\n\t\tprivate void CheckError(int error) {\n\t\t\tif (error != 0) {\n\t\t\t\tConsole.WriteLine(\"SOCKET_ERROR {0}\", error);\n\t\t\t\tthrow new SocketException(error);\n\t\t\t}\n\t\t}\n\n\t\tprivate void GetIPInfo(EndPoint ep, out uint addr, out int port) {\n\t\t\tif (ep.AddressFamily != AddressFamily.InterNetwork) {\n\t\t\t\tthrow new ArgumentException(\"EndPoint\", \"Can only handle IPv4 addresses\");\n\t\t\t}\n\t\t\tSocketAddress sockAddr = ep.Serialize();\n\t\t\tport = (((int)sockAddr[2]) << 8) | sockAddr[3];\n\t\t\taddr = ((((uint)sockAddr[7]) << 24) | (((uint)sockAddr[6]) << 16) |\n\t\t\t\t(((uint)sockAddr[5]) << 8) | (uint)sockAddr[4]);\n\t\t}\n\n\t\tpublic void Bind(EndPoint epLocal) {\n\t\t\tthis.CheckDisposed();\n\t\t\tif (epLocal == null) {\n\t\t\t\tthrow new ArgumentNullException(\"epLocal\");\n\t\t\t}\n\t\t\tint port;\n\t\t\tuint addr;\n\t\t\tthis.GetIPInfo(epLocal, out addr, out port);\n\t\t\tint error;\n\t\t\tInternal_Bind(this.native, addr, port, out error);\n\t\t\tthis.CheckError(error);\n\t\t}\n\n\t\tpublic void Listen(int backLog) {\n\t\t\tthis.CheckDisposed();\n\t\t\tint error;\n\t\t\tInternal_Listen(this.native, backLog, out error);\n\t\t\tthis.CheckError(error);\n\t\t}\n\n\t\tpublic Socket Accept() {\n\t\t\tthis.CheckDisposed();\n\t\t\tint error;\n\t\t\tIntPtr socket = Internal_Accept(this.native, out error);\n\t\t\tthis.CheckError(error);\n\t\t\treturn new Socket(this.family, this.type, this.proto, socket);\n\t\t}\n\n\t\tpublic void Connect(EndPoint epRemote) {\n\t\t\tthis.CheckDisposed();\n\t\t\tif (epRemote == null) {\n\t\t\t\tthrow new ArgumentNullException(\"epRemote\");\n\t\t\t}\n\t\t\tint port;\n\t\t\tuint addr;\n\t\t\tthis.GetIPInfo(epRemote, out addr, out port);\n\t\t\tint error;\n\t\t\tInternal_Connect(this.native, addr, port, out error);\n\t\t\tthis.CheckError(error);\n\t\t}\n\n\t\tpublic int Send(byte[] buffer) {\n\t\t\treturn this.Send(buffer, 0, buffer.Length, SocketFlags.None);\n\t\t}\n\n\t\tpublic int Send(byte[] buffer, SocketFlags flags) {\n\t\t\treturn this.Send(buffer, 0, buffer.Length, flags);\n\t\t}\n\n\t\tpublic int Send(byte[] buffer, int size, SocketFlags flags) {\n\t\t\treturn this.Send(buffer, 0, size, flags);\n\t\t}\n\n\t\tpublic int Send(byte[] buffer, int offset, int size, SocketFlags flags) {\n\t\t\tthis.CheckDisposed();\n\t\t\tif (buffer == null) {\n\t\t\t\tthrow new ArgumentNullException(\"buffer\");\n\t\t\t}\n\t\t\tif (offset < 0 || size < 0 || offset + size > buffer.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tint error;\n\t\t\tint ret = Internal_Send(this.native, buffer, offset, size, (int)flags, out error);\n\t\t\tthis.CheckError(error);\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic int Receive(byte[] buffer) {\n\t\t\treturn this.Receive(buffer, 0, buffer.Length, SocketFlags.None);\n\t\t}\n\n\t\tpublic int Receive(byte[] buffer, SocketFlags flags) {\n\t\t\treturn this.Receive(buffer, 0, buffer.Length, flags);\n\t\t}\n\n\t\tpublic int Receive(byte[] buffer, int size, SocketFlags flags) {\n\t\t\treturn this.Receive(buffer, 0, size, flags);\n\t\t}\n\n\t\tpublic int Receive(byte[] buffer, int offset, int size, SocketFlags flags) {\n\t\t\tthis.CheckDisposed();\n\t\t\tif (buffer == null) {\n\t\t\t\tthrow new ArgumentNullException(\"buffer\");\n\t\t\t}\n\t\t\tif (offset < 0 || size < 0 || offset + size > buffer.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tint error;\n\t\t\tint ret = Internal_Receive(this.native, buffer, offset, size, (int)flags, out error);\n\t\t\tthis.CheckError(error);\n\t\t\treturn ret;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System/System.Net.Sockets/SocketException.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.ComponentModel;\n\nnamespace System.Net.Sockets {\n\tpublic class SocketException : Win32Exception {\n\n\t\tpublic SocketException(int error) : base(error) { }\n\n\t\tpublic override int ErrorCode {\n\t\t\tget {\n\t\t\t\treturn NativeErrorCode;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System/System.Net.Sockets/SocketFlags.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Net.Sockets {\n\t[Flags]\n\tpublic enum SocketFlags {\n\t\tNone = 0x00000000,\n\t\tOutOfBand = 0x00000001,\n\t\tPeek = 0x00000002,\n\t\tDontRoute = 0x00000004,\n\t\tMaxIOVectorLength = 0x00000010,\n\t\tTruncated = 0x00000100,\n\t\tControlDataTruncated = 0x00000200,\n\t\tBroadcast = 0x00000400,\n\t\tMulticast = 0x00000800,\n\t\tPartial = 0x00008000,\n\t}\n}\n"
  },
  {
    "path": "System/System.Net.Sockets/SocketOptionLevel.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Net.Sockets {\n\tpublic enum SocketOptionLevel {\n\t\tSocket = 65535,\n\t\tIP = 0,\n\t\tIPv6 = 41,\n\t\tTcp = 6,\n\t\tUdp = 17,\n\t}\n}\n"
  },
  {
    "path": "System/System.Net.Sockets/SocketOptionName.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Net.Sockets {\n\tpublic enum SocketOptionName {\n\t\tDebug = 1,\n\t\tAcceptConnection = 2,\n\t\tReuseAddress = 4,\n\t\tKeepAlive = 8,\n\t\tDontRoute = 16,\n\t\tBroadcast = 32,\n\t\tUseLoopback = 64,\n\t\tLinger = 128,\n\t\tOutOfBandInline = 256,\n\t\tDontLinger = -129,\n\t\tExclusiveAddressUse = -5,\n\t\tSendBuffer = 4097,\n\t\tReceiveBuffer = 4098,\n\t\tSendLowWater = 4099,\n\t\tReceiveLowWater = 4100,\n\t\tSendTimeout = 4101,\n\t\tReceiveTimeout = 4102,\n\t\tError = 4103,\n\t\tType = 4104,\n\t\tMaxConnections = 2147483647,\n\t\tIPOptions = 1,\n\t\tHeaderIncluded = 2,\n\t\tTypeOfService = 3,\n\t\tIpTimeToLive = 4,\n\t\tMulticastInterface = 9,\n\t\tMulticastTimeToLive = 10,\n\t\tMulticastLoopback = 11,\n\t\tAddMembership = 12,\n\t\tDropMembership = 13,\n\t\tDontFragment = 14,\n\t\tAddSourceMembership = 15,\n\t\tDropSourceMembership = 16,\n\t\tBlockSource = 17,\n\t\tUnblockSource = 18,\n\t\tPacketInformation = 19,\n\t\tNoDelay = 1,\n\t\tBsdUrgent = 2,\n\t\tExpedited = 2,\n\t\tNoChecksum = 1,\n\t\tChecksumCoverage = 20,\n\t\tHopLimit = 21,\n\t\tUpdateAcceptContext = 28683,\n\t\tUpdateConnectContext = 28688,\n\t}\n}\n"
  },
  {
    "path": "System/System.Net.Sockets/SocketType.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Net.Sockets {\n\tpublic enum SocketType {\n\t\tStream = 1,\n\t\tDgram = 2,\n\t\tRaw = 3,\n\t\tRdm = 4,\n\t\tSeqpacket = 5,\n\t\tUnknown = -1,\n\t}\n}\n"
  },
  {
    "path": "System/System.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.30729</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{388F5D73-0211-4A64-B501-92CDC4E32ACF}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>System</RootNamespace>\n    <AssemblyName>System</AssemblyName>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <UpgradeBackupLocation>\n    </UpgradeBackupLocation>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <NoStdLib>true</NoStdLib>\n    <CodeAnalysisRules>\n    </CodeAnalysisRules>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <NoStdLib>true</NoStdLib>\n    <CodeAnalysisRules>\n    </CodeAnalysisRules>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"System.Collections.Generic\\Queue.cs\" />\n    <Compile Include=\"System.Collections.Generic\\Stack.cs\" />\n    <Compile Include=\"System.ComponentModel\\Win32Exception.cs\" />\n    <Compile Include=\"System.Net.Sockets\\AddressFamily.cs\" />\n    <Compile Include=\"System.Net.Sockets\\ProtocolType.cs\" />\n    <Compile Include=\"System.Net.Sockets\\Socket.cs\" />\n    <Compile Include=\"System.Net.Sockets\\SocketException.cs\" />\n    <Compile Include=\"System.Net.Sockets\\SocketFlags.cs\" />\n    <Compile Include=\"System.Net.Sockets\\SocketOptionLevel.cs\" />\n    <Compile Include=\"System.Net.Sockets\\SocketOptionName.cs\" />\n    <Compile Include=\"System.Net.Sockets\\SocketType.cs\" />\n    <Compile Include=\"System.Net\\Dns.cs\" />\n    <Compile Include=\"System.Net\\EndPoint.cs\" />\n    <Compile Include=\"System.Net\\IPAddress.cs\" />\n    <Compile Include=\"System.Net\\IPEndPoint.cs\" />\n    <Compile Include=\"System.Net\\IPHostEntry.cs\" />\n    <Compile Include=\"System.Net\\SocketAddress.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.2.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\corlib\\corlib.csproj\">\n      <Project>{6a77a7c0-fb66-4caa-94ee-142dba20655d}</Project>\n      <Name>corlib</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <PropertyGroup>\n    <PostBuildEvent>xcopy $(TargetPath) $(SolutionDir)Builds\\$(ConfigurationName)\\ /Y</PostBuildEvent>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "System.Core/Properties/AssemblyInfo.cs",
    "content": "﻿//using System.Reflection;\n//using System.Runtime.CompilerServices;\n//using System.Runtime.InteropServices;\n\n//// General Information about an assembly is controlled through the following \n//// set of attributes. Change these attribute values to modify the information\n//// associated with an assembly.\n//[assembly: AssemblyTitle(\"System.Core\")]\n//[assembly: AssemblyDescription(\"\")]\n//[assembly: AssemblyConfiguration(\"\")]\n//[assembly: AssemblyCompany(\"\")]\n//[assembly: AssemblyProduct(\"System.Core\")]\n//[assembly: AssemblyCopyright(\"Copyright ©  2012\")]\n//[assembly: AssemblyTrademark(\"\")]\n//[assembly: AssemblyCulture(\"\")]\n\n//// Setting ComVisible to false makes the types in this assembly not visible \n//// to COM components.  If you need to access a type in this assembly from \n//// COM, set the ComVisible attribute to true on that type.\n//[assembly: ComVisible(false)]\n\n//// The following GUID is for the ID of the typelib if this project is exposed to COM\n//[assembly: Guid(\"60bd1f97-8a45-4bdb-9b4e-344f479dd643\")]\n\n//// Version information for an assembly consists of the following four values:\n////\n////      Major Version\n////      Minor Version \n////      Build Number\n////      Revision\n////\n//// You can specify all the values or you can default the Build and Revision Numbers \n//// by using the '*' as shown below:\n//// [assembly: AssemblyVersion(\"1.0.*\")]\n//[assembly: AssemblyVersion(\"1.0.0.0\")]\n//[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n"
  },
  {
    "path": "System.Core/System/Action.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace System {\n\n\tpublic delegate void Action<T>(T arg);\n\tpublic delegate void Action<T1, T2>(T1 arg1, T2 arg2);\n\tpublic delegate void Action<T1, T2, T3>(T1 arg1, T2 arg2, T3 arg3);\n\tpublic delegate void Action<T1, T2, T3, T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);\n\n}\n"
  },
  {
    "path": "System.Core/System/Func.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace System {\n\n\tpublic delegate TResult Func<TResult>();\n\tpublic delegate TResult Func<T, TResult>(T arg);\n\tpublic delegate TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2);\n\tpublic delegate TResult Func<T1, T2, T3, TResult>(T1 arg1, T2 arg2, T3 arg3);\n\tpublic delegate TResult Func<T1, T2, T3, T4, TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);\n\n}\n"
  },
  {
    "path": "System.Core/System.Collections.Generic/HashSet.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace System.Collections.Generic {\n\n\tpublic class HashSet<T> : ICollection<T>, IEnumerable<T>, IEnumerable {\n\n\t\tpublic struct Enumerator : IEnumerator<T>, IEnumerator, IDisposable {\n\n\t\t\tinternal Enumerator(HashSet<T> hashSet) {\n\t\t\t\tthis.en = hashSet.dict.Keys.GetEnumerator();\n\t\t\t}\n\n\t\t\tprivate IEnumerator<T> en;\n\n\t\t\tpublic T Current {\n\t\t\t\tget {\n\t\t\t\t\treturn this.en.Current;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Dispose() {\n\t\t\t}\n\n\t\t\tobject IEnumerator.Current {\n\t\t\t\tget {\n\t\t\t\t\treturn this.en.Current;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool MoveNext() {\n\t\t\t\treturn this.en.MoveNext();\n\t\t\t}\n\n\t\t\tpublic void Reset() {\n\t\t\t\tthis.en.Reset();\n\t\t\t}\n\n\t\t}\n\n\t\tprivate Dictionary<T, object> dict;\n\n\t\tpublic HashSet() {\n\t\t\tthis.dict = new Dictionary<T, object>();\n\t\t}\n\n\t\tpublic HashSet(IEnumerable<T> collection) : this(collection, null) { }\n\n\t\tpublic HashSet(IEqualityComparer<T> comparer) {\n\t\t\tthis.dict = new Dictionary<T, object>(comparer);\n\t\t}\n\n\t\tpublic HashSet(IEnumerable<T> collection, IEqualityComparer<T> comparer) {\n\t\t\tif (collection == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tthis.dict = new Dictionary<T, object>(comparer);\n\t\t\tforeach (T item in collection) {\n\t\t\t\tthis.dict[item] = null;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Add(T item) {\n\t\t\tbool ret = !this.dict.ContainsKey(item);\n\t\t\tthis.dict[item] = null;\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic void Clear() {\n\t\t\tthis.dict.Clear();\n\t\t}\n\n\t\tpublic bool Contains(T item) {\n\t\t\treturn this.dict.ContainsKey(item);\n\t\t}\n\n\t\tpublic void CopyTo(T[] array) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic void CopyTo(T[] array, int arrayIndex) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic void CopyTo(T[] array, int arrayIndex, int count) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic Enumerator GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tpublic bool Remove(T item) {\n\t\t\treturn this.dict.Remove(item);\n\t\t}\n\n\t\tpublic IEqualityComparer<T> Comparer {\n\t\t\tget {\n\t\t\t\treturn this.dict.Comparer;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn this.dict.Count;\n\t\t\t}\n\t\t}\n\n\n\t\t#region Interface Members\n\n\t\tvoid ICollection<T>.Add(T item) {\n\t\t\tthis.Add(item);\n\t\t}\n\n\t\tbool ICollection<T>.IsReadOnly {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tIEnumerator<T> IEnumerable<T>.GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\t#endregion\n\t}\n\n}\n"
  },
  {
    "path": "System.Core/System.Core.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProjectGuid>{429C3225-3A36-427A-A44E-2AA3563FCD6D}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>System.Core</RootNamespace>\n    <AssemblyName>System.Core</AssemblyName>\n    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\n    <FileAlignment>512</FileAlignment>\n    <TargetFrameworkProfile />\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <NoStdLib>true</NoStdLib>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <NoStdLib>true</NoStdLib>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"System.Collections.Generic\\HashSet.cs\" />\n    <Compile Include=\"System.Linq\\Enumerable.cs\" />\n    <Compile Include=\"System.Linq\\Grouping.cs\" />\n    <Compile Include=\"System.Linq\\IGrouping.cs\" />\n    <Compile Include=\"System.Linq\\ILookup.cs\" />\n    <Compile Include=\"System.Linq\\IOrderedEnumerable.cs\" />\n    <Compile Include=\"System.Linq\\Lookup.cs\" />\n    <Compile Include=\"System.Linq\\OrderedEnumerable.cs\" />\n    <Compile Include=\"System.Runtime.CompilerServices\\ExtensionAttribute.cs\" />\n    <Compile Include=\"System\\Action.cs\" />\n    <Compile Include=\"System\\Func.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\corlib\\corlib.csproj\">\n      <Project>{6a77a7c0-fb66-4caa-94ee-142dba20655d}</Project>\n      <Name>corlib</Name>\n    </ProjectReference>\n    <ProjectReference Include=\"..\\System\\System.csproj\">\n      <Project>{388f5d73-0211-4a64-b501-92cdc4e32acf}</Project>\n      <Name>System</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildToolsPath)\\Microsoft.CSharp.targets\" />\n  <PropertyGroup>\n    <PostBuildEvent>xcopy $(TargetPath) $(SolutionDir)Builds\\$(ConfigurationName)\\ /Y</PostBuildEvent>\n  </PropertyGroup>\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n</Project>"
  },
  {
    "path": "System.Core/System.Linq/Enumerable.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\n\nnamespace System.Linq {\n\tpublic static class Enumerable {\n\n\t\tprivate static class Funcs<T> {\n\t\t\tpublic static readonly Func<T, bool> True = x => true;\n\t\t\tpublic static readonly Func<T, T> Identity = x => x;\n\t\t}\n\n\t\t#region Aggregate\n\n\t\tpublic static T Aggregate<T>(this IEnumerable<T> source, Func<T, T, T> func) {\n\t\t\tCheck(source, func);\n\t\t\tusing (var en = source.GetEnumerator()) {\n\t\t\t\tif (!en.MoveNext()) {\n\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t}\n\t\t\t\tT value = en.Current;\n\t\t\t\twhile (en.MoveNext()) {\n\t\t\t\t\tvalue = func(value, en.Current);\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t\tpublic static TAcc Aggregate<T, TAcc>(this IEnumerable<T> source, TAcc seed, Func<TAcc, T, TAcc> func) {\n\t\t\treturn source.Aggregate(seed, func, Funcs<TAcc>.Identity);\n\t\t}\n\n\t\tpublic static TResult Aggregate<T, TAcc, TResult>\n\t\t\t(this IEnumerable<T> source, TAcc seed, Func<TAcc, T, TAcc> func, Func<TAcc,TResult> resultSelector) {\n\t\t\tCheck(source, func, resultSelector);\n\t\t\tforeach (var item in source) {\n\t\t\t\tseed = func(seed, item);\n\t\t\t}\n\t\t\treturn resultSelector(seed);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region All\n\n\t\tpublic static bool All<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\tCheck(source);\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (!predicate(item)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Any\n\n\t\tpublic static bool Any<T>(this IEnumerable<T> source) {\n\t\t\treturn source.Any(Funcs<T>.True);\n\t\t}\n\n\t\tpublic static bool Any<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\tCheck(source, predicate);\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (predicate(item)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Average\n\n\t\tpublic static double Average(this IEnumerable<int> source) {\n\t\t\treturn Avg<int, long, double>(source, (a, v) => a + v, (a, c) => (double)a / (double)c);\n\t\t}\n\n\t\tpublic static double? Average(this IEnumerable<int?> source) {\n\t\t\treturn AvgNullable<int, long, double>(source, (a, v) => a + v, (a, c) => (double)a / (double)c);\n\t\t}\n\n\t\tpublic static double Average(this IEnumerable<long> source) {\n\t\t\treturn Avg<long, long, double>(source, (a, v) => a + v, (a, c) => (double)a / (double)c);\n\t\t}\n\n\t\tpublic static double? Average(this IEnumerable<long?> source) {\n\t\t\treturn AvgNullable<long, long, double>(source, (a, v) => a + v, (a, c) => (double)a / (double)c);\n\t\t}\n\n\t\tpublic static float Average(this IEnumerable<float> source) {\n\t\t\treturn Avg<float, float, float>(source, (a, v) => a + v, (a, c) => a / c);\n\t\t}\n\n\t\tpublic static float? Average(this IEnumerable<float?> source) {\n\t\t\treturn AvgNullable<float, float, float>(source, (a, v) => a + v, (a, c) => a / c);\n\t\t}\n\n\t\tpublic static double Average(this IEnumerable<double> source) {\n\t\t\treturn Avg<double, double, double>(source, (a, v) => a + v, (a, c) => a / c);\n\t\t}\n\n\t\tpublic static double? Average(this IEnumerable<double?> source) {\n\t\t\treturn AvgNullable<double, double, double>(source, (a, v) => a + v, (a, c) => a / c);\n\t\t}\n\n\t\tpublic static Decimal Average(this IEnumerable<Decimal> source) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic static Decimal? Average(this IEnumerable<Decimal?> source) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic static double Average<T>(this IEnumerable<T> source, Func<T, int> selector) {\n\t\t\treturn Avg<int, long, double>(source.Select(selector), (a, v) => a + v, (a, c) => (double)a / (double)c);\n\t\t}\n\n\t\tpublic static double? Average<T>(this IEnumerable<T> source, Func<T, int?> selector) {\n\t\t\treturn AvgNullable<int, long, double>(source.Select(selector), (a, v) => a + v, (a, c) => (double)a / (double)c);\n\t\t}\n\n\t\tpublic static double Average<T>(this IEnumerable<T> source, Func<T, long> selector) {\n\t\t\treturn Avg<long, long, double>(source.Select(selector), (a, v) => a + v, (a, c) => (double)a / (double)c);\n\t\t}\n\n\t\tpublic static double? Average<T>(this IEnumerable<T> source, Func<T, long?> selector) {\n\t\t\treturn AvgNullable<long, long, double>(source.Select(selector), (a, v) => a + v, (a, c) => (double)a / (double)c);\n\t\t}\n\n\t\tpublic static float Average<T>(this IEnumerable<T> source, Func<T, float> selector) {\n\t\t\treturn Avg<float, float, float>(source.Select(selector), (a, v) => a + v, (a, c) => a / c);\n\t\t}\n\n\t\tpublic static float? Average<T>(this IEnumerable<T> source, Func<T, float?> selector) {\n\t\t\treturn AvgNullable<float, float, float>(source.Select(selector), (a, v) => a + v, (a, c) => a / c);\n\t\t}\n\n\t\tpublic static double Average<T>(this IEnumerable<T> source, Func<T, double> selector) {\n\t\t\treturn Avg<double, double, double>(source.Select(selector), (a, v) => a + v, (a, c) => a / c);\n\t\t}\n\n\t\tpublic static double? Average<T>(this IEnumerable<T> source, Func<T, double?> selector) {\n\t\t\treturn AvgNullable<double, double, double>(source.Select(selector), (a, v) => a + v, (a, c) => a / c);\n\t\t}\n\n\t\tpublic static Decimal Average<T>(this IEnumerable<T> source, Func<T, Decimal> selector) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic static Decimal? Average<T>(this IEnumerable<T> source, Func<T, Decimal?> selector) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tprivate static TRes Avg<T, TAcc, TRes>(IEnumerable<T> source,\n\t\t\tFunc<TAcc, T, TAcc> accFn, Func<TAcc, int, TRes> resFn) {\n\t\t\tCheck(source);\n\t\t\tTAcc acc = default(TAcc);\n\t\t\tint counter = 0;\n\t\t\tforeach (var item in source) {\n\t\t\t\tacc = accFn(acc, item);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t\tif (counter == 0) {\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t\treturn resFn(acc, counter);\n\t\t}\n\n\t\tprivate static TRes? AvgNullable<T, TAcc, TRes>(IEnumerable<T?> source,\n\t\t\tFunc<TAcc, T, TAcc> accFn, Func<TAcc, int, TRes> resFn)\n\t\t\twhere T : struct\n\t\t\twhere TRes : struct {\n\t\t\tCheck(source);\n\t\t\tTAcc acc = default(TAcc);\n\t\t\tint counter = 0;\n\t\t\tforeach (var item in source) {\n\t\t\t\tif (item != null) {\n\t\t\t\t\tacc = accFn(acc, item.Value);\n\t\t\t\t\tcounter++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (counter == 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn resFn(acc, counter);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region AsEnumerable\n\n\t\tpublic static IEnumerable<T> AsEnumerable<T>(this IEnumerable<T> source) {\n\t\t\treturn source;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Cast\n\n\t\tpublic static IEnumerable<T> Cast<T>(IEnumerable source) {\n\t\t\tCheck(source);\n\t\t\treturn CastIterator<T>(source);\n\t\t}\n\n\t\tprivate static IEnumerable<T> CastIterator<T>(IEnumerable source) {\n\t\t\tforeach (T item in source) {\n\t\t\t\tyield return item;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Concat\n\n\t\tpublic static IEnumerable<T> Concat<T>\n\t\t\t(this IEnumerable<T> first, IEnumerable<T> second) {\n\t\t\tCheck(first, second);\n\t\t\treturn ConcatIterator(first, second);\n\t\t}\n\n\t\tprivate static IEnumerable<T> ConcatIterator<T>\n\t\t\t(IEnumerable<T> first, IEnumerable<T> second) {\n\t\t\tforeach (T item in first) {\n\t\t\t\tyield return item;\n\t\t\t}\n\t\t\tforeach (T item in second) {\n\t\t\t\tyield return item;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Contains\n\n\t\tpublic static bool Contains<T>(this IEnumerable<T> source, T value) {\n\t\t\treturn source.Contains(value, null);\n\t\t}\n\n\t\tpublic static bool Contains<T>\n\t\t\t(this IEnumerable<T> source, T value, IEqualityComparer<T> comparer) {\n\t\t\tCheck(source);\n\t\t\tif (comparer == null) {\n\t\t\t\tcomparer = EqualityComparer<T>.Default;\n\t\t\t}\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (comparer.Equals(item, value)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Count, LongCount\n\n\t\tpublic static int Count<T>(this IEnumerable<T> source) {\n\t\t\tCheck(source);\n\t\t\tICollection<T> collection = source as ICollection<T>;\n\t\t\tif (collection != null) {\n\t\t\t\treturn collection.Count;\n\t\t\t} else {\n\t\t\t\treturn source.Count(Funcs<T>.True);\n\t\t\t}\n\t\t}\n\n\t\tpublic static int Count<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\tCheck(source, predicate);\n\t\t\tint count = 0;\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (predicate(item)) {\n\t\t\t\t\tcount++;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn count;\n\t\t}\n\n\t\tpublic static long LongCount<T>(this IEnumerable<T> source) {\n\t\t\treturn (long)Count(source);\n\t\t}\n\n\t\tpublic static long LongCount<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\treturn (long)Count(source, predicate);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region DefaultIfEmpty\n\n\t\tpublic static IEnumerable<T> DefaultIfEmpty<T>(this IEnumerable<T> source) {\n\t\t\treturn source.DefaultIfEmpty(default(T));\n\t\t}\n\n\t\tpublic static IEnumerable<T> DefaultIfEmpty<T>(this IEnumerable<T> source, T defaultValue) {\n\t\t\tCheck(source);\n\t\t\treturn DefaultIfEmptyIterator(source, defaultValue);\n\t\t}\n\n\t\tprivate static IEnumerable<T> DefaultIfEmptyIterator<T>(IEnumerable<T> source, T defaultValue) {\n\t\t\tusing (IEnumerator<T> en = source.GetEnumerator()) {\n\t\t\t\tif (en.MoveNext()) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tyield return en.Current;\n\t\t\t\t\t} while (en.MoveNext());\n\t\t\t\t} else {\n\t\t\t\t\tyield return defaultValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Distinct\n\n\t\tpublic static IEnumerable<T> Distinct<T>(this IEnumerable<T> source) {\n\t\t\treturn Distinct(source, null);\n\t\t}\n\n\t\tpublic static IEnumerable<T> Distinct<T>(this IEnumerable<T> source, IEqualityComparer<T> comparer) {\n\t\t\treturn DistinctIterator(source, comparer);\n\t\t}\n\n\t\tprivate static IEnumerable<T> DistinctIterator<T>(IEnumerable<T> source, IEqualityComparer<T> comparer) {\n\t\t\tHashSet<T> h = new HashSet<T>(comparer);\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (h.Add(item)) {\n\t\t\t\t\tyield return item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region ElementAt, ElementAtOrDefault\n\n\t\tpublic static T ElementAt<T>(IEnumerable<T> source, int index) {\n\t\t\treturn ElementAt(source, index, false);\n\t\t}\n\n\t\tpublic static T ElementAtOrDefault<T>(IEnumerable<T> source, int index) {\n\t\t\treturn ElementAt(source, index, true);\n\t\t}\n\n\t\tprivate static T ElementAt<T>(IEnumerable<T> source, int index, bool orDefault) {\n\t\t\tCheck(source);\n\t\t\tif (index >= 0) {\n\t\t\t\tIList<T> list = source as IList<T>;\n\t\t\t\tif (list != null) {\n\t\t\t\t\tif (index < list.Count) {\n\t\t\t\t\t\treturn list[index];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tint count = 0;\n\t\t\t\t\tforeach (T item in source) {\n\t\t\t\t\t\tif (count == index) {\n\t\t\t\t\t\t\treturn item;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (orDefault) {\n\t\t\t\treturn default(T);\n\t\t\t} else {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Empty\n\n\t\tpublic static IEnumerable<T> Empty<T>() {\n\t\t\treturn new T[0];\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Except\n\n\t\tpublic static IEnumerable<T> Except<T>(this IEnumerable<T> first, IEnumerable<T> second) {\n\t\t\treturn Except(first, second, null);\n\t\t}\n\n\t\tpublic static IEnumerable<T> Except<T>\n\t\t\t(this IEnumerable<T> first, IEnumerable<T> second, IEqualityComparer<T> comparer) {\n\t\t\tCheck(first, second);\n\t\t\treturn ExceptIterator(first, second, comparer);\n\t\t}\n\n\t\tprivate static IEnumerable<T> ExceptIterator<T>\n\t\t\t(IEnumerable<T> first, IEnumerable<T> second, IEqualityComparer<T> comparer) {\n\t\t\tHashSet<T> h = new HashSet<T>(second, comparer);\n\t\t\tforeach (T item in first) {\n\t\t\t\tif (!h.Contains(item)) {\n\t\t\t\t\tyield return item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region First, FirstOrDefault, Single, SingleOrDefault\n\n\t\tprivate static T FirstSingle<T>(IEnumerable<T> source, Func<T, bool> predicate, bool single, bool retDefault) {\n\t\t\tCheck(source, predicate);\n\t\t\tusing (var en = source.Where(predicate).GetEnumerator()) {\n\t\t\t\tif (en.MoveNext()) {\n\t\t\t\t\tT value = en.Current;\n\t\t\t\t\tif (single) {\n\t\t\t\t\t\tif (en.MoveNext()) {\n\t\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn value;\n\t\t\t\t} else {\n\t\t\t\t\tif (retDefault) {\n\t\t\t\t\t\treturn default(T);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static T First<T>(this IEnumerable<T> source) {\n\t\t\treturn FirstSingle(source, Funcs<T>.True, false, false);\n\t\t}\n\n\t\tpublic static T First<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\treturn FirstSingle(source, predicate, false, false);\n\t\t}\n\n\t\tpublic static T FirstOrDefault<T>(this IEnumerable<T> source) {\n\t\t\treturn FirstSingle(source, Funcs<T>.True, false, true);\n\t\t}\n\n\t\tpublic static T FirstOrDefault<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\treturn FirstSingle(source, predicate, false, true);\n\t\t}\n\n\t\tpublic static T Single<T>(this IEnumerable<T> source) {\n\t\t\treturn FirstSingle(source, Funcs<T>.True, true, false);\n\t\t}\n\n\t\tpublic static T Single<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\treturn FirstSingle(source, predicate, true, false);\n\t\t}\n\n\t\tpublic static T SingleOrDefault<T>(this IEnumerable<T> source) {\n\t\t\treturn FirstSingle(source, Funcs<T>.True, true, true);\n\t\t}\n\n\t\tpublic static T SingleOrDefault<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\treturn FirstSingle(source, predicate, true, true);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region GroupBy\n\n\t\tpublic static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) {\n\t\t\treturn source.GroupBy(keySelector, null);\n\t\t}\n\n\t\tpublic static IEnumerable<IGrouping<TKey, TSource>> GroupBy<TSource, TKey>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tIEqualityComparer<TKey> comparer) {\n\t\t\treturn source.GroupBy(keySelector, Funcs<TSource>.Identity, comparer);\n\t\t}\n\n\t\tpublic static IEnumerable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TSource, TElement> elementSelector) {\n\t\t\treturn source.GroupBy(keySelector, elementSelector, null);\n\t\t}\n\n\t\tpublic static IEnumerable<IGrouping<TKey, TElement>> GroupBy<TSource, TKey, TElement>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) {\n\t\t\treturn source.GroupBy(keySelector, elementSelector,\n\t\t\t\t(key, elements) => (IGrouping<TKey, TElement>)new Grouping<TKey, TElement>(key, elements),\n\t\t\t\tcomparer);\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> GroupBy<TSource, TKey, TResult>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TKey, IEnumerable<TSource>, TResult> resultSelector) {\n\t\t\treturn source.GroupBy(keySelector, resultSelector, null);\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> GroupBy<TSource, TKey, TResult>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TKey, IEnumerable<TSource>, TResult> resultSelector, IEqualityComparer<TKey> comparer) {\n\t\t\treturn source.GroupBy(keySelector, Funcs<TSource>.Identity, resultSelector, comparer);\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> GroupBy<TSource, TKey, TElement, TResult>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector) {\n\t\t\treturn source.GroupBy(keySelector, elementSelector, resultSelector, null);\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> GroupBy<TSource, TKey, TElement, TResult>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector,\n\t\t\tIEqualityComparer<TKey> comparer) {\n\t\t\tCheck(source, keySelector, elementSelector);\n\t\t\tCheck(resultSelector);\n\t\t\treturn GroupByIterator(source, keySelector, elementSelector, resultSelector, comparer);\n\t\t}\n\n\t\tprivate static IEnumerable<TResult> GroupByIterator<TSource, TKey, TElement, TResult>\n\t\t\t(IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TSource, TElement> elementSelector, Func<TKey, IEnumerable<TElement>, TResult> resultSelector,\n\t\t\tIEqualityComparer<TKey> comparer) {\n\t\t\tDictionary<TKey, List<TElement>> groups = new Dictionary<TKey, List<TElement>>(comparer);\n\t\t\tforeach (var item in source) {\n\t\t\t\tTKey key = keySelector(item);\n\t\t\t\tTElement element = elementSelector(item);\n\t\t\t\tList<TElement> itemsInGroup;\n\t\t\t\tif (!groups.TryGetValue(key, out itemsInGroup)) {\n\t\t\t\t\titemsInGroup = new List<TElement>();\n\t\t\t\t\tgroups.Add(key, itemsInGroup);\n\t\t\t\t}\n\t\t\t\titemsInGroup.Add(element);\n\t\t\t}\n\t\t\tforeach (var group in groups) {\n\t\t\t\tyield return resultSelector(group.Key, group.Value);\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region GroupJoin\n\n\t\tpublic static IEnumerable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>\n\t\t\t(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner,\n\t\t\tFunc<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,\n\t\t\tFunc<TOuter, IEnumerable<TInner>, TResult> resultSelector) {\n\t\t\treturn outer.GroupJoin(inner, outerKeySelector, innerKeySelector, resultSelector, null);\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> GroupJoin<TOuter, TInner, TKey, TResult>\n\t\t\t(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner,\n\t\t\tFunc<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,\n\t\t\tFunc<TOuter, IEnumerable<TInner>, TResult> resultSelector,\n\t\t\tIEqualityComparer<TKey> comparer) {\n\t\t\tCheck(outer, inner, outerKeySelector);\n\t\t\tCheck(innerKeySelector, resultSelector);\n\t\t\treturn GroupJoinIterator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer);\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> GroupJoinIterator<TOuter, TInner, TKey, TResult>\n\t\t\t(IEnumerable<TOuter> outer, IEnumerable<TInner> inner,\n\t\t\tFunc<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,\n\t\t\tFunc<TOuter, IEnumerable<TInner>, TResult> resultSelector,\n\t\t\tIEqualityComparer<TKey> comparer) {\n\t\t\tvar innerLookup = inner.ToLookup(innerKeySelector, comparer);\n\t\t\tforeach (var outerItem in outer) {\n\t\t\t\tTKey outerKey = outerKeySelector(outerItem);\n\t\t\t\tyield return resultSelector(outerItem,\n\t\t\t\t\tinnerLookup.Contains(outerKey) ? innerLookup[outerKey] : Empty<TInner>());\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region Intersect\n\n\t\tpublic static IEnumerable<T> Intersect<T>(this IEnumerable<T> first, IEnumerable<T> second) {\n\t\t\treturn first.Intersect(second, null);\n\t\t}\n\n\t\tpublic static IEnumerable<T> Intersect<T>(this IEnumerable<T> first, IEnumerable<T> second,\n\t\t\tIEqualityComparer<T> comparer) {\n\t\t\tCheck(first, second);\n\t\t\treturn IntersectIterator(first, second, comparer);\n\t\t}\n\n\t\tprivate static IEnumerable<T> IntersectIterator<T>(IEnumerable<T> first, IEnumerable<T> second,\n\t\t\tIEqualityComparer<T> comparer) {\n\t\t\tHashSet<T> hash = new HashSet<T>(first, comparer);\n\t\t\tforeach (var item in second.Distinct(comparer)) {\n\t\t\t\tif (hash.Contains(item)) {\n\t\t\t\t\tyield return item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Join\n\n\t\tpublic static IEnumerable<TResult> Join<TOuter, TInner, TKey, TResult>\n\t\t\t(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner,\n\t\t\tFunc<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,\n\t\t\tFunc<TOuter, TInner, TResult> resultSelector) {\n\t\t\treturn outer.Join(inner, outerKeySelector, innerKeySelector, resultSelector, null);\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> Join<TOuter, TInner, TKey, TResult>\n\t\t\t(this IEnumerable<TOuter> outer, IEnumerable<TInner> inner,\n\t\t\tFunc<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,\n\t\t\tFunc<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey> comparer) {\n\t\t\tCheck(outer, inner);\n\t\t\tCheck(outerKeySelector, innerKeySelector, resultSelector);\n\t\t\treturn JoinIterator(outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer);\n\t\t}\n\n\t\tprivate static IEnumerable<TResult> JoinIterator<TOuter, TInner, TKey, TResult>\n\t\t\t(IEnumerable<TOuter> outer, IEnumerable<TInner> inner,\n\t\t\tFunc<TOuter, TKey> outerKeySelector, Func<TInner, TKey> innerKeySelector,\n\t\t\tFunc<TOuter, TInner, TResult> resultSelector, IEqualityComparer<TKey> comparer) {\n\t\t\tvar outerLookup = outer.ToLookup(outerKeySelector, comparer);\n\t\t\tforeach (TInner innerItem in inner) {\n\t\t\t\tTKey innerKey = innerKeySelector(innerItem);\n\t\t\t\tif (outerLookup.Contains(innerKey)) {\n\t\t\t\t\tforeach (TOuter outerItem in outerLookup[innerKey]) {\n\t\t\t\t\t\tyield return resultSelector(outerItem, innerItem);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} \n\n\t\t#endregion\n\n\t\t#region Last, LastOrDefault\n\n\t\tprivate static T LastOrDefault<T>(IEnumerable<T> source, Func<T, bool> predicate, bool retDefault) {\n\t\t\tCheck(source, predicate);\n\t\t\tT last = default(T);\n\t\t\tbool empty = true;\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (predicate(item)) {\n\t\t\t\t\tempty = false;\n\t\t\t\t\tlast = item;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (empty && !retDefault) {\n\t\t\t\tthrow new InvalidOperationException();\n\t\t\t}\n\t\t\treturn last;\n\t\t}\n\n\t\tpublic static T Last<T>(this IEnumerable<T> source) {\n\t\t\treturn LastOrDefault(source, Funcs<T>.True, false);\n\t\t}\n\n\t\tpublic static T Last<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\treturn LastOrDefault(source, predicate, false);\n\t\t}\n\n\t\tpublic static T LastOrDefault<T>(this IEnumerable<T> source) {\n\t\t\treturn LastOrDefault(source, Funcs<T>.True, true);\n\t\t}\n\n\t\tpublic static T LastOrDefault<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\treturn LastOrDefault(source, predicate, true);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Max\n\n\t\tpublic static int Max(this IEnumerable<int> source) {\n\t\t\treturn GenProc(source, (a, b) => Math.Max(a, b), false);\n\t\t}\n\n\t\tpublic static int? Max(this IEnumerable<int?> source) {\n\t\t\treturn GenProcNullable(source, (a, b) => Math.Max(a, b));\n\t\t}\n\n\t\tpublic static long Max(this IEnumerable<long> source) {\n\t\t\treturn GenProc(source, (a, b) => Math.Max(a, b), false);\n\t\t}\n\n\t\tpublic static long? Max(this IEnumerable<long?> source) {\n\t\t\treturn GenProcNullable(source, (a, b) => Math.Max(a, b));\n\t\t}\n\n\t\tpublic static float Max(this IEnumerable<float> source) {\n\t\t\treturn GenProc(source, (a, b) => Math.Max(a, b), false);\n\t\t}\n\n\t\tpublic static float? Max(this IEnumerable<float?> source) {\n\t\t\treturn GenProcNullable(source, (a, b) => Math.Max(a, b));\n\t\t}\n\n\t\tpublic static double Max(this IEnumerable<double> source) {\n\t\t\treturn GenProc(source, (a, b) => Math.Max(a, b), false);\n\t\t}\n\n\t\tpublic static double? Max(this IEnumerable<double?> source) {\n\t\t\treturn GenProcNullable(source, (a, b) => Math.Max(a, b));\n\t\t}\n\n\t\tpublic static Decimal Max(this IEnumerable<Decimal> source) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic static Decimal? Max(this IEnumerable<Decimal?> source) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic static T Max<T>(this IEnumerable<T> source) {\n\t\t\tComparer<T> comparer = Comparer<T>.Default;\n\t\t\treturn GenProc(source, (a, b) => comparer.Compare(a, b) > 0 ? a : b, true);\n\t\t}\n\n\t\tpublic static TResult Max<T, TResult>(this IEnumerable<T> source, Func<T, TResult> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static int Max<T>(this IEnumerable<T> source, Func<T, int> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static int? Max<T>(this IEnumerable<T> source, Func<T, int?> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static long Max<T>(this IEnumerable<T> source, Func<T, long> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static long? Max<T>(this IEnumerable<T> source, Func<T, long?> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static float Max<T>(this IEnumerable<T> source, Func<T, float> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static float? Max<T>(this IEnumerable<T> source, Func<T, float?> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static double Max<T>(this IEnumerable<T> source, Func<T, double> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static double? Max<T>(this IEnumerable<T> source, Func<T, double?> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static Decimal Max<T>(this IEnumerable<T> source, Func<T, Decimal> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\tpublic static Decimal? Max<T>(this IEnumerable<T> source, Func<T, Decimal?> selector) {\n\t\t\treturn Max(source.Select(selector));\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Min\n\n\t\tpublic static int Min(this IEnumerable<int> source) {\n\t\t\treturn GenProc(source, (a, b) => Math.Min(a, b), false);\n\t\t}\n\n\t\tpublic static int? Min(this IEnumerable<int?> source) {\n\t\t\treturn GenProcNullable(source, (a, b) => Math.Min(a, b));\n\t\t}\n\n\t\tpublic static long Min(this IEnumerable<long> source) {\n\t\t\treturn GenProc(source, (a, b) => Math.Min(a, b), false);\n\t\t}\n\n\t\tpublic static long? Min(this IEnumerable<long?> source) {\n\t\t\treturn GenProcNullable(source, (a, b) => Math.Min(a, b));\n\t\t}\n\n\t\tpublic static float Min(this IEnumerable<float> source) {\n\t\t\treturn GenProc(source, (a, b) => Math.Min(a, b), false);\n\t\t}\n\n\t\tpublic static float? Min(this IEnumerable<float?> source) {\n\t\t\treturn GenProcNullable(source, (a, b) => Math.Min(a, b));\n\t\t}\n\n\t\tpublic static double Min(this IEnumerable<double> source) {\n\t\t\treturn GenProc(source, (a, b) => Math.Min(a, b), false);\n\t\t}\n\n\t\tpublic static double? Min(this IEnumerable<double?> source) {\n\t\t\treturn GenProcNullable(source, (a, b) => Math.Min(a, b));\n\t\t}\n\n\t\tpublic static Decimal Min(this IEnumerable<Decimal> source) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic static Decimal? Min(this IEnumerable<Decimal?> source) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic static T Min<T>(this IEnumerable<T> source) {\n\t\t\tComparer<T> comparer = Comparer<T>.Default;\n\t\t\treturn GenProc(source, (a, b) => comparer.Compare(a, b) < 0 ? a : b, true);\n\t\t}\n\n\t\tpublic static TResult Min<T, TResult>(this IEnumerable<T> source, Func<T, TResult> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static int Min<T>(this IEnumerable<T> source, Func<T, int> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static int? Min<T>(this IEnumerable<T> source, Func<T, int?> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static long Min<T>(this IEnumerable<T> source, Func<T, long> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static long? Min<T>(this IEnumerable<T> source, Func<T, long?> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static float Min<T>(this IEnumerable<T> source, Func<T, float> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static float? Min<T>(this IEnumerable<T> source, Func<T, float?> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static double Min<T>(this IEnumerable<T> source, Func<T, double> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static double? Min<T>(this IEnumerable<T> source, Func<T, double?> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static Decimal Min<T>(this IEnumerable<T> source, Func<T, Decimal> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tpublic static Decimal? Min<T>(this IEnumerable<T> source, Func<T, Decimal?> selector) {\n\t\t\treturn Min(source.Select(selector));\n\t\t}\n\n\t\tprivate static T GenProc<T>(IEnumerable<T> source, Func<T, T, T> fn, bool allowEmpty) {\n\t\t\tCheck(source);\n\t\t\tusing (var en = source.GetEnumerator()) {\n\t\t\t\tif (!en.MoveNext()) {\n\t\t\t\t\tif (allowEmpty) {\n\t\t\t\t\t\treturn default(T);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new InvalidOperationException();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tT value = en.Current;\n\t\t\t\twhile (en.MoveNext()) {\n\t\t\t\t\tvalue = fn(value, en.Current);\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t\tprivate static T? GenProcNullable<T>(IEnumerable<T?> source, Func<T, T, T> fn) where T : struct {\n\t\t\tT? value = null;\n\t\t\tforeach (T? item in source) {\n\t\t\t\tif (value == null) {\n\t\t\t\t\tvalue = item;\n\t\t\t\t} else if (item != null) {\n\t\t\t\t\tvalue = fn(value.Value, item.Value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn value;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region OfType\n\n\t\tpublic static IEnumerable<T> OfType<T>(this IEnumerable source) {\n\t\t\tCheck(source);\n\t\t\treturn OfTypeIterator<T>(source);\n\t\t}\n\n\t\tprivate static IEnumerable<T> OfTypeIterator<T>(IEnumerable source) {\n\t\t\tforeach (object item in source) {\n\t\t\t\tif (item is T) {\n\t\t\t\t\tyield return (T)item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region OrderBy, OrderByDescending\n\n\t\tpublic static IOrderedEnumerable<T> OrderBy<T, TKey>(\n\t\t\tthis IEnumerable<T> source,\n\t\t\tFunc<T, TKey> selector,\n\t\t\tIComparer<TKey> comparer) {\n\t\t\tCheck(source, selector);\n\t\t\treturn new OrderedEnumerable<T, TKey>(source, selector, comparer, true);\n\t\t}\n\n\t\tpublic static IOrderedEnumerable<T> OrderBy<T, TKey>(\n\t\t\tthis IEnumerable<T> source,\n\t\t\tFunc<T, TKey> selector) {\n\t\t\tCheck(source, selector);\n\t\t\treturn new OrderedEnumerable<T, TKey>(source, selector, null, true);\n\t\t}\n\n\t\tpublic static IOrderedEnumerable<T> OrderByDescending<T, TKey>(\n\t\t\tthis IEnumerable<T> source,\n\t\t\tFunc<T, TKey> selector,\n\t\t\tIComparer<TKey> comparer) {\n\t\t\tCheck(source, selector);\n\t\t\treturn new OrderedEnumerable<T, TKey>(source, selector, comparer, false);\n\t\t}\n\n\t\tpublic static IOrderedEnumerable<T> OrderByDescending<T, TKey>(\n\t\t\tthis IEnumerable<T> source,\n\t\t\tFunc<T, TKey> selector) {\n\t\t\tCheck(source, selector);\n\t\t\treturn new OrderedEnumerable<T, TKey>(source, selector, null, false);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Range\n\n\t\tpublic static IEnumerable<int> Range(int start, int count) {\n\t\t\tif (count < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"count\");\n\t\t\t}\n\t\t\treturn RangeIterator(start, count);\n\t\t}\n\n\t\tprivate static IEnumerable<int> RangeIterator(int start, int count) {\n\t\t\tint end = start + count;\n\t\t\tfor (int i = start; i < end; i++) {\n\t\t\t\tyield return i;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Repeat\n\n\t\tpublic static IEnumerable<TResult> Repeat<TResult>(TResult element, int count) {\n\t\t\tif (count < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"count\");\n\t\t\t}\n\t\t\treturn RepeatIterator(element, count);\n\t\t}\n\n\t\tprivate static IEnumerable<TResult> RepeatIterator<TResult>(TResult element, int count) {\n\t\t\tfor (int i = 0; i < count; i++) {\n\t\t\t\tyield return element;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Reverse\n\n\t\tpublic static IEnumerable<T> Reverse<T>(this IEnumerable<T> source) {\n\t\t\tCheck(source);\n\t\t\tIList<T> list = source as IList<T> ?? new List<T>(source);\n\t\t\treturn ReverseIterator(list);\n\t\t}\n\n\t\tprivate static IEnumerable<T> ReverseIterator<T>(IList<T> source) {\n\t\t\tfor (int i = source.Count - 1; i >= 0; i--) {\n\t\t\t\tyield return source[i];\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Select\n\n\t\tpublic static IEnumerable<TResult> Select<T, TResult>\n\t\t\t(this IEnumerable<T> source, Func<T, TResult> selector) {\n\t\t\tCheck(source, selector);\n\t\t\treturn SelectIterator(source, selector);\n\t\t}\n\n\t\tprivate static IEnumerable<TResult> SelectIterator<T, TResult>\n\t\t\t(IEnumerable<T> source, Func<T, TResult> selector) {\n\t\t\tforeach (T item in source) {\n\t\t\t\tyield return selector(item);\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> Select<T, TResult>\n\t\t\t(this IEnumerable<T> source, Func<T, int, TResult> selector) {\n\t\t\tCheck(source, selector);\n\t\t\treturn SelectIterator(source, selector);\n\t\t}\n\n\t\tprivate static IEnumerable<TResult> SelectIterator<T, TResult>\n\t\t\t(IEnumerable<T> source, Func<T, int, TResult> selector) {\n\t\t\tint count = 0;\n\t\t\tforeach (T item in source) {\n\t\t\t\tyield return selector(item, count);\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region SelectMany\n\n\t\tpublic static IEnumerable<TResult> SelectMany<TSource, TResult>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> selector) {\n\t\t\treturn source.SelectMany((s, i) => selector(s));\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> SelectMany<TSource, TResult>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, int, IEnumerable<TResult>> selector) {\n\t\t\treturn source.SelectMany(selector, (s, c) => c);\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TCollection>> collectionSelector,\n\t\t\tFunc<TSource, TCollection, TResult> resultSelector) {\n\t\t\treturn source.SelectMany((s, i) => collectionSelector(s), resultSelector);\n\t\t}\n\n\t\tpublic static IEnumerable<TResult> SelectMany<TSource, TCollection, TResult>\n\t\t\t(this IEnumerable<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector,\n\t\t\tFunc<TSource, TCollection, TResult> resultSelector) {\n\t\t\tCheck(source, collectionSelector, resultSelector);\n\t\t\treturn SelectManyIterator(source, collectionSelector, resultSelector);\n\t\t}\n\n\t\tprivate static IEnumerable<TResult> SelectManyIterator<TSource, TCollection, TResult>\n\t\t\t(IEnumerable<TSource> source, Func<TSource, int, IEnumerable<TCollection>> collectionSelector,\n\t\t\tFunc<TSource, TCollection, TResult> resultSelector) {\n\t\t\tint count = 0;\n\t\t\tforeach (TSource item in source) {\n\t\t\t\tforeach (TCollection col in collectionSelector(item, count)) {\n\t\t\t\t\tyield return resultSelector(item, col);\n\t\t\t\t}\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region SequenceEqual\n\n\t\tpublic static bool SequenceEqual<T>(this IEnumerable<T> first, IEnumerable<T> second) {\n\t\t\treturn first.SequenceEqual(second, null);\n\t\t}\n\n\t\tpublic static bool SequenceEqual<T>(this IEnumerable<T> first, IEnumerable<T> second, IEqualityComparer<T> comparer) {\n\t\t\tCheck(first, second);\n\t\t\tif (comparer == null) {\n\t\t\t\tcomparer = EqualityComparer<T>.Default;\n\t\t\t}\n\t\t\tusing (IEnumerator<T> en1 = first.GetEnumerator(), en2 = second.GetEnumerator()) {\n\t\t\t\twhile (en1.MoveNext()) {\n\t\t\t\t\tif (!en2.MoveNext()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (!comparer.Equals(en1.Current, en2.Current)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn !en2.MoveNext();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Skip\n\n\t\tpublic static IEnumerable<T> Skip<T>(this IEnumerable<T> source, int count) {\n\t\t\tCheck(source);\n\t\t\treturn SkipIterator(source, count);\n\t\t}\n\n\t\tprivate static IEnumerable<T> SkipIterator<T>(IEnumerable<T> source, int count) {\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (count <= 0) {\n\t\t\t\t\tyield return item;\n\t\t\t\t}\n\t\t\t\tcount--;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region SkipWhile\n\n\t\tpublic static IEnumerable<T> SkipWhile<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\tCheck(source, predicate);\n\t\t\treturn SkipWhileIterator(source, predicate);\n\t\t}\n\n\t\tpublic static IEnumerable<T> SkipWhileIterator<T>(IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\tbool skip = true;\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (skip) {\n\t\t\t\t\tif (!predicate(item)) {\n\t\t\t\t\t\tskip = false;\n\t\t\t\t\t\tyield return item;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tyield return item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<T> SkipWhile<T>(this IEnumerable<T> source, Func<T, int, bool> predicate) {\n\t\t\tCheck(source, predicate);\n\t\t\treturn SkipWhileIterator(source, predicate);\n\t\t}\n\n\t\tpublic static IEnumerable<T> SkipWhileIterator<T>(IEnumerable<T> source, Func<T, int, bool> predicate) {\n\t\t\tbool skip = true;\n\t\t\tint count = 0;\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (skip) {\n\t\t\t\t\tif (!predicate(item, count)) {\n\t\t\t\t\t\tskip = false;\n\t\t\t\t\t\tyield return item;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tyield return item;\n\t\t\t\t}\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Take\n\n\t\tpublic static IEnumerable<T> Take<T>(this IEnumerable<T> source, int count) {\n\t\t\tCheck(source);\n\t\t\treturn TakeIterator(source, count);\n\t\t}\n\n\t\tprivate static IEnumerable<T> TakeIterator<T>(IEnumerable<T> source, int count) {\n\t\t\tif (count <= 0) {\n\t\t\t\tyield break;\n\t\t\t}\n\t\t\tforeach (T item in source) {\n\t\t\t\tyield return item;\n\t\t\t\tcount--;\n\t\t\t\tif (count == 0) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region TakeWhile\n\n\t\tpublic static IEnumerable<T> TakeWhile<T>(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\tCheck(source, predicate);\n\t\t\treturn TakeWhileIterator(source, predicate);\n\t\t}\n\n\t\tprivate static IEnumerable<T> TakeWhileIterator<T>(IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (!predicate(item)) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t\tyield return item;\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<T> TakeWhile<T>(this IEnumerable<T> source, Func<T, int, bool> predicate) {\n\t\t\tCheck(source, predicate);\n\t\t\treturn TakeWhileIterator(source, predicate);\n\t\t}\n\n\t\tprivate static IEnumerable<T> TakeWhileIterator<T>(IEnumerable<T> source, Func<T, int, bool> predicate) {\n\t\t\tint count = 0;\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (!predicate(item, count)) {\n\t\t\t\t\tyield break;\n\t\t\t\t}\n\t\t\t\tyield return item;\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region ThenBy, ThenByDescending\n\n\t\t//public static IOrderedEnumerable<T> ThenBy<T, TKey>(this IOrderedEnumerable<T> source,\n\t\t//    Func<T, TKey> keySelector) {\n\t\t//    return source.ThenBy(keySelector, null);\n\t\t//}\n\n\t\t//public static IOrderedEnumerable<T> ThenBy<T, TKey>(this IOrderedEnumerable<T> source,\n\t\t//    Func<T, TKey> keySelector, IComparer<TKey> comparer) {\n\t\t//    Check(source, keySelector);\n\t\t//    return source.CreateOrderedEnumerable(keySelector, comparer, false);\n\t\t//}\n\n\t\t//public static IOrderedEnumerable<T> ThenByDescending<T, TKey>(this IOrderedEnumerable<T> source,\n\t\t//    Func<T, TKey> keySelector) {\n\t\t//    return source.ThenByDescending(keySelector, null);\n\t\t//}\n\n\t\t//public static IOrderedEnumerable<T> ThenByDescending<T, TKey>(this IOrderedEnumerable<T> source,\n\t\t//    Func<T, TKey> keySelector, IComparer<TKey> comparer) {\n\t\t//    Check(source, keySelector);\n\t\t//    return source.CreateOrderedEnumerable(keySelector, comparer, true);\n\t\t//}\n\n\t\t#endregion\n\n\t\t#region Union\n\n\t\tpublic static IEnumerable<T> Union<T>(this IEnumerable<T> first, IEnumerable<T> second) {\n\t\t\treturn Union(first, second, null);\n\t\t}\n\n\t\tpublic static IEnumerable<T> Union<T>\n\t\t\t(this IEnumerable<T> first, IEnumerable<T> second, IEqualityComparer<T> comparer) {\n\t\t\t// Check not needed, as Concat() will do it\n\t\t\treturn DistinctIterator(first.Concat(second), comparer);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Where\n\n\t\tpublic static IEnumerable<T> Where<T>\n\t\t\t(this IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\tCheck(source, predicate);\n\t\t\treturn WhereIterator(source, predicate);\n\t\t}\n\n\t\tprivate static IEnumerable<T> WhereIterator<T>\n\t\t\t(IEnumerable<T> source, Func<T, bool> predicate) {\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (predicate(item)) {\n\t\t\t\t\tyield return item;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic static IEnumerable<T> Where<T>\n\t\t\t(this IEnumerable<T> source, Func<T, int, bool> predicate) {\n\t\t\tCheck(source, predicate);\n\t\t\treturn WhereIterator(source, predicate);\n\t\t}\n\n\t\tprivate static IEnumerable<T> WhereIterator<T>\n\t\t\t(IEnumerable<T> source, Func<T, int, bool> predicate) {\n\t\t\tint count = 0;\n\t\t\tforeach (T item in source) {\n\t\t\t\tif (predicate(item, count)) {\n\t\t\t\t\tyield return item;\n\t\t\t\t}\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region ToList, ToArray, ToDictionary, ToLookup\n\n\t\tpublic static List<T> ToList<T>(this IEnumerable<T> source) {\n\t\t\tCheck(source);\n\t\t\treturn new List<T>(source);\n\t\t}\n\n\t\tpublic static T[] ToArray<T>(this IEnumerable<T> source) {\n\t\t\tCheck(source);\n\t\t\tICollection<T> collection =\n\t\t\t\tsource as ICollection<T> ?? new List<T>(source);\n\t\t\tT[] result = new T[collection.Count];\n\t\t\tcollection.CopyTo(result, 0);\n\t\t\treturn result;\n\t\t}\n\n\t\tpublic static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(\n\t\t\tthis IEnumerable<TSource> source, Func<TSource, TKey> keySelector) {\n\t\t\treturn source.ToDictionary(keySelector, Funcs<TSource>.Identity, null);\n\t\t}\n\n\t\tpublic static Dictionary<TKey, TSource> ToDictionary<TSource, TKey>(\n\t\t\tthis IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tIEqualityComparer<TKey> comparer) {\n\t\t\treturn source.ToDictionary(keySelector, Funcs<TSource>.Identity, comparer);\n\t\t}\n\n\t\tpublic static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(\n\t\t\tthis IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TSource, TElement> elementSelector) {\n\t\t\treturn source.ToDictionary(keySelector, elementSelector, null);\n\t\t}\n\n\t\tpublic static Dictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(\n\t\t\tthis IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) {\n\t\t\tCheck(source, keySelector, elementSelector);\n\t\t\tDictionary<TKey, TElement> dict = new Dictionary<TKey, TElement>(comparer);\n\t\t\tforeach (TSource item in source) {\n\t\t\t\tdict.Add(keySelector(item), elementSelector(item));\n\t\t\t}\n\t\t\treturn dict;\n\t\t}\n\n\t\tpublic static ILookup<TKey, TSource> ToLookup<TSource, TKey>(\n\t\t\tthis IEnumerable<TSource> source, Func<TSource, TKey> keySelector) {\n\t\t\treturn source.ToLookup(keySelector, Funcs<TSource>.Identity, null);\n\t\t}\n\n\t\tpublic static ILookup<TKey, TSource> ToLookup<TSource, TKey>(\n\t\t\tthis IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tIEqualityComparer<TKey> comparer) {\n\t\t\treturn source.ToLookup(keySelector, Funcs<TSource>.Identity, comparer);\n\t\t}\n\n\t\tpublic static ILookup<TKey, TElement> ToLookup<TSource, TKey, TElement>(\n\t\t\tthis IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TSource, TElement> elementSelector) {\n\t\t\treturn source.ToLookup(keySelector, elementSelector, null);\n\t\t}\n\n\t\tpublic static ILookup<TKey, TElement> ToLookup<TSource, TKey, TElement>(\n\t\t\tthis IEnumerable<TSource> source, Func<TSource, TKey> keySelector,\n\t\t\tFunc<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer) {\n\t\t\tCheck(source, keySelector, elementSelector);\n\t\t\tvar lookup = new Dictionary<TKey, List<TElement>>(comparer);\n\t\t\tforeach (TSource item in source) {\n\t\t\t\tTKey key = keySelector(item);\n\t\t\t\tif (key == null) {\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\t}\n\t\t\t\tList<TElement> list;\n\t\t\t\tif (!lookup.TryGetValue(key, out list)) {\n\t\t\t\t\tlist = new List<TElement>();\n\t\t\t\t\tlookup.Add(key, list);\n\t\t\t\t}\n\t\t\t\tlist.Add(elementSelector(item));\n\t\t\t}\n\t\t\treturn new Lookup<TKey, TElement>(lookup);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Checks\n\n\t\tprivate static void Check(object o) {\n\t\t\tif (o == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t}\n\n\t\tprivate static void Check(object o1, object o2) {\n\t\t\tif (o1 == null || o2 == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t}\n\n\t\tprivate static void Check(object o1, object o2, object o3) {\n\t\t\tif (o1 == null || o2 == null || o3 == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n"
  },
  {
    "path": "System.Core/System.Linq/Grouping.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\n\nnamespace System.Linq {\n\tclass Grouping<TKey, TElement> : IGrouping<TKey, TElement> {\n\n\t\tpublic Grouping(TKey key, IEnumerable<TElement> elements) {\n\t\t\tthis.key = key;\n\t\t\tthis.elements = elements;\n\t\t}\n\n\t\tprivate TKey key;\n\t\tprivate IEnumerable<TElement> elements;\n\t\t\n\t\tpublic TKey Key {\n\t\t\tget {\n\t\t\t\treturn this.key;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerator<TElement> GetEnumerator() {\n\t\t\treturn this.elements.GetEnumerator();\n\t\t}\n\n\t\tIEnumerator System.Collections.IEnumerable.GetEnumerator() {\n\t\t\treturn this.elements.GetEnumerator();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Core/System.Linq/IGrouping.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\n\nnamespace System.Linq {\n\tpublic interface IGrouping<TKey, TElement> : IEnumerable<TElement>, IEnumerable {\n\n\t\tTKey Key { get; }\n\n\t}\n}\n"
  },
  {
    "path": "System.Core/System.Linq/ILookup.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Collections;\n\nnamespace System.Linq {\n\tpublic interface ILookup<TKey, TElement> : IEnumerable<IGrouping<TKey, TElement>>, IEnumerable {\n\n\t\tbool Contains(TKey key);\n\t\tint Count { get; }\n\t\tIEnumerable<TElement> this[TKey key] { get; }\n\n\t}\n}\n"
  },
  {
    "path": "System.Core/System.Linq/IOrderedEnumerable.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace System.Linq {\n\n\tpublic interface IOrderedEnumerable<T> : IEnumerable<T> {\n\n\t\tIOrderedEnumerable<T> CreateOrderedEnumerable<TKey>(\n\t\t\tFunc<T, TKey> selector, IComparer<TKey> comparer, bool descending);\n\n\t}\n\n}\n"
  },
  {
    "path": "System.Core/System.Linq/Lookup.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Collections;\nusing System.Linq;\nusing System.Text;\n\nnamespace System.Linq {\n\tpublic class Lookup<TKey, TElement> : ILookup<TKey, TElement> {\n\n\t\tprivate Dictionary<TKey, IGrouping<TKey, TElement>> lookup;\n\n\t\tinternal Lookup(Dictionary<TKey, List<TElement>> data) {\n\t\t\tthis.lookup = new Dictionary<TKey, IGrouping<TKey, TElement>>(data.Comparer);\n\t\t\tforeach (var item in data) {\n\t\t\t\tthis.lookup.Add(item.Key, new Grouping<TKey, TElement>(item.Key, item.Value));\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Contains(TKey key) {\n\t\t\treturn this.lookup.ContainsKey(key);\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn this.lookup.Count;\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerable<TElement> this[TKey key] {\n\t\t\tget {\n\t\t\t\treturn this.lookup[key];\n\t\t\t}\n\t\t}\n\n\t\tpublic IEnumerator<IGrouping<TKey, TElement>> GetEnumerator() {\n\t\t\treturn this.lookup.Values.GetEnumerator();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator() {\n\t\t\treturn this.lookup.Values.GetEnumerator();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Core/System.Linq/OrderedEnumerable.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Collections;\n\n#if LOCALTEST\nnamespace System_.Linq {\n#else\nnamespace System.Linq {\n#endif\n\tclass OrderedEnumerable<TElement, TKey> : IOrderedEnumerable<TElement> {\n\n\t\tprivate class QuickSort {\n\n\t\t\tpublic QuickSort(IEnumerable<TElement> source,\n\t\t\t\tFunc<TElement, TKey> selector, IComparer<TKey> comparer, bool ascending) {\n\t\t\t\tthis.comparer = comparer;\n\t\t\t\tthis.ascending = ascending;\n\t\t\t\tthis.elements = source.ToArray();\n\t\t\t\tint len = this.elements.Length;\n\t\t\t\tthis.keys = new TKey[len];\n\t\t\t\tthis.order = new int[len];\n\t\t\t\tfor (int i = 0; i < len; i++) {\n\t\t\t\t\tthis.keys[i] = selector(this.elements[i]);\n\t\t\t\t\tthis.order[i] = i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate IComparer<TKey> comparer;\n\t\t\tprivate bool ascending;\n\t\t\tprivate TElement[] elements;\n\t\t\tprivate TKey[] keys;\n\t\t\tprivate int[] order;\n\t\t\tprivate const int INSERTION_SORT_SIZE = 6;\n\n\t\t\tprivate void Swap(int idx0, int idx1) {\n\t\t\t\tif (idx0 != idx1) {\n\t\t\t\t\tint temp = this.order[idx0];\n\t\t\t\t\tthis.order[idx0] = this.order[idx1];\n\t\t\t\t\tthis.order[idx1] = temp;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate void PerformSort(int startIdx, int endIdx) {\n\t\t\t\t// Special cases if lenth is 0, 1 or less than or equal to INSERTION_SORT_SIZE\n\t\t\t\tint length = endIdx - startIdx + 1;\n\t\t\t\tif (length <= 1) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (length <= INSERTION_SORT_SIZE) {\n\t\t\t\t    // Perform insertion sort\n\t\t\t\t\tfor (int idx = startIdx + 1; idx <= endIdx; idx++) {\n\t\t\t\t\t\tint i, orderIdx = this.order[idx];\n\t\t\t\t\t\tTKey key = this.keys[orderIdx];\n\t\t\t\t\t\tfor (i = idx; i > startIdx && this.comparer.Compare(key, this.keys[this.order[i - 1]]) < 0; i--) {\n\t\t\t\t\t\t\tthis.order[i] = this.order[i - 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.order[i] = orderIdx;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// Perform quick-sort\n\t\t\t\t// Find the pivot value\n\t\t\t\tint pivotIdx;\n\t\t\t\tint midIdx = (startIdx + endIdx) / 2;\n\t\t\t\tTKey pivot0 = this.keys[this.order[startIdx]];\n\t\t\t\tTKey pivot1 = this.keys[this.order[midIdx]];\n\t\t\t\tTKey pivot2 = this.keys[this.order[endIdx]];\n\t\t\t\tbool _0lessthan1 = this.comparer.Compare(pivot0, pivot1) < 0;\n\t\t\t\tbool _1lessthan2 = this.comparer.Compare(pivot1, pivot2) < 0;\n\t\t\t\tif (_0lessthan1 == _1lessthan2) {\n\t\t\t\t\tpivotIdx = midIdx;\n\t\t\t\t} else {\n\t\t\t\t\tbool _0lessthan2 = this.comparer.Compare(pivot0, pivot2) < 0;\n\t\t\t\t\tpivotIdx = (_1lessthan2 == _0lessthan2) ? startIdx : endIdx;\n\t\t\t\t}\n\t\t\t\tTKey pivot = this.keys[this.order[pivotIdx]];\n\t\t\t\t//Console.WriteLine(\"S={4},M={5},E={6}  p0={1},p1={2},p2={3}  Pivot = {0}\", pivot, pivot0, pivot1, pivot2, startIdx, midIdx, endIdx);\n\t\t\t\t// Perform sort\n\t\t\t\tthis.Swap(pivotIdx, endIdx);\n\t\t\t\tint storeIndex = startIdx;\n\t\t\t\tfor (int i = startIdx; i < endIdx; i++) {\n\t\t\t\t\tTKey value = this.keys[this.order[i]];\n\t\t\t\t\t// if value <= pivot\n\t\t\t\t\tif (this.comparer.Compare(value, pivot) <= 0) {\n\t\t\t\t\t\tthis.Swap(storeIndex, i);\n\t\t\t\t\t\tstoreIndex++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.Swap(storeIndex, endIdx);\n\t\t\t\tthis.PerformSort(startIdx, storeIndex - 1);\n\t\t\t\tthis.PerformSort(storeIndex + 1, endIdx);\n\t\t\t}\n\n\t\t\tpublic IEnumerable<TElement> Sort() {\n\t\t\t\tint len = this.elements.Length;\n\t\t\t\tthis.PerformSort(0, len - 1);\n\t\t\t\tif (this.ascending) {\n\t\t\t\t\tfor (int i = 0; i < len; i++) {\n\t\t\t\t\t\tyield return this.elements[this.order[i]];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (int i = len - 1; i >= 0; i--) {\n\t\t\t\t\t\tyield return this.elements[this.order[i]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tpublic OrderedEnumerable(IEnumerable<TElement> source,\n\t\t\tFunc<TElement, TKey> selector, IComparer<TKey> comparer, bool ascending) {\n\t\t\tthis.source = source;\n\t\t\tthis.selector = selector;\n\t\t\tthis.comparer = comparer ?? Comparer<TKey>.Default;\n\t\t\tthis.ascending = ascending;\n\t\t}\n\n\t\tpublic IOrderedEnumerable<TElement> CreateOrderedEnumerable<TKey2>(\n\t\t\tFunc<TElement, TKey2> selector, IComparer<TKey2> comparer, bool descending) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tprivate IEnumerable<TElement> source;\n\t\tprivate Func<TElement, TKey> selector;\n\t\tprivate IComparer<TKey> comparer;\n\t\tprivate bool ascending;\n\n\t\tpublic IEnumerator<TElement> GetEnumerator() {\n\t\t\tQuickSort sort = new QuickSort(this.source, this.selector, this.comparer, this.ascending);\n\t\t\treturn sort.Sort().GetEnumerator();\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator() {\n\t\t\treturn this.GetEnumerator();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Core/System.Runtime.CompilerServices/ExtensionAttribute.cs",
    "content": "﻿// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace System.Runtime.CompilerServices {\n\n\t[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]\n\tpublic sealed class ExtensionAttribute : Attribute {\n\t}\n\n}\n"
  },
  {
    "path": "System.Drawing/Properties/AssemblyInfo.cs",
    "content": "﻿/*using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"System.Drawing\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Docobo\")]\n[assembly: AssemblyProduct(\"System.Drawing\")]\n[assembly: AssemblyCopyright(\"Copyright © Docobo 2007\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"d9baba9f-5d04-4f14-b992-e6439f76f8f1\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Revision and Build Numbers \n// by using the '*' as shown below:\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n*/"
  },
  {
    "path": "System.Drawing/System.Drawing/Bitmap.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Drawing.Imaging;\n\nnamespace System.Drawing {\n\tpublic sealed class Bitmap : Image {\n\n\t\tpublic Bitmap(int width, int height)\n\t\t\t: this(width, height, PixelFormat.Format32bppArgb) { }\n\n\t\tpublic Bitmap(int width, int height, PixelFormat pixelFormat) {\n\t\t\tbase.native = LibIGraph._CreateBitmap(width, height, pixelFormat);\n\t\t\tif (base.native == IntPtr.Zero) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\tbase.width = width;\n\t\t\tbase.height = height;\n\t\t\tbase.pixelFormat = pixelFormat;\n\t\t}\n\n\t\tinternal Bitmap(IntPtr native, int width, int height, PixelFormat pixelFormat) {\n\t\t\tif (native == IntPtr.Zero) {\n\t\t\t\tthrow new ArgumentException(\"Cannot create Bitmap\");\n\t\t\t}\n\t\t\tbase.native = native;\n\t\t\tbase.width = width;\n\t\t\tbase.height = height;\n\t\t\tbase.pixelFormat = pixelFormat;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Brush.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic abstract class Brush : MarshalByRefObject, IDisposable {\n\n\t\tinternal IntPtr native = IntPtr.Zero;\n\n\t\t~Brush() {\n\t\t\tthis.Dispose(false);\n\t\t}\n\n\t\tpublic void Dispose() {\n\t\t\tthis.Dispose(true);\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tprotected virtual void Dispose(bool disposing) {\n\t\t\tif (this.native != IntPtr.Zero) {\n\t\t\t\tLibIGraph.DisposeBrush(this.native);\n\t\t\t\tthis.native = IntPtr.Zero;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Brushes.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic static class Brushes {\n\n\t\tstatic SolidBrush aliceBlue;\n\t\tstatic SolidBrush antiqueWhite;\n\t\tstatic SolidBrush aqua;\n\t\tstatic SolidBrush aquamarine;\n\t\tstatic SolidBrush azure;\n\t\tstatic SolidBrush beige;\n\t\tstatic SolidBrush bisque;\n\t\tstatic SolidBrush black;\n\t\tstatic SolidBrush blanchedAlmond;\n\t\tstatic SolidBrush blue;\n\t\tstatic SolidBrush blueViolet;\n\t\tstatic SolidBrush brown;\n\t\tstatic SolidBrush burlyWood;\n\t\tstatic SolidBrush cadetBlue;\n\t\tstatic SolidBrush chartreuse;\n\t\tstatic SolidBrush chocolate;\n\t\tstatic SolidBrush coral;\n\t\tstatic SolidBrush cornflowerBlue;\n\t\tstatic SolidBrush cornsilk;\n\t\tstatic SolidBrush crimson;\n\t\tstatic SolidBrush cyan;\n\t\tstatic SolidBrush darkBlue;\n\t\tstatic SolidBrush darkCyan;\n\t\tstatic SolidBrush darkGoldenrod;\n\t\tstatic SolidBrush darkGray;\n\t\tstatic SolidBrush darkGreen;\n\t\tstatic SolidBrush darkKhaki;\n\t\tstatic SolidBrush darkMagenta;\n\t\tstatic SolidBrush darkOliveGreen;\n\t\tstatic SolidBrush darkOrange;\n\t\tstatic SolidBrush darkOrchid;\n\t\tstatic SolidBrush darkRed;\n\t\tstatic SolidBrush darkSalmon;\n\t\tstatic SolidBrush darkSeaGreen;\n\t\tstatic SolidBrush darkSlateBlue;\n\t\tstatic SolidBrush darkSlateGray;\n\t\tstatic SolidBrush darkTurquoise;\n\t\tstatic SolidBrush darkViolet;\n\t\tstatic SolidBrush deepPink;\n\t\tstatic SolidBrush deepSkyBlue;\n\t\tstatic SolidBrush dimGray;\n\t\tstatic SolidBrush dodgerBlue;\n\t\tstatic SolidBrush firebrick;\n\t\tstatic SolidBrush floralWhite;\n\t\tstatic SolidBrush forestGreen;\n\t\tstatic SolidBrush fuchsia;\n\t\tstatic SolidBrush gainsboro;\n\t\tstatic SolidBrush ghostWhite;\n\t\tstatic SolidBrush gold;\n\t\tstatic SolidBrush goldenrod;\n\t\tstatic SolidBrush gray;\n\t\tstatic SolidBrush green;\n\t\tstatic SolidBrush greenYellow;\n\t\tstatic SolidBrush honeydew;\n\t\tstatic SolidBrush hotPink;\n\t\tstatic SolidBrush indianRed;\n\t\tstatic SolidBrush indigo;\n\t\tstatic SolidBrush ivory;\n\t\tstatic SolidBrush khaki;\n\t\tstatic SolidBrush lavender;\n\t\tstatic SolidBrush lavenderBlush;\n\t\tstatic SolidBrush lawnGreen;\n\t\tstatic SolidBrush lemonChiffon;\n\t\tstatic SolidBrush lightBlue;\n\t\tstatic SolidBrush lightCoral;\n\t\tstatic SolidBrush lightCyan;\n\t\tstatic SolidBrush lightGoldenrodYellow;\n\t\tstatic SolidBrush lightGray;\n\t\tstatic SolidBrush lightGreen;\n\t\tstatic SolidBrush lightPink;\n\t\tstatic SolidBrush lightSalmon;\n\t\tstatic SolidBrush lightSeaGreen;\n\t\tstatic SolidBrush lightSkyBlue;\n\t\tstatic SolidBrush lightSlateGray;\n\t\tstatic SolidBrush lightSteelBlue;\n\t\tstatic SolidBrush lightYellow;\n\t\tstatic SolidBrush lime;\n\t\tstatic SolidBrush limeGreen;\n\t\tstatic SolidBrush linen;\n\t\tstatic SolidBrush magenta;\n\t\tstatic SolidBrush maroon;\n\t\tstatic SolidBrush mediumAquamarine;\n\t\tstatic SolidBrush mediumBlue;\n\t\tstatic SolidBrush mediumOrchid;\n\t\tstatic SolidBrush mediumPurple;\n\t\tstatic SolidBrush mediumSeaGreen;\n\t\tstatic SolidBrush mediumSlateBlue;\n\t\tstatic SolidBrush mediumSpringGreen;\n\t\tstatic SolidBrush mediumTurquoise;\n\t\tstatic SolidBrush mediumVioletRed;\n\t\tstatic SolidBrush midnightBlue;\n\t\tstatic SolidBrush mintCream;\n\t\tstatic SolidBrush mistyRose;\n\t\tstatic SolidBrush moccasin;\n\t\tstatic SolidBrush navajoWhite;\n\t\tstatic SolidBrush navy;\n\t\tstatic SolidBrush oldLace;\n\t\tstatic SolidBrush olive;\n\t\tstatic SolidBrush oliveDrab;\n\t\tstatic SolidBrush orange;\n\t\tstatic SolidBrush orangeRed;\n\t\tstatic SolidBrush orchid;\n\t\tstatic SolidBrush paleGoldenrod;\n\t\tstatic SolidBrush paleGreen;\n\t\tstatic SolidBrush paleTurquoise;\n\t\tstatic SolidBrush paleVioletRed;\n\t\tstatic SolidBrush papayaWhip;\n\t\tstatic SolidBrush peachPuff;\n\t\tstatic SolidBrush peru;\n\t\tstatic SolidBrush pink;\n\t\tstatic SolidBrush plum;\n\t\tstatic SolidBrush powderBlue;\n\t\tstatic SolidBrush purple;\n\t\tstatic SolidBrush red;\n\t\tstatic SolidBrush rosyBrown;\n\t\tstatic SolidBrush royalBlue;\n\t\tstatic SolidBrush saddleBrown;\n\t\tstatic SolidBrush salmon;\n\t\tstatic SolidBrush sandyBrown;\n\t\tstatic SolidBrush seaGreen;\n\t\tstatic SolidBrush seaShell;\n\t\tstatic SolidBrush sienna;\n\t\tstatic SolidBrush silver;\n\t\tstatic SolidBrush skyBlue;\n\t\tstatic SolidBrush slateBlue;\n\t\tstatic SolidBrush slateGray;\n\t\tstatic SolidBrush snow;\n\t\tstatic SolidBrush springGreen;\n\t\tstatic SolidBrush steelBlue;\n\t\tstatic SolidBrush tan;\n\t\tstatic SolidBrush teal;\n\t\tstatic SolidBrush thistle;\n\t\tstatic SolidBrush tomato;\n\t\tstatic SolidBrush transparent;\n\t\tstatic SolidBrush turquoise;\n\t\tstatic SolidBrush violet;\n\t\tstatic SolidBrush wheat;\n\t\tstatic SolidBrush white;\n\t\tstatic SolidBrush whiteSmoke;\n\t\tstatic SolidBrush yellow;\n\t\tstatic SolidBrush yellowGreen;\n\n\t\t// We intentionally do not set the is_modifiable=false flag on\n\t\t// the brushes, to stay Microsoft compatible\n\n\t\tpublic static Brush AliceBlue {\n\t\t\tget {\n\t\t\t\tif (aliceBlue == null) {\n\t\t\t\t\taliceBlue = new SolidBrush(Color.AliceBlue);\n\t\t\t\t}\n\t\t\t\treturn (aliceBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush AntiqueWhite {\n\t\t\tget {\n\t\t\t\tif (antiqueWhite == null) {\n\t\t\t\t\tantiqueWhite = new SolidBrush(Color.AntiqueWhite);\n\t\t\t\t}\n\t\t\t\treturn (antiqueWhite);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Aqua {\n\t\t\tget {\n\t\t\t\tif (aqua == null) {\n\t\t\t\t\taqua = new SolidBrush(Color.Aqua);\n\t\t\t\t}\n\t\t\t\treturn (aqua);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Aquamarine {\n\t\t\tget {\n\t\t\t\tif (aquamarine == null) {\n\t\t\t\t\taquamarine = new SolidBrush(Color.Aquamarine);\n\t\t\t\t}\n\t\t\t\treturn (aquamarine);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Azure {\n\t\t\tget {\n\t\t\t\tif (azure == null) {\n\t\t\t\t\tazure = new SolidBrush(Color.Azure);\n\t\t\t\t}\n\t\t\t\treturn (azure);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Beige {\n\t\t\tget {\n\t\t\t\tif (beige == null) {\n\t\t\t\t\tbeige = new SolidBrush(Color.Beige);\n\t\t\t\t}\n\t\t\t\treturn (beige);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Bisque {\n\t\t\tget {\n\t\t\t\tif (bisque == null) {\n\t\t\t\t\tbisque = new SolidBrush(Color.Bisque);\n\t\t\t\t}\n\t\t\t\treturn (bisque);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Black {\n\t\t\tget {\n\t\t\t\tif (black == null) {\n\t\t\t\t\tblack = new SolidBrush(Color.Black);\n\t\t\t\t}\n\t\t\t\treturn (black);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush BlanchedAlmond {\n\t\t\tget {\n\t\t\t\tif (blanchedAlmond == null) {\n\t\t\t\t\tblanchedAlmond = new SolidBrush(Color.BlanchedAlmond);\n\t\t\t\t}\n\t\t\t\treturn (blanchedAlmond);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Blue {\n\t\t\tget {\n\t\t\t\tif (blue == null) {\n\t\t\t\t\tblue = new SolidBrush(Color.Blue);\n\t\t\t\t}\n\t\t\t\treturn (blue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush BlueViolet {\n\t\t\tget {\n\t\t\t\tif (blueViolet == null) {\n\t\t\t\t\tblueViolet = new SolidBrush(Color.BlueViolet);\n\t\t\t\t}\n\t\t\t\treturn (blueViolet);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Brown {\n\t\t\tget {\n\t\t\t\tif (brown == null) {\n\t\t\t\t\tbrown = new SolidBrush(Color.Brown);\n\t\t\t\t}\n\t\t\t\treturn (brown);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush BurlyWood {\n\t\t\tget {\n\t\t\t\tif (burlyWood == null) {\n\t\t\t\t\tburlyWood = new SolidBrush(Color.BurlyWood);\n\t\t\t\t}\n\t\t\t\treturn (burlyWood);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush CadetBlue {\n\t\t\tget {\n\t\t\t\tif (cadetBlue == null) {\n\t\t\t\t\tcadetBlue = new SolidBrush(Color.CadetBlue);\n\t\t\t\t}\n\t\t\t\treturn (cadetBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Chartreuse {\n\t\t\tget {\n\t\t\t\tif (chartreuse == null) {\n\t\t\t\t\tchartreuse = new SolidBrush(Color.Chartreuse);\n\t\t\t\t}\n\t\t\t\treturn (chartreuse);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Chocolate {\n\t\t\tget {\n\t\t\t\tif (chocolate == null) {\n\t\t\t\t\tchocolate = new SolidBrush(Color.Chocolate);\n\t\t\t\t}\n\t\t\t\treturn (chocolate);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Coral {\n\t\t\tget {\n\t\t\t\tif (coral == null) {\n\t\t\t\t\tcoral = new SolidBrush(Color.Coral);\n\t\t\t\t}\n\t\t\t\treturn (coral);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush CornflowerBlue {\n\t\t\tget {\n\t\t\t\tif (cornflowerBlue == null) {\n\t\t\t\t\tcornflowerBlue = new SolidBrush(Color.CornflowerBlue);\n\t\t\t\t}\n\t\t\t\treturn (cornflowerBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Cornsilk {\n\t\t\tget {\n\t\t\t\tif (cornsilk == null) {\n\t\t\t\t\tcornsilk = new SolidBrush(Color.Cornsilk);\n\t\t\t\t}\n\t\t\t\treturn (cornsilk);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Crimson {\n\t\t\tget {\n\t\t\t\tif (crimson == null) {\n\t\t\t\t\tcrimson = new SolidBrush(Color.Crimson);\n\t\t\t\t}\n\t\t\t\treturn (crimson);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Cyan {\n\t\t\tget {\n\t\t\t\tif (cyan == null) {\n\t\t\t\t\tcyan = new SolidBrush(Color.Cyan);\n\t\t\t\t}\n\t\t\t\treturn (cyan);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkBlue {\n\t\t\tget {\n\t\t\t\tif (darkBlue == null) {\n\t\t\t\t\tdarkBlue = new SolidBrush(Color.DarkBlue);\n\t\t\t\t}\n\t\t\t\treturn (darkBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkCyan {\n\t\t\tget {\n\t\t\t\tif (darkCyan == null) {\n\t\t\t\t\tdarkCyan = new SolidBrush(Color.DarkCyan);\n\t\t\t\t}\n\t\t\t\treturn (darkCyan);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkGoldenrod {\n\t\t\tget {\n\t\t\t\tif (darkGoldenrod == null) {\n\t\t\t\t\tdarkGoldenrod = new SolidBrush(Color.DarkGoldenrod);\n\t\t\t\t}\n\t\t\t\treturn (darkGoldenrod);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkGray {\n\t\t\tget {\n\t\t\t\tif (darkGray == null) {\n\t\t\t\t\tdarkGray = new SolidBrush(Color.DarkGray);\n\t\t\t\t}\n\t\t\t\treturn (darkGray);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkGreen {\n\t\t\tget {\n\t\t\t\tif (darkGreen == null) {\n\t\t\t\t\tdarkGreen = new SolidBrush(Color.DarkGreen);\n\t\t\t\t}\n\t\t\t\treturn (darkGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkKhaki {\n\t\t\tget {\n\t\t\t\tif (darkKhaki == null) {\n\t\t\t\t\tdarkKhaki = new SolidBrush(Color.DarkKhaki);\n\t\t\t\t}\n\t\t\t\treturn (darkKhaki);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkMagenta {\n\t\t\tget {\n\t\t\t\tif (darkMagenta == null) {\n\t\t\t\t\tdarkMagenta = new SolidBrush(Color.DarkMagenta);\n\t\t\t\t}\n\t\t\t\treturn (darkMagenta);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkOliveGreen {\n\t\t\tget {\n\t\t\t\tif (darkOliveGreen == null) {\n\t\t\t\t\tdarkOliveGreen = new SolidBrush(Color.DarkOliveGreen);\n\t\t\t\t}\n\t\t\t\treturn (darkOliveGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkOrange {\n\t\t\tget {\n\t\t\t\tif (darkOrange == null) {\n\t\t\t\t\tdarkOrange = new SolidBrush(Color.DarkOrange);\n\t\t\t\t}\n\t\t\t\treturn (darkOrange);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkOrchid {\n\t\t\tget {\n\t\t\t\tif (darkOrchid == null) {\n\t\t\t\t\tdarkOrchid = new SolidBrush(Color.DarkOrchid);\n\t\t\t\t}\n\t\t\t\treturn (darkOrchid);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkRed {\n\t\t\tget {\n\t\t\t\tif (darkRed == null) {\n\t\t\t\t\tdarkRed = new SolidBrush(Color.DarkRed);\n\t\t\t\t}\n\t\t\t\treturn (darkRed);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkSalmon {\n\t\t\tget {\n\t\t\t\tif (darkSalmon == null) {\n\t\t\t\t\tdarkSalmon = new SolidBrush(Color.DarkSalmon);\n\t\t\t\t}\n\t\t\t\treturn (darkSalmon);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkSeaGreen {\n\t\t\tget {\n\t\t\t\tif (darkSeaGreen == null) {\n\t\t\t\t\tdarkSeaGreen = new SolidBrush(Color.DarkSeaGreen);\n\t\t\t\t}\n\t\t\t\treturn (darkSeaGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkSlateBlue {\n\t\t\tget {\n\t\t\t\tif (darkSlateBlue == null) {\n\t\t\t\t\tdarkSlateBlue = new SolidBrush(Color.DarkSlateBlue);\n\t\t\t\t}\n\t\t\t\treturn (darkSlateBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkSlateGray {\n\t\t\tget {\n\t\t\t\tif (darkSlateGray == null) {\n\t\t\t\t\tdarkSlateGray = new SolidBrush(Color.DarkSlateGray);\n\t\t\t\t}\n\t\t\t\treturn (darkSlateGray);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkTurquoise {\n\t\t\tget {\n\t\t\t\tif (darkTurquoise == null) {\n\t\t\t\t\tdarkTurquoise = new SolidBrush(Color.DarkTurquoise);\n\t\t\t\t}\n\t\t\t\treturn (darkTurquoise);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DarkViolet {\n\t\t\tget {\n\t\t\t\tif (darkViolet == null) {\n\t\t\t\t\tdarkViolet = new SolidBrush(Color.DarkViolet);\n\t\t\t\t}\n\t\t\t\treturn (darkViolet);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DeepPink {\n\t\t\tget {\n\t\t\t\tif (deepPink == null) {\n\t\t\t\t\tdeepPink = new SolidBrush(Color.DeepPink);\n\t\t\t\t}\n\t\t\t\treturn (deepPink);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DeepSkyBlue {\n\t\t\tget {\n\t\t\t\tif (deepSkyBlue == null) {\n\t\t\t\t\tdeepSkyBlue = new SolidBrush(Color.DeepSkyBlue);\n\t\t\t\t}\n\t\t\t\treturn (deepSkyBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DimGray {\n\t\t\tget {\n\t\t\t\tif (dimGray == null) {\n\t\t\t\t\tdimGray = new SolidBrush(Color.DimGray);\n\t\t\t\t}\n\t\t\t\treturn (dimGray);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush DodgerBlue {\n\t\t\tget {\n\t\t\t\tif (dodgerBlue == null) {\n\t\t\t\t\tdodgerBlue = new SolidBrush(Color.DodgerBlue);\n\t\t\t\t}\n\t\t\t\treturn (dodgerBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Firebrick {\n\t\t\tget {\n\t\t\t\tif (firebrick == null) {\n\t\t\t\t\tfirebrick = new SolidBrush(Color.Firebrick);\n\t\t\t\t}\n\t\t\t\treturn (firebrick);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush FloralWhite {\n\t\t\tget {\n\t\t\t\tif (floralWhite == null) {\n\t\t\t\t\tfloralWhite = new SolidBrush(Color.FloralWhite);\n\t\t\t\t}\n\t\t\t\treturn (floralWhite);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush ForestGreen {\n\t\t\tget {\n\t\t\t\tif (forestGreen == null) {\n\t\t\t\t\tforestGreen = new SolidBrush(Color.ForestGreen);\n\t\t\t\t}\n\t\t\t\treturn (forestGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Fuchsia {\n\t\t\tget {\n\t\t\t\tif (fuchsia == null) {\n\t\t\t\t\tfuchsia = new SolidBrush(Color.Fuchsia);\n\t\t\t\t}\n\t\t\t\treturn (fuchsia);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Gainsboro {\n\t\t\tget {\n\t\t\t\tif (gainsboro == null) {\n\t\t\t\t\tgainsboro = new SolidBrush(Color.Gainsboro);\n\t\t\t\t}\n\t\t\t\treturn (gainsboro);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush GhostWhite {\n\t\t\tget {\n\t\t\t\tif (ghostWhite == null) {\n\t\t\t\t\tghostWhite = new SolidBrush(Color.GhostWhite);\n\t\t\t\t}\n\t\t\t\treturn (ghostWhite);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Gold {\n\t\t\tget {\n\t\t\t\tif (gold == null) {\n\t\t\t\t\tgold = new SolidBrush(Color.Gold);\n\t\t\t\t}\n\t\t\t\treturn (gold);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Goldenrod {\n\t\t\tget {\n\t\t\t\tif (goldenrod == null) {\n\t\t\t\t\tgoldenrod = new SolidBrush(Color.Goldenrod);\n\t\t\t\t}\n\t\t\t\treturn (goldenrod);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Gray {\n\t\t\tget {\n\t\t\t\tif (gray == null) {\n\t\t\t\t\tgray = new SolidBrush(Color.Gray);\n\t\t\t\t}\n\t\t\t\treturn (gray);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Green {\n\t\t\tget {\n\t\t\t\tif (green == null) {\n\t\t\t\t\tgreen = new SolidBrush(Color.Green);\n\t\t\t\t}\n\t\t\t\treturn (green);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush GreenYellow {\n\t\t\tget {\n\t\t\t\tif (greenYellow == null) {\n\t\t\t\t\tgreenYellow = new SolidBrush(Color.GreenYellow);\n\t\t\t\t}\n\t\t\t\treturn (greenYellow);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Honeydew {\n\t\t\tget {\n\t\t\t\tif (honeydew == null) {\n\t\t\t\t\thoneydew = new SolidBrush(Color.Honeydew);\n\t\t\t\t}\n\t\t\t\treturn (honeydew);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush HotPink {\n\t\t\tget {\n\t\t\t\tif (hotPink == null) {\n\t\t\t\t\thotPink = new SolidBrush(Color.HotPink);\n\t\t\t\t}\n\t\t\t\treturn (hotPink);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush IndianRed {\n\t\t\tget {\n\t\t\t\tif (indianRed == null) {\n\t\t\t\t\tindianRed = new SolidBrush(Color.IndianRed);\n\t\t\t\t}\n\t\t\t\treturn (indianRed);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Indigo {\n\t\t\tget {\n\t\t\t\tif (indigo == null) {\n\t\t\t\t\tindigo = new SolidBrush(Color.Indigo);\n\t\t\t\t}\n\t\t\t\treturn (indigo);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Ivory {\n\t\t\tget {\n\t\t\t\tif (ivory == null) {\n\t\t\t\t\tivory = new SolidBrush(Color.Ivory);\n\t\t\t\t}\n\t\t\t\treturn (ivory);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Khaki {\n\t\t\tget {\n\t\t\t\tif (khaki == null) {\n\t\t\t\t\tkhaki = new SolidBrush(Color.Khaki);\n\t\t\t\t}\n\t\t\t\treturn (khaki);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Lavender {\n\t\t\tget {\n\t\t\t\tif (lavender == null) {\n\t\t\t\t\tlavender = new SolidBrush(Color.Lavender);\n\t\t\t\t}\n\t\t\t\treturn (lavender);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LavenderBlush {\n\t\t\tget {\n\t\t\t\tif (lavenderBlush == null) {\n\t\t\t\t\tlavenderBlush = new SolidBrush(Color.LavenderBlush);\n\t\t\t\t}\n\t\t\t\treturn (lavenderBlush);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LawnGreen {\n\t\t\tget {\n\t\t\t\tif (lawnGreen == null) {\n\t\t\t\t\tlawnGreen = new SolidBrush(Color.LawnGreen);\n\t\t\t\t}\n\t\t\t\treturn (lawnGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LemonChiffon {\n\t\t\tget {\n\t\t\t\tif (lemonChiffon == null) {\n\t\t\t\t\tlemonChiffon = new SolidBrush(Color.LemonChiffon);\n\t\t\t\t}\n\t\t\t\treturn (lemonChiffon);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightBlue {\n\t\t\tget {\n\t\t\t\tif (lightBlue == null) {\n\t\t\t\t\tlightBlue = new SolidBrush(Color.LightBlue);\n\t\t\t\t}\n\t\t\t\treturn (lightBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightCoral {\n\t\t\tget {\n\t\t\t\tif (lightCoral == null) {\n\t\t\t\t\tlightCoral = new SolidBrush(Color.LightCoral);\n\t\t\t\t}\n\t\t\t\treturn (lightCoral);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightCyan {\n\t\t\tget {\n\t\t\t\tif (lightCyan == null) {\n\t\t\t\t\tlightCyan = new SolidBrush(Color.LightCyan);\n\t\t\t\t}\n\t\t\t\treturn (lightCyan);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightGoldenrodYellow {\n\t\t\tget {\n\t\t\t\tif (lightGoldenrodYellow == null) {\n\t\t\t\t\tlightGoldenrodYellow = new SolidBrush(Color.LightGoldenrodYellow);\n\t\t\t\t}\n\t\t\t\treturn (lightGoldenrodYellow);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightGray {\n\t\t\tget {\n\t\t\t\tif (lightGray == null) {\n\t\t\t\t\tlightGray = new SolidBrush(Color.LightGray);\n\t\t\t\t}\n\t\t\t\treturn (lightGray);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightGreen {\n\t\t\tget {\n\t\t\t\tif (lightGreen == null) {\n\t\t\t\t\tlightGreen = new SolidBrush(Color.LightGreen);\n\t\t\t\t}\n\t\t\t\treturn (lightGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightPink {\n\t\t\tget {\n\t\t\t\tif (lightPink == null) {\n\t\t\t\t\tlightPink = new SolidBrush(Color.LightPink);\n\t\t\t\t}\n\t\t\t\treturn (lightPink);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightSalmon {\n\t\t\tget {\n\t\t\t\tif (lightSalmon == null) {\n\t\t\t\t\tlightSalmon = new SolidBrush(Color.LightSalmon);\n\t\t\t\t}\n\t\t\t\treturn (lightSalmon);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightSeaGreen {\n\t\t\tget {\n\t\t\t\tif (lightSeaGreen == null) {\n\t\t\t\t\tlightSeaGreen = new SolidBrush(Color.LightSeaGreen);\n\t\t\t\t}\n\t\t\t\treturn (lightSeaGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightSkyBlue {\n\t\t\tget {\n\t\t\t\tif (lightSkyBlue == null) {\n\t\t\t\t\tlightSkyBlue = new SolidBrush(Color.LightSkyBlue);\n\t\t\t\t}\n\t\t\t\treturn (lightSkyBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightSlateGray {\n\t\t\tget {\n\t\t\t\tif (lightSlateGray == null) {\n\t\t\t\t\tlightSlateGray = new SolidBrush(Color.LightSlateGray);\n\t\t\t\t}\n\t\t\t\treturn (lightSlateGray);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightSteelBlue {\n\t\t\tget {\n\t\t\t\tif (lightSteelBlue == null) {\n\t\t\t\t\tlightSteelBlue = new SolidBrush(Color.LightSteelBlue);\n\t\t\t\t}\n\t\t\t\treturn (lightSteelBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LightYellow {\n\t\t\tget {\n\t\t\t\tif (lightYellow == null) {\n\t\t\t\t\tlightYellow = new SolidBrush(Color.LightYellow);\n\t\t\t\t}\n\t\t\t\treturn (lightYellow);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Lime {\n\t\t\tget {\n\t\t\t\tif (lime == null) {\n\t\t\t\t\tlime = new SolidBrush(Color.Lime);\n\t\t\t\t}\n\t\t\t\treturn (lime);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush LimeGreen {\n\t\t\tget {\n\t\t\t\tif (limeGreen == null) {\n\t\t\t\t\tlimeGreen = new SolidBrush(Color.LimeGreen);\n\t\t\t\t}\n\t\t\t\treturn (limeGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Linen {\n\t\t\tget {\n\t\t\t\tif (linen == null) {\n\t\t\t\t\tlinen = new SolidBrush(Color.Linen);\n\t\t\t\t}\n\t\t\t\treturn (linen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Magenta {\n\t\t\tget {\n\t\t\t\tif (magenta == null) {\n\t\t\t\t\tmagenta = new SolidBrush(Color.Magenta);\n\t\t\t\t}\n\t\t\t\treturn (magenta);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Maroon {\n\t\t\tget {\n\t\t\t\tif (maroon == null) {\n\t\t\t\t\tmaroon = new SolidBrush(Color.Maroon);\n\t\t\t\t}\n\t\t\t\treturn (maroon);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MediumAquamarine {\n\t\t\tget {\n\t\t\t\tif (mediumAquamarine == null) {\n\t\t\t\t\tmediumAquamarine = new SolidBrush(Color.MediumAquamarine);\n\t\t\t\t}\n\t\t\t\treturn (mediumAquamarine);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MediumBlue {\n\t\t\tget {\n\t\t\t\tif (mediumBlue == null) {\n\t\t\t\t\tmediumBlue = new SolidBrush(Color.MediumBlue);\n\t\t\t\t}\n\t\t\t\treturn (mediumBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MediumOrchid {\n\t\t\tget {\n\t\t\t\tif (mediumOrchid == null) {\n\t\t\t\t\tmediumOrchid = new SolidBrush(Color.MediumOrchid);\n\t\t\t\t}\n\t\t\t\treturn (mediumOrchid);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MediumPurple {\n\t\t\tget {\n\t\t\t\tif (mediumPurple == null) {\n\t\t\t\t\tmediumPurple = new SolidBrush(Color.MediumPurple);\n\t\t\t\t}\n\t\t\t\treturn (mediumPurple);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MediumSeaGreen {\n\t\t\tget {\n\t\t\t\tif (mediumSeaGreen == null) {\n\t\t\t\t\tmediumSeaGreen = new SolidBrush(Color.MediumSeaGreen);\n\t\t\t\t}\n\t\t\t\treturn (mediumSeaGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MediumSlateBlue {\n\t\t\tget {\n\t\t\t\tif (mediumSlateBlue == null) {\n\t\t\t\t\tmediumSlateBlue = new SolidBrush(Color.MediumSlateBlue);\n\t\t\t\t}\n\t\t\t\treturn (mediumSlateBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MediumSpringGreen {\n\t\t\tget {\n\t\t\t\tif (mediumSpringGreen == null) {\n\t\t\t\t\tmediumSpringGreen = new SolidBrush(Color.MediumSpringGreen);\n\t\t\t\t}\n\t\t\t\treturn (mediumSpringGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MediumTurquoise {\n\t\t\tget {\n\t\t\t\tif (mediumTurquoise == null) {\n\t\t\t\t\tmediumTurquoise = new SolidBrush(Color.MediumTurquoise);\n\t\t\t\t}\n\t\t\t\treturn (mediumTurquoise);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MediumVioletRed {\n\t\t\tget {\n\t\t\t\tif (mediumVioletRed == null) {\n\t\t\t\t\tmediumVioletRed = new SolidBrush(Color.MediumVioletRed);\n\t\t\t\t}\n\t\t\t\treturn (mediumVioletRed);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MidnightBlue {\n\t\t\tget {\n\t\t\t\tif (midnightBlue == null) {\n\t\t\t\t\tmidnightBlue = new SolidBrush(Color.MidnightBlue);\n\t\t\t\t}\n\t\t\t\treturn (midnightBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MintCream {\n\t\t\tget {\n\t\t\t\tif (mintCream == null) {\n\t\t\t\t\tmintCream = new SolidBrush(Color.MintCream);\n\t\t\t\t}\n\t\t\t\treturn (mintCream);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush MistyRose {\n\t\t\tget {\n\t\t\t\tif (mistyRose == null) {\n\t\t\t\t\tmistyRose = new SolidBrush(Color.MistyRose);\n\t\t\t\t}\n\t\t\t\treturn (mistyRose);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Moccasin {\n\t\t\tget {\n\t\t\t\tif (moccasin == null) {\n\t\t\t\t\tmoccasin = new SolidBrush(Color.Moccasin);\n\t\t\t\t}\n\t\t\t\treturn (moccasin);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush NavajoWhite {\n\t\t\tget {\n\t\t\t\tif (navajoWhite == null) {\n\t\t\t\t\tnavajoWhite = new SolidBrush(Color.NavajoWhite);\n\t\t\t\t}\n\t\t\t\treturn (navajoWhite);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Navy {\n\t\t\tget {\n\t\t\t\tif (navy == null) {\n\t\t\t\t\tnavy = new SolidBrush(Color.Navy);\n\t\t\t\t}\n\t\t\t\treturn (navy);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush OldLace {\n\t\t\tget {\n\t\t\t\tif (oldLace == null) {\n\t\t\t\t\toldLace = new SolidBrush(Color.OldLace);\n\t\t\t\t}\n\t\t\t\treturn (oldLace);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Olive {\n\t\t\tget {\n\t\t\t\tif (olive == null) {\n\t\t\t\t\tolive = new SolidBrush(Color.Olive);\n\t\t\t\t}\n\t\t\t\treturn (olive);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush OliveDrab {\n\t\t\tget {\n\t\t\t\tif (oliveDrab == null) {\n\t\t\t\t\toliveDrab = new SolidBrush(Color.OliveDrab);\n\t\t\t\t}\n\t\t\t\treturn (oliveDrab);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Orange {\n\t\t\tget {\n\t\t\t\tif (orange == null) {\n\t\t\t\t\torange = new SolidBrush(Color.Orange);\n\t\t\t\t}\n\t\t\t\treturn (orange);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush OrangeRed {\n\t\t\tget {\n\t\t\t\tif (orangeRed == null) {\n\t\t\t\t\torangeRed = new SolidBrush(Color.OrangeRed);\n\t\t\t\t}\n\t\t\t\treturn (orangeRed);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Orchid {\n\t\t\tget {\n\t\t\t\tif (orchid == null) {\n\t\t\t\t\torchid = new SolidBrush(Color.Orchid);\n\t\t\t\t}\n\t\t\t\treturn (orchid);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush PaleGoldenrod {\n\t\t\tget {\n\t\t\t\tif (paleGoldenrod == null) {\n\t\t\t\t\tpaleGoldenrod = new SolidBrush(Color.PaleGoldenrod);\n\t\t\t\t}\n\t\t\t\treturn (paleGoldenrod);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush PaleGreen {\n\t\t\tget {\n\t\t\t\tif (paleGreen == null) {\n\t\t\t\t\tpaleGreen = new SolidBrush(Color.PaleGreen);\n\t\t\t\t}\n\t\t\t\treturn (paleGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush PaleTurquoise {\n\t\t\tget {\n\t\t\t\tif (paleTurquoise == null) {\n\t\t\t\t\tpaleTurquoise = new SolidBrush(Color.PaleTurquoise);\n\t\t\t\t}\n\t\t\t\treturn (paleTurquoise);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush PaleVioletRed {\n\t\t\tget {\n\t\t\t\tif (paleVioletRed == null) {\n\t\t\t\t\tpaleVioletRed = new SolidBrush(Color.PaleVioletRed);\n\t\t\t\t}\n\t\t\t\treturn (paleVioletRed);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush PapayaWhip {\n\t\t\tget {\n\t\t\t\tif (papayaWhip == null) {\n\t\t\t\t\tpapayaWhip = new SolidBrush(Color.PapayaWhip);\n\t\t\t\t}\n\t\t\t\treturn (papayaWhip);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush PeachPuff {\n\t\t\tget {\n\t\t\t\tif (peachPuff == null) {\n\t\t\t\t\tpeachPuff = new SolidBrush(Color.PeachPuff);\n\t\t\t\t}\n\t\t\t\treturn (peachPuff);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Peru {\n\t\t\tget {\n\t\t\t\tif (peru == null) {\n\t\t\t\t\tperu = new SolidBrush(Color.Peru);\n\t\t\t\t}\n\t\t\t\treturn (peru);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Pink {\n\t\t\tget {\n\t\t\t\tif (pink == null) {\n\t\t\t\t\tpink = new SolidBrush(Color.Pink);\n\t\t\t\t}\n\t\t\t\treturn (pink);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Plum {\n\t\t\tget {\n\t\t\t\tif (plum == null) {\n\t\t\t\t\tplum = new SolidBrush(Color.Plum);\n\t\t\t\t}\n\t\t\t\treturn (plum);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush PowderBlue {\n\t\t\tget {\n\t\t\t\tif (powderBlue == null) {\n\t\t\t\t\tpowderBlue = new SolidBrush(Color.PowderBlue);\n\t\t\t\t}\n\t\t\t\treturn (powderBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Purple {\n\t\t\tget {\n\t\t\t\tif (purple == null) {\n\t\t\t\t\tpurple = new SolidBrush(Color.Purple);\n\t\t\t\t}\n\t\t\t\treturn (purple);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Red {\n\t\t\tget {\n\t\t\t\tif (red == null) {\n\t\t\t\t\tred = new SolidBrush(Color.Red);\n\t\t\t\t}\n\t\t\t\treturn (red);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush RosyBrown {\n\t\t\tget {\n\t\t\t\tif (rosyBrown == null) {\n\t\t\t\t\trosyBrown = new SolidBrush(Color.RosyBrown);\n\t\t\t\t}\n\t\t\t\treturn (rosyBrown);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush RoyalBlue {\n\t\t\tget {\n\t\t\t\tif (royalBlue == null) {\n\t\t\t\t\troyalBlue = new SolidBrush(Color.RoyalBlue);\n\t\t\t\t}\n\t\t\t\treturn (royalBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush SaddleBrown {\n\t\t\tget {\n\t\t\t\tif (saddleBrown == null) {\n\t\t\t\t\tsaddleBrown = new SolidBrush(Color.SaddleBrown);\n\t\t\t\t}\n\t\t\t\treturn (saddleBrown);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Salmon {\n\t\t\tget {\n\t\t\t\tif (salmon == null) {\n\t\t\t\t\tsalmon = new SolidBrush(Color.Salmon);\n\t\t\t\t}\n\t\t\t\treturn (salmon);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush SandyBrown {\n\t\t\tget {\n\t\t\t\tif (sandyBrown == null) {\n\t\t\t\t\tsandyBrown = new SolidBrush(Color.SandyBrown);\n\t\t\t\t}\n\t\t\t\treturn (sandyBrown);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush SeaGreen {\n\t\t\tget {\n\t\t\t\tif (seaGreen == null) {\n\t\t\t\t\tseaGreen = new SolidBrush(Color.SeaGreen);\n\t\t\t\t}\n\t\t\t\treturn (seaGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush SeaShell {\n\t\t\tget {\n\t\t\t\tif (seaShell == null) {\n\t\t\t\t\tseaShell = new SolidBrush(Color.SeaShell);\n\t\t\t\t}\n\t\t\t\treturn (seaShell);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Sienna {\n\t\t\tget {\n\t\t\t\tif (sienna == null) {\n\t\t\t\t\tsienna = new SolidBrush(Color.Sienna);\n\t\t\t\t}\n\t\t\t\treturn (sienna);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Silver {\n\t\t\tget {\n\t\t\t\tif (silver == null) {\n\t\t\t\t\tsilver = new SolidBrush(Color.Silver);\n\t\t\t\t}\n\t\t\t\treturn (silver);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush SkyBlue {\n\t\t\tget {\n\t\t\t\tif (skyBlue == null) {\n\t\t\t\t\tskyBlue = new SolidBrush(Color.SkyBlue);\n\t\t\t\t}\n\t\t\t\treturn (skyBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush SlateBlue {\n\t\t\tget {\n\t\t\t\tif (slateBlue == null) {\n\t\t\t\t\tslateBlue = new SolidBrush(Color.SlateBlue);\n\t\t\t\t}\n\t\t\t\treturn (slateBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush SlateGray {\n\t\t\tget {\n\t\t\t\tif (slateGray == null) {\n\t\t\t\t\tslateGray = new SolidBrush(Color.SlateGray);\n\t\t\t\t}\n\t\t\t\treturn (slateGray);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Snow {\n\t\t\tget {\n\t\t\t\tif (snow == null) {\n\t\t\t\t\tsnow = new SolidBrush(Color.Snow);\n\t\t\t\t}\n\t\t\t\treturn (snow);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush SpringGreen {\n\t\t\tget {\n\t\t\t\tif (springGreen == null) {\n\t\t\t\t\tspringGreen = new SolidBrush(Color.SpringGreen);\n\t\t\t\t}\n\t\t\t\treturn (springGreen);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush SteelBlue {\n\t\t\tget {\n\t\t\t\tif (steelBlue == null) {\n\t\t\t\t\tsteelBlue = new SolidBrush(Color.SteelBlue);\n\t\t\t\t}\n\t\t\t\treturn (steelBlue);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Tan {\n\t\t\tget {\n\t\t\t\tif (tan == null) {\n\t\t\t\t\ttan = new SolidBrush(Color.Tan);\n\t\t\t\t}\n\t\t\t\treturn (tan);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Teal {\n\t\t\tget {\n\t\t\t\tif (teal == null) {\n\t\t\t\t\tteal = new SolidBrush(Color.Teal);\n\t\t\t\t}\n\t\t\t\treturn (teal);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Thistle {\n\t\t\tget {\n\t\t\t\tif (thistle == null) {\n\t\t\t\t\tthistle = new SolidBrush(Color.Thistle);\n\t\t\t\t}\n\t\t\t\treturn (thistle);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Tomato {\n\t\t\tget {\n\t\t\t\tif (tomato == null) {\n\t\t\t\t\ttomato = new SolidBrush(Color.Tomato);\n\t\t\t\t}\n\t\t\t\treturn (tomato);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Transparent {\n\t\t\tget {\n\t\t\t\tif (transparent == null) {\n\t\t\t\t\ttransparent = new SolidBrush(Color.Transparent);\n\t\t\t\t}\n\t\t\t\treturn (transparent);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Turquoise {\n\t\t\tget {\n\t\t\t\tif (turquoise == null) {\n\t\t\t\t\tturquoise = new SolidBrush(Color.Turquoise);\n\t\t\t\t}\n\t\t\t\treturn (turquoise);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Violet {\n\t\t\tget {\n\t\t\t\tif (violet == null) {\n\t\t\t\t\tviolet = new SolidBrush(Color.Violet);\n\t\t\t\t}\n\t\t\t\treturn (violet);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Wheat {\n\t\t\tget {\n\t\t\t\tif (wheat == null) {\n\t\t\t\t\twheat = new SolidBrush(Color.Wheat);\n\t\t\t\t}\n\t\t\t\treturn (wheat);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush White {\n\t\t\tget {\n\t\t\t\tif (white == null) {\n\t\t\t\t\twhite = new SolidBrush(Color.White);\n\t\t\t\t}\n\t\t\t\treturn (white);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush WhiteSmoke {\n\t\t\tget {\n\t\t\t\tif (whiteSmoke == null) {\n\t\t\t\t\twhiteSmoke = new SolidBrush(Color.WhiteSmoke);\n\t\t\t\t}\n\t\t\t\treturn (whiteSmoke);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush Yellow {\n\t\t\tget {\n\t\t\t\tif (yellow == null) {\n\t\t\t\t\tyellow = new SolidBrush(Color.Yellow);\n\t\t\t\t}\n\t\t\t\treturn (yellow);\n\t\t\t}\n\t\t}\n\n\t\tpublic static Brush YellowGreen {\n\t\t\tget {\n\t\t\t\tif (yellowGreen == null) {\n\t\t\t\t\tyellowGreen = new SolidBrush(Color.YellowGreen);\n\t\t\t\t}\n\t\t\t\treturn (yellowGreen);\n\t\t\t}\n\t\t}\n\t\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Color.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic struct Color {\n\n\t\tpublic static Color FromKnownColor(KnownColor c) {\n\t\t\treturn KnownColors.FromKnownColor(c);\n\t\t}\n\n\t\tpublic static Color FromArgb(int argb) {\n\t\t\tColor col = new Color();\n\t\t\tcol.value = argb;\n\t\t\treturn col;\n\t\t}\n\n\t\tpublic static Color FromArgb(int alpha, Color baseCol) {\n\t\t\tColor col = new Color();\n\t\t\tcol.value = col.value & 0x00ffffff | (alpha << 24);\n\t\t\treturn col;\n\t\t}\n\n\t\tprivate int value;\n\n\t\tpublic int ToArgb() {\n\t\t\treturn value;\n\t\t}\n\n\t\tstatic public Color Transparent { get { return KnownColors.FromKnownColor(KnownColor.Transparent); } }\n\t\tstatic public Color AliceBlue { get { return KnownColors.FromKnownColor(KnownColor.AliceBlue); } }\n\t\tstatic public Color AntiqueWhite { get { return KnownColors.FromKnownColor(KnownColor.AntiqueWhite); } }\n\t\tstatic public Color Aqua { get { return KnownColors.FromKnownColor(KnownColor.Aqua); } }\n\t\tstatic public Color Aquamarine { get { return KnownColors.FromKnownColor(KnownColor.Aquamarine); } }\n\t\tstatic public Color Azure { get { return KnownColors.FromKnownColor(KnownColor.Azure); } }\n\t\tstatic public Color Beige { get { return KnownColors.FromKnownColor(KnownColor.Beige); } }\n\t\tstatic public Color Bisque { get { return KnownColors.FromKnownColor(KnownColor.Bisque); } }\n\t\tstatic public Color Black { get { return KnownColors.FromKnownColor(KnownColor.Black); } }\n\t\tstatic public Color BlanchedAlmond { get { return KnownColors.FromKnownColor(KnownColor.BlanchedAlmond); } }\n\t\tstatic public Color Blue { get { return KnownColors.FromKnownColor(KnownColor.Blue); } }\n\t\tstatic public Color BlueViolet { get { return KnownColors.FromKnownColor(KnownColor.BlueViolet); } }\n\t\tstatic public Color Brown { get { return KnownColors.FromKnownColor(KnownColor.Brown); } }\n\t\tstatic public Color BurlyWood { get { return KnownColors.FromKnownColor(KnownColor.BurlyWood); } }\n\t\tstatic public Color CadetBlue { get { return KnownColors.FromKnownColor(KnownColor.CadetBlue); } }\n\t\tstatic public Color Chartreuse { get { return KnownColors.FromKnownColor(KnownColor.Chartreuse); } }\n\t\tstatic public Color Chocolate { get { return KnownColors.FromKnownColor(KnownColor.Chocolate); } }\n\t\tstatic public Color Coral { get { return KnownColors.FromKnownColor(KnownColor.Coral); } }\n\t\tstatic public Color CornflowerBlue { get { return KnownColors.FromKnownColor(KnownColor.CornflowerBlue); } }\n\t\tstatic public Color Cornsilk { get { return KnownColors.FromKnownColor(KnownColor.Cornsilk); } }\n\t\tstatic public Color Crimson { get { return KnownColors.FromKnownColor(KnownColor.Crimson); } }\n\t\tstatic public Color Cyan { get { return KnownColors.FromKnownColor(KnownColor.Cyan); } }\n\t\tstatic public Color DarkBlue { get { return KnownColors.FromKnownColor(KnownColor.DarkBlue); } }\n\t\tstatic public Color DarkCyan { get { return KnownColors.FromKnownColor(KnownColor.DarkCyan); } }\n\t\tstatic public Color DarkGoldenrod { get { return KnownColors.FromKnownColor(KnownColor.DarkGoldenrod); } }\n\t\tstatic public Color DarkGray { get { return KnownColors.FromKnownColor(KnownColor.DarkGray); } }\n\t\tstatic public Color DarkGreen { get { return KnownColors.FromKnownColor(KnownColor.DarkGreen); } }\n\t\tstatic public Color DarkKhaki { get { return KnownColors.FromKnownColor(KnownColor.DarkKhaki); } }\n\t\tstatic public Color DarkMagenta { get { return KnownColors.FromKnownColor(KnownColor.DarkMagenta); } }\n\t\tstatic public Color DarkOliveGreen { get { return KnownColors.FromKnownColor(KnownColor.DarkOliveGreen); } }\n\t\tstatic public Color DarkOrange { get { return KnownColors.FromKnownColor(KnownColor.DarkOrange); } }\n\t\tstatic public Color DarkOrchid { get { return KnownColors.FromKnownColor(KnownColor.DarkOrchid); } }\n\t\tstatic public Color DarkRed { get { return KnownColors.FromKnownColor(KnownColor.DarkRed); } }\n\t\tstatic public Color DarkSalmon { get { return KnownColors.FromKnownColor(KnownColor.DarkSalmon); } }\n\t\tstatic public Color DarkSeaGreen { get { return KnownColors.FromKnownColor(KnownColor.DarkSeaGreen); } }\n\t\tstatic public Color DarkSlateBlue { get { return KnownColors.FromKnownColor(KnownColor.DarkSlateBlue); } }\n\t\tstatic public Color DarkSlateGray { get { return KnownColors.FromKnownColor(KnownColor.DarkSlateGray); } }\n\t\tstatic public Color DarkTurquoise { get { return KnownColors.FromKnownColor(KnownColor.DarkTurquoise); } }\n\t\tstatic public Color DarkViolet { get { return KnownColors.FromKnownColor(KnownColor.DarkViolet); } }\n\t\tstatic public Color DeepPink { get { return KnownColors.FromKnownColor(KnownColor.DeepPink); } }\n\t\tstatic public Color DeepSkyBlue { get { return KnownColors.FromKnownColor(KnownColor.DeepSkyBlue); } }\n\t\tstatic public Color DimGray { get { return KnownColors.FromKnownColor(KnownColor.DimGray); } }\n\t\tstatic public Color DodgerBlue { get { return KnownColors.FromKnownColor(KnownColor.DodgerBlue); } }\n\t\tstatic public Color Firebrick { get { return KnownColors.FromKnownColor(KnownColor.Firebrick); } }\n\t\tstatic public Color FloralWhite { get { return KnownColors.FromKnownColor(KnownColor.FloralWhite); } }\n\t\tstatic public Color ForestGreen { get { return KnownColors.FromKnownColor(KnownColor.ForestGreen); } }\n\t\tstatic public Color Fuchsia { get { return KnownColors.FromKnownColor(KnownColor.Fuchsia); } }\n\t\tstatic public Color Gainsboro { get { return KnownColors.FromKnownColor(KnownColor.Gainsboro); } }\n\t\tstatic public Color GhostWhite { get { return KnownColors.FromKnownColor(KnownColor.GhostWhite); } }\n\t\tstatic public Color Gold { get { return KnownColors.FromKnownColor(KnownColor.Gold); } }\n\t\tstatic public Color Goldenrod { get { return KnownColors.FromKnownColor(KnownColor.Goldenrod); } }\n\t\tstatic public Color Gray { get { return KnownColors.FromKnownColor(KnownColor.Gray); } }\n\t\tstatic public Color Green { get { return KnownColors.FromKnownColor(KnownColor.Green); } }\n\t\tstatic public Color GreenYellow { get { return KnownColors.FromKnownColor(KnownColor.GreenYellow); } }\n\t\tstatic public Color Honeydew { get { return KnownColors.FromKnownColor(KnownColor.Honeydew); } }\n\t\tstatic public Color HotPink { get { return KnownColors.FromKnownColor(KnownColor.HotPink); } }\n\t\tstatic public Color IndianRed { get { return KnownColors.FromKnownColor(KnownColor.IndianRed); } }\n\t\tstatic public Color Indigo { get { return KnownColors.FromKnownColor(KnownColor.Indigo); } }\n\t\tstatic public Color Ivory { get { return KnownColors.FromKnownColor(KnownColor.Ivory); } }\n\t\tstatic public Color Khaki { get { return KnownColors.FromKnownColor(KnownColor.Khaki); } }\n\t\tstatic public Color Lavender { get { return KnownColors.FromKnownColor(KnownColor.Lavender); } }\n\t\tstatic public Color LavenderBlush { get { return KnownColors.FromKnownColor(KnownColor.LavenderBlush); } }\n\t\tstatic public Color LawnGreen { get { return KnownColors.FromKnownColor(KnownColor.LawnGreen); } }\n\t\tstatic public Color LemonChiffon { get { return KnownColors.FromKnownColor(KnownColor.LemonChiffon); } }\n\t\tstatic public Color LightBlue { get { return KnownColors.FromKnownColor(KnownColor.LightBlue); } }\n\t\tstatic public Color LightCoral { get { return KnownColors.FromKnownColor(KnownColor.LightCoral); } }\n\t\tstatic public Color LightCyan { get { return KnownColors.FromKnownColor(KnownColor.LightCyan); } }\n\t\tstatic public Color LightGoldenrodYellow { get { return KnownColors.FromKnownColor(KnownColor.LightGoldenrodYellow); } }\n\t\tstatic public Color LightGreen { get { return KnownColors.FromKnownColor(KnownColor.LightGreen); } }\n\t\tstatic public Color LightGray { get { return KnownColors.FromKnownColor(KnownColor.LightGray); } }\n\t\tstatic public Color LightPink { get { return KnownColors.FromKnownColor(KnownColor.LightPink); } }\n\t\tstatic public Color LightSalmon { get { return KnownColors.FromKnownColor(KnownColor.LightSalmon); } }\n\t\tstatic public Color LightSeaGreen { get { return KnownColors.FromKnownColor(KnownColor.LightSeaGreen); } }\n\t\tstatic public Color LightSkyBlue { get { return KnownColors.FromKnownColor(KnownColor.LightSkyBlue); } }\n\t\tstatic public Color LightSlateGray { get { return KnownColors.FromKnownColor(KnownColor.LightSlateGray); } }\n\t\tstatic public Color LightSteelBlue { get { return KnownColors.FromKnownColor(KnownColor.LightSteelBlue); } }\n\t\tstatic public Color LightYellow { get { return KnownColors.FromKnownColor(KnownColor.LightYellow); } }\n\t\tstatic public Color Lime { get { return KnownColors.FromKnownColor(KnownColor.Lime); } }\n\t\tstatic public Color LimeGreen { get { return KnownColors.FromKnownColor(KnownColor.LimeGreen); } }\n\t\tstatic public Color Linen { get { return KnownColors.FromKnownColor(KnownColor.Linen); } }\n\t\tstatic public Color Magenta { get { return KnownColors.FromKnownColor(KnownColor.Magenta); } }\n\t\tstatic public Color Maroon { get { return KnownColors.FromKnownColor(KnownColor.Maroon); } }\n\t\tstatic public Color MediumAquamarine { get { return KnownColors.FromKnownColor(KnownColor.MediumAquamarine); } }\n\t\tstatic public Color MediumBlue { get { return KnownColors.FromKnownColor(KnownColor.MediumBlue); } }\n\t\tstatic public Color MediumOrchid { get { return KnownColors.FromKnownColor(KnownColor.MediumOrchid); } }\n\t\tstatic public Color MediumPurple { get { return KnownColors.FromKnownColor(KnownColor.MediumPurple); } }\n\t\tstatic public Color MediumSeaGreen { get { return KnownColors.FromKnownColor(KnownColor.MediumSeaGreen); } }\n\t\tstatic public Color MediumSlateBlue { get { return KnownColors.FromKnownColor(KnownColor.MediumSlateBlue); } }\n\t\tstatic public Color MediumSpringGreen { get { return KnownColors.FromKnownColor(KnownColor.MediumSpringGreen); } }\n\t\tstatic public Color MediumTurquoise { get { return KnownColors.FromKnownColor(KnownColor.MediumTurquoise); } }\n\t\tstatic public Color MediumVioletRed { get { return KnownColors.FromKnownColor(KnownColor.MediumVioletRed); } }\n\t\tstatic public Color MidnightBlue { get { return KnownColors.FromKnownColor(KnownColor.MidnightBlue); } }\n\t\tstatic public Color MintCream { get { return KnownColors.FromKnownColor(KnownColor.MintCream); } }\n\t\tstatic public Color MistyRose { get { return KnownColors.FromKnownColor(KnownColor.MistyRose); } }\n\t\tstatic public Color Moccasin { get { return KnownColors.FromKnownColor(KnownColor.Moccasin); } }\n\t\tstatic public Color NavajoWhite { get { return KnownColors.FromKnownColor(KnownColor.NavajoWhite); } }\n\t\tstatic public Color Navy { get { return KnownColors.FromKnownColor(KnownColor.Navy); } }\n\t\tstatic public Color OldLace { get { return KnownColors.FromKnownColor(KnownColor.OldLace); } }\n\t\tstatic public Color Olive { get { return KnownColors.FromKnownColor(KnownColor.Olive); } }\n\t\tstatic public Color OliveDrab { get { return KnownColors.FromKnownColor(KnownColor.OliveDrab); } }\n\t\tstatic public Color Orange { get { return KnownColors.FromKnownColor(KnownColor.Orange); } }\n\t\tstatic public Color OrangeRed { get { return KnownColors.FromKnownColor(KnownColor.OrangeRed); } }\n\t\tstatic public Color Orchid { get { return KnownColors.FromKnownColor(KnownColor.Orchid); } }\n\t\tstatic public Color PaleGoldenrod { get { return KnownColors.FromKnownColor(KnownColor.PaleGoldenrod); } }\n\t\tstatic public Color PaleGreen { get { return KnownColors.FromKnownColor(KnownColor.PaleGreen); } }\n\t\tstatic public Color PaleTurquoise { get { return KnownColors.FromKnownColor(KnownColor.PaleTurquoise); } }\n\t\tstatic public Color PaleVioletRed { get { return KnownColors.FromKnownColor(KnownColor.PaleVioletRed); } }\n\t\tstatic public Color PapayaWhip { get { return KnownColors.FromKnownColor(KnownColor.PapayaWhip); } }\n\t\tstatic public Color PeachPuff { get { return KnownColors.FromKnownColor(KnownColor.PeachPuff); } }\n\t\tstatic public Color Peru { get { return KnownColors.FromKnownColor(KnownColor.Peru); } }\n\t\tstatic public Color Pink { get { return KnownColors.FromKnownColor(KnownColor.Pink); } }\n\t\tstatic public Color Plum { get { return KnownColors.FromKnownColor(KnownColor.Plum); } }\n\t\tstatic public Color PowderBlue { get { return KnownColors.FromKnownColor(KnownColor.PowderBlue); } }\n\t\tstatic public Color Purple { get { return KnownColors.FromKnownColor(KnownColor.Purple); } }\n\t\tstatic public Color Red { get { return KnownColors.FromKnownColor(KnownColor.Red); } }\n\t\tstatic public Color RosyBrown { get { return KnownColors.FromKnownColor(KnownColor.RosyBrown); } }\n\t\tstatic public Color RoyalBlue { get { return KnownColors.FromKnownColor(KnownColor.RoyalBlue); } }\n\t\tstatic public Color SaddleBrown { get { return KnownColors.FromKnownColor(KnownColor.SaddleBrown); } }\n\t\tstatic public Color Salmon { get { return KnownColors.FromKnownColor(KnownColor.Salmon); } }\n\t\tstatic public Color SandyBrown { get { return KnownColors.FromKnownColor(KnownColor.SandyBrown); } }\n\t\tstatic public Color SeaGreen { get { return KnownColors.FromKnownColor(KnownColor.SeaGreen); } }\n\t\tstatic public Color SeaShell { get { return KnownColors.FromKnownColor(KnownColor.SeaShell); } }\n\t\tstatic public Color Sienna { get { return KnownColors.FromKnownColor(KnownColor.Sienna); } }\n\t\tstatic public Color Silver { get { return KnownColors.FromKnownColor(KnownColor.Silver); } }\n\t\tstatic public Color SkyBlue { get { return KnownColors.FromKnownColor(KnownColor.SkyBlue); } }\n\t\tstatic public Color SlateBlue { get { return KnownColors.FromKnownColor(KnownColor.SlateBlue); } }\n\t\tstatic public Color SlateGray { get { return KnownColors.FromKnownColor(KnownColor.SlateGray); } }\n\t\tstatic public Color Snow { get { return KnownColors.FromKnownColor(KnownColor.Snow); } }\n\t\tstatic public Color SpringGreen { get { return KnownColors.FromKnownColor(KnownColor.SpringGreen); } }\n\t\tstatic public Color SteelBlue { get { return KnownColors.FromKnownColor(KnownColor.SteelBlue); } }\n\t\tstatic public Color Tan { get { return KnownColors.FromKnownColor(KnownColor.Tan); } }\n\t\tstatic public Color Teal { get { return KnownColors.FromKnownColor(KnownColor.Teal); } }\n\t\tstatic public Color Thistle { get { return KnownColors.FromKnownColor(KnownColor.Thistle); } }\n\t\tstatic public Color Tomato { get { return KnownColors.FromKnownColor(KnownColor.Tomato); } }\n\t\tstatic public Color Turquoise { get { return KnownColors.FromKnownColor(KnownColor.Turquoise); } }\n\t\tstatic public Color Violet { get { return KnownColors.FromKnownColor(KnownColor.Violet); } }\n\t\tstatic public Color Wheat { get { return KnownColors.FromKnownColor(KnownColor.Wheat); } }\n\t\tstatic public Color White { get { return KnownColors.FromKnownColor(KnownColor.White); } }\n\t\tstatic public Color WhiteSmoke { get { return KnownColors.FromKnownColor(KnownColor.WhiteSmoke); } }\n\t\tstatic public Color Yellow { get { return KnownColors.FromKnownColor(KnownColor.Yellow); } }\n\t\tstatic public Color YellowGreen { get { return KnownColors.FromKnownColor(KnownColor.YellowGreen); } }\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Font.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic sealed class Font : MarshalByRefObject, IDisposable {\n\n\t\tinternal IntPtr native = IntPtr.Zero;\n\n\t\tprivate FontFamily family;\n\n\t\tpublic Font(FontFamily family, float emSize)\n\t\t\t: this(family, emSize, FontStyle.Regular) { }\n\n\t\tpublic Font(FontFamily family, float emSize, FontStyle style) {\n\t\t\tthis.family = family;\n\t\t\tthis.native = LibIGraph._CreateFont(family.native, emSize, style);\n\t\t}\n\n\t\tpublic Font(string familyName, float emSize) {\n\t\t\tthis.family = new FontFamily(familyName);\n\t\t\tthis.native = LibIGraph._CreateFont(this.family.native, emSize, FontStyle.Regular);\n\t\t}\n\n\t\t~Font() {\n\t\t\tthis.Dispose();\n\t\t}\n\n\t\tpublic void Dispose() {\n\t\t\tif (this.native != IntPtr.Zero) {\n\t\t\t\tLibIGraph.DisposeFont(this.native);\n\t\t\t\tthis.native = IntPtr.Zero;\n\t\t\t\tGC.SuppressFinalize(this);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/FontFamily.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic sealed class FontFamily:MarshalByRefObject, IDisposable {\n\n\t\tinternal IntPtr native = IntPtr.Zero;\n\n\t\tpublic FontFamily(string name) {\n\t\t\tthis.native = LibIGraph.CreateFontFamily_Name(name);\n\t\t\tif (this.native == IntPtr.Zero) {\n\t\t\t\tthrow new ArgumentException(\"Font '\" + name + \"' cannot be found.\");\n\t\t\t}\n\t\t}\n\n\t\t~FontFamily() {\n\t\t\tthis.Dispose();\n\t\t}\n\n\t\tpublic void Dispose() {\n\t\t\tif (this.native != IntPtr.Zero) {\n\t\t\t\tLibIGraph.DisposeFontFamily(this.native);\n\t\t\t\tthis.native = IntPtr.Zero;\n\t\t\t\tGC.SuppressFinalize(this);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/FontStyle.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace System.Drawing {\n\tpublic enum FontStyle {\n\t\tRegular = 0,\n\t\tBold = 1,\n\t\tItalic = 2,\n\t\tUnderline = 4,\n\t\tStrikeout = 8\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Graphics.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Drawing.Imaging;\nusing System.Runtime.InteropServices;\nusing System.Drawing.Text;\n\nnamespace System.Drawing {\n\tpublic sealed class Graphics : MarshalByRefObject, IDisposable {\n\n\t\tpublic static Graphics FromHdc(IntPtr hdc) {\n\t\t\tif (hdc != IntPtr.Zero) {\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t\tint xSize, ySize;\n\t\t\tPixelFormat pixelFormat;\n\t\t\tIntPtr native = LibIGraph.GetScreen(out xSize, out ySize, out pixelFormat);\n\t\t\tif (native == IntPtr.Zero) {\n\t\t\t\tthrow new Exception(\"CreateScreen() failed\");\n\t\t\t}\n\t\t\treturn new Graphics(xSize, ySize, pixelFormat, native);\n\t\t}\n\n\t\tpublic static Graphics FromImage(Image image) {\n\t\t\tif (image == null) {\n\t\t\t\tthrow new ArgumentNullException(\"image\");\n\t\t\t}\n\t\t\tIntPtr native = LibIGraph.GetGraphicsFromImage(image.native);\n\t\t\tif (native == IntPtr.Zero) {\n\t\t\t\tthrow new ArgumentException(\"Failed to get Graphics from given Image\", \"image\");\n\t\t\t}\n\t\t\treturn new Graphics(image.Width, image.Height, image.PixelFormat, native);\n\t\t}\n\n\t\tprivate IntPtr native = IntPtr.Zero;\n\t\tprivate int xSizePixels, ySizePixels;\n\t\tprivate PixelFormat pixelFormat;\n\t\tprivate TextRenderingHint textRenderingHint;\n\t\tprivate Region clip;\n\n\t\tprivate Graphics(int xSize, int ySize, PixelFormat pixelFormat, IntPtr native) {\n\t\t\tthis.xSizePixels = xSize;\n\t\t\tthis.ySizePixels = ySize;\n\t\t\tthis.pixelFormat = pixelFormat;\n\t\t\tthis.native = native;\n\t\t\tthis.textRenderingHint = TextRenderingHint.SystemDefault;\n\t\t\tthis.Clip = new Region();\n\t\t}\n\n\t\t~Graphics() {\n\t\t\tthis.Dispose();\n\t\t}\n\n\t\tpublic void Dispose() {\n\t\t\tif (this.native != IntPtr.Zero) {\n\t\t\t\tLibIGraph.DisposeGraphics(this.native);\n\t\t\t\tthis.native = IntPtr.Zero;\n\t\t\t\tGC.SuppressFinalize(this);\n\t\t\t}\n\t\t}\n\n\t\tpublic Region Clip {\n\t\t\tget {\n\t\t\t\treturn this.clip;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value == null) {\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\t}\n\t\t\t\tthis.clip = value;\n\t\t\t\tLibIGraph.Graphics_SetClip(this.native, value.native);\n\t\t\t}\n\t\t}\n\n\t\tpublic void ResetClip() {\n\t\t\tthis.Clip = new Region();\n\t\t}\n\n\t\tpublic void Clear(Color color) {\n\t\t\tLibIGraph.Clear(this.native, color.ToArgb());\n\t\t}\n\n\t\tpublic TextRenderingHint TextRenderingHint {\n\t\t\tget {\n\t\t\t\treturn this.textRenderingHint;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tLibIGraph.TextRenderingHint_Set(this.native, value);\n\t\t\t\tthis.textRenderingHint = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic void DrawLine(Pen pen, int x1, int y1, int x2, int y2) {\n\t\t\tLibIGraph.DrawLine_Ints(this.native, pen.native, x1, y1, x2, y2);\n\t\t}\n\n\t\tpublic void DrawLine(Pen pen, Point pt1, Point pt2) {\n\t\t\tLibIGraph.DrawLine_Ints(this.native, pen.native, pt1.X, pt1.Y, pt2.X, pt2.Y);\n\t\t}\n\n\t\tpublic void DrawLines(Pen pen, Point[] points) {\n\t\t\tint num = points.Length - 1;\n\t\t\tfor (int i = 0; i < num; i++) {\n\t\t\t\tthis.DrawLine(pen, points[i], points[i + 1]);\n\t\t\t}\n\t\t}\n\n\t\tpublic void DrawPolygon(Pen pen, Point[] points) {\n\t\t\tthis.DrawLines(pen, points);\n\t\t\tthis.DrawLine(pen, points[points.Length - 1], points[0]);\n\t\t}\n\n\t\tpublic void DrawRectangle(Pen pen, int x, int y, int width, int height) {\n\t\t\tDrawLines(pen, new Point[] {\n\t\t\t\tnew Point(x, y),\n\t\t\t\tnew Point(x + width, y),\n\t\t\t\tnew Point(x + width, y + height),\n\t\t\t\tnew Point(x, y + height),\n\t\t\t\tnew Point(x, y)\n\t\t\t});\n\t\t}\n\n\t\tpublic void DrawRectangle(Pen pen, Rectangle rect) {\n\t\t\tthis.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height);\n\t\t}\n\n\t\tpublic void DrawRectangle(Pen pen, float x, float y, float width, float height) {\n\t\t\tthis.DrawRectangle(pen, (int)x, (int)y, (int)width, (int)height);\n\t\t}\n\n\t\tpublic void FillRectangle(Brush brush, int x, int y, int width, int height) {\n\t\t\tLibIGraph.FillRectangle_Ints(this.native, brush.native, x, y, width, height);\n\t\t}\n\n\t\tpublic void FillRectangle(Brush brush, Rectangle rect) {\n\t\t\tthis.FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height);\n\t\t}\n\n\t\tpublic void FillRectangle(Brush brush, float x, float y, float width, float height) {\n\t\t\tthis.FillRectangle(brush, (int)x, (int)y, (int)width, (int)height);\n\t\t}\n\n\t\tpublic void FillRectangle(Brush brush, RectangleF rect) {\n\t\t\tthis.FillRectangle(brush, rect.X, rect.Y, rect.Width, rect.Height);\n\t\t}\n\n\t\tpublic void DrawEllipse(Pen pen, int x, int y, int width, int height) {\n\t\t\tLibIGraph.DrawEllipse_Ints(this.native, pen.native, x, y, width, height);\n\t\t}\n\n\t\tpublic void DrawEllipse(Pen pen, Rectangle rect) {\n\t\t\tthis.DrawRectangle(pen, rect.X, rect.Y, rect.Width, rect.Height);\n\t\t}\n\n\t\tpublic void FillEllipse(Brush brush, int x, int y, int width, int height) {\n\t\t\tLibIGraph.FillEllipse_Ints(this.native, brush.native, x, y, width, height);\n\t\t}\n\n\t\tpublic void FillEllipse(Brush brush, Rectangle rect) {\n\t\t\tthis.FillEllipse(brush, rect.X, rect.Y, rect.Width, rect.Height);\n\t\t}\n\n\t\tpublic void DrawString(string s, Font font, Brush brush, float x, float y, StringFormat format) {\n\t\t\tLibIGraph.DrawString(this.native, s, font.native, brush.native, (int)x, (int)y, int.MaxValue, int.MaxValue, (format == null) ? IntPtr.Zero : format.native);\n\t\t}\n\n\t\tpublic void DrawString(string s, Font font, Brush brush, float x, float y) {\n\t\t\tthis.DrawString(s, font, brush, x, y, StringFormat.GenericDefault);\n\t\t}\n\n\t\tpublic void DrawString(string s, Font font, Brush brush, PointF point) {\n\t\t\tthis.DrawString(s, font, brush, point.X, point.Y, StringFormat.GenericDefault);\n\t\t}\n\n\t\tpublic void DrawString(string s, Font font, Brush brush, RectangleF rect) {\n\t\t\tLibIGraph.DrawString(this.native, s, font.native, brush.native,\n\t\t\t\t(int)rect.Left, (int)rect.Top, (int)rect.Right, (int)rect.Bottom,\n\t\t\t\tStringFormat.GenericDefault.native);\n\t\t}\n\n\t\tpublic void DrawString(string s, Font font, Brush brush, RectangleF rect, StringFormat format) {\n\t\t\tLibIGraph.DrawString(this.native, s, font.native, brush.native,\n\t\t\t\t(int)rect.Left, (int)rect.Top, (int)rect.Right, (int)rect.Bottom, format.native);\n\t\t}\n\n\t\tpublic SizeF MeasureString(string s, Font font) {\n\t\t\treturn this.MeasureString(s, font, int.MaxValue, StringFormat.GenericDefault);\n\t\t}\n\n\t\tpublic SizeF MeasureString(string s, Font font, int width) {\n\t\t\treturn this.MeasureString(s, font, width, StringFormat.GenericDefault);\n\t\t}\n\n\t\tpublic SizeF MeasureString(string s, Font font, int width, StringFormat format) {\n\t\t\tint szWidth, szHeight;\n\t\t\tLibIGraph.MeasureString(this.native, s, font.native, width, format.native, out szWidth, out szHeight);\n\t\t\treturn new SizeF(szWidth, szHeight);\n\t\t}\n\n\t\tpublic void DrawImage(Image image, int x, int y) {\n\t\t\tLibIGraph.DrawImageUnscaled(this.native, image.native, x, y);\n\t\t}\n\n\t\tpublic void DrawImageUnscaled(Image image, int x, int y) {\n\t\t\tLibIGraph.DrawImageUnscaled(this.native, image.native, x, y);\n\t\t}\n\n\t\tpublic void CopyFromScreen(int srcX, int srcY, int destX, int destY, Size size) {\n\t\t\tLibIGraph.Graphics_CopyFromScreen(this.native, srcX, srcY, destX, destY, size.Width, size.Height);\n\t\t}\n\n\t\tpublic void CopyFromScreen(Point upperLeftSource, Point upperLeftDestination, Size size) {\n\t\t\tthis.CopyFromScreen(upperLeftSource.X, upperLeftSource.Y, upperLeftDestination.X, upperLeftDestination.Y, size);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Image.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Drawing.Imaging;\n\nnamespace System.Drawing {\n\tpublic abstract class Image : MarshalByRefObject, IDisposable {\n\n\t\tpublic static Image FromFile(string filename) {\n\t\t\tif (string.IsNullOrEmpty(filename)) {\n\t\t\t\tthrow new ArgumentNullException(\"filename\");\n\t\t\t}\n\t\t\tint width, height;\n\t\t\tPixelFormat pixelFormat;\n\t\t\tIntPtr native = LibIGraph.BitmapFromFile(filename, out width, out height, out pixelFormat);\n\t\t\treturn new Bitmap(native, width, height, pixelFormat);\n\t\t}\n\n\t\tinternal IntPtr native = IntPtr.Zero;\n\n\t\tprotected int width, height;\n\t\tprotected PixelFormat pixelFormat;\n\n\t\t~Image() {\n\t\t\tthis.Dispose();\n\t\t}\n\n\t\tpublic void Dispose() {\n\t\t\tif (this.native != IntPtr.Zero) {\n\t\t\t\tLibIGraph.DisposeImage(this.native);\n\t\t\t\tGC.SuppressFinalize(this);\n\t\t\t\tthis.native = IntPtr.Zero;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Width {\n\t\t\tget {\n\t\t\t\treturn this.width;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Height {\n\t\t\tget {\n\t\t\t\treturn this.height;\n\t\t\t}\n\t\t}\n\n\t\tpublic PixelFormat PixelFormat {\n\t\t\tget {\n\t\t\t\treturn this.pixelFormat;\n\t\t\t}\n\t\t}\n\n\t\tpublic Size Size {\n\t\t\tget {\n\t\t\t\treturn new Size(this.width, this.height);\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/KnownColor.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic enum KnownColor {\n\t\tActiveBorder = 1,\n\t\tActiveCaption = 2,\n\t\tActiveCaptionText = 3,\n\t\tAppWorkspace = 4,\n\t\tControl = 5,\n\t\tControlDark = 6,\n\t\tControlDarkDark = 7,\n\t\tControlLight = 8,\n\t\tControlLightLight = 9,\n\t\tControlText = 10,\n\t\tDesktop = 11,\n\t\tGrayText = 12,\n\t\tHighlight = 13,\n\t\tHighlightText = 14,\n\t\tHotTrack = 15,\n\t\tInactiveBorder = 16,\n\t\tInactiveCaption = 17,\n\t\tInactiveCaptionText = 18,\n\t\tInfo = 19,\n\t\tInfoText = 20,\n\t\tMenu = 21,\n\t\tMenuText = 22,\n\t\tScrollBar = 23,\n\t\tWindow = 24,\n\t\tWindowFrame = 25,\n\t\tWindowText = 26,\n\t\tTransparent = 27,\n\t\tAliceBlue = 28,\n\t\tAntiqueWhite = 29,\n\t\tAqua = 30,\n\t\tAquamarine = 31,\n\t\tAzure = 32,\n\t\tBeige = 33,\n\t\tBisque = 34,\n\t\tBlack = 35,\n\t\tBlanchedAlmond = 36,\n\t\tBlue = 37,\n\t\tBlueViolet = 38,\n\t\tBrown = 39,\n\t\tBurlyWood = 40,\n\t\tCadetBlue = 41,\n\t\tChartreuse = 42,\n\t\tChocolate = 43,\n\t\tCoral = 44,\n\t\tCornflowerBlue = 45,\n\t\tCornsilk = 46,\n\t\tCrimson = 47,\n\t\tCyan = 48,\n\t\tDarkBlue = 49,\n\t\tDarkCyan = 50,\n\t\tDarkGoldenrod = 51,\n\t\tDarkGray = 52,\n\t\tDarkGreen = 53,\n\t\tDarkKhaki = 54,\n\t\tDarkMagenta = 55,\n\t\tDarkOliveGreen = 56,\n\t\tDarkOrange = 57,\n\t\tDarkOrchid = 58,\n\t\tDarkRed = 59,\n\t\tDarkSalmon = 60,\n\t\tDarkSeaGreen = 61,\n\t\tDarkSlateBlue = 62,\n\t\tDarkSlateGray = 63,\n\t\tDarkTurquoise = 64,\n\t\tDarkViolet = 65,\n\t\tDeepPink = 66,\n\t\tDeepSkyBlue = 67,\n\t\tDimGray = 68,\n\t\tDodgerBlue = 69,\n\t\tFirebrick = 70,\n\t\tFloralWhite = 71,\n\t\tForestGreen = 72,\n\t\tFuchsia = 73,\n\t\tGainsboro = 74,\n\t\tGhostWhite = 75,\n\t\tGold = 76,\n\t\tGoldenrod = 77,\n\t\tGray = 78,\n\t\tGreen = 79,\n\t\tGreenYellow = 80,\n\t\tHoneydew = 81,\n\t\tHotPink = 82,\n\t\tIndianRed = 83,\n\t\tIndigo = 84,\n\t\tIvory = 85,\n\t\tKhaki = 86,\n\t\tLavender = 87,\n\t\tLavenderBlush = 88,\n\t\tLawnGreen = 89,\n\t\tLemonChiffon = 90,\n\t\tLightBlue = 91,\n\t\tLightCoral = 92,\n\t\tLightCyan = 93,\n\t\tLightGoldenrodYellow = 94,\n\t\tLightGray = 95,\n\t\tLightGreen = 96,\n\t\tLightPink = 97,\n\t\tLightSalmon = 98,\n\t\tLightSeaGreen = 99,\n\t\tLightSkyBlue = 100,\n\t\tLightSlateGray = 101,\n\t\tLightSteelBlue = 102,\n\t\tLightYellow = 103,\n\t\tLime = 104,\n\t\tLimeGreen = 105,\n\t\tLinen = 106,\n\t\tMagenta = 107,\n\t\tMaroon = 108,\n\t\tMediumAquamarine = 109,\n\t\tMediumBlue = 110,\n\t\tMediumOrchid = 111,\n\t\tMediumPurple = 112,\n\t\tMediumSeaGreen = 113,\n\t\tMediumSlateBlue = 114,\n\t\tMediumSpringGreen = 115,\n\t\tMediumTurquoise = 116,\n\t\tMediumVioletRed = 117,\n\t\tMidnightBlue = 118,\n\t\tMintCream = 119,\n\t\tMistyRose = 120,\n\t\tMoccasin = 121,\n\t\tNavajoWhite = 122,\n\t\tNavy = 123,\n\t\tOldLace = 124,\n\t\tOlive = 125,\n\t\tOliveDrab = 126,\n\t\tOrange = 127,\n\t\tOrangeRed = 128,\n\t\tOrchid = 129,\n\t\tPaleGoldenrod = 130,\n\t\tPaleGreen = 131,\n\t\tPaleTurquoise = 132,\n\t\tPaleVioletRed = 133,\n\t\tPapayaWhip = 134,\n\t\tPeachPuff = 135,\n\t\tPeru = 136,\n\t\tPink = 137,\n\t\tPlum = 138,\n\t\tPowderBlue = 139,\n\t\tPurple = 140,\n\t\tRed = 141,\n\t\tRosyBrown = 142,\n\t\tRoyalBlue = 143,\n\t\tSaddleBrown = 144,\n\t\tSalmon = 145,\n\t\tSandyBrown = 146,\n\t\tSeaGreen = 147,\n\t\tSeaShell = 148,\n\t\tSienna = 149,\n\t\tSilver = 150,\n\t\tSkyBlue = 151,\n\t\tSlateBlue = 152,\n\t\tSlateGray = 153,\n\t\tSnow = 154,\n\t\tSpringGreen = 155,\n\t\tSteelBlue = 156,\n\t\tTan = 157,\n\t\tTeal = 158,\n\t\tThistle = 159,\n\t\tTomato = 160,\n\t\tTurquoise = 161,\n\t\tViolet = 162,\n\t\tWheat = 163,\n\t\tWhite = 164,\n\t\tWhiteSmoke = 165,\n\t\tYellow = 166,\n\t\tYellowGreen = 167,\n\t\tButtonFace = 168,\n\t\tButtonHighlight = 169,\n\t\tButtonShadow = 170,\n\t\tGradientActiveCaption = 171,\n\t\tGradientInactiveCaption = 172,\n\t\tMenuBar = 173,\n\t\tMenuHighlight = 174\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/KnownColors.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tinternal static class KnownColors {\n\n\t\tstatic private uint[] ArgbValues = new uint[] {\n\t\t\t0x00000000,\t/* 000 - Empty */\n\t\t\t0xFFD4D0C8,\t/* 001 - ActiveBorder */\n\t\t\t0xFF0054E3,\t/* 002 - ActiveCaption */\n\t\t\t0xFFFFFFFF,\t/* 003 - ActiveCaptionText */\n\t\t\t0xFF808080,\t/* 004 - AppWorkspace */\n\t\t\t0xFFECE9D8,\t/* 005 - Control */\n\t\t\t0xFFACA899,\t/* 006 - ControlDark */\n\t\t\t0xFF716F64,\t/* 007 - ControlDarkDark */\n\t\t\t0xFFF1EFE2,\t/* 008 - ControlLight */\n\t\t\t0xFFFFFFFF,\t/* 009 - ControlLightLight */\n\t\t\t0xFF000000,\t/* 010 - ControlText */\n\t\t\t0xFF004E98,\t/* 011 - Desktop */\n\t\t\t0xFFACA899,\t/* 012 - GrayText */\n\t\t\t0xFF316AC5,\t/* 013 - Highlight */\n\t\t\t0xFFFFFFFF,\t/* 014 - HighlightText */\n\t\t\t0xFF000080,\t/* 015 - HotTrack */\n\t\t\t0xFFD4D0C8,\t/* 016 - InactiveBorder */\n\t\t\t0xFF7A96DF,\t/* 017 - InactiveCaption */\n\t\t\t0xFFD8E4F8,\t/* 018 - InactiveCaptionText */\n\t\t\t0xFFFFFFE1,\t/* 019 - Info */\n\t\t\t0xFF000000,\t/* 020 - InfoText */\n\t\t\t0xFFFFFFFF,\t/* 021 - Menu */\n\t\t\t0xFF000000,\t/* 022 - MenuText */\n\t\t\t0xFFD4D0C8,\t/* 023 - ScrollBar */\n\t\t\t0xFFFFFFFF,\t/* 024 - Window */\n\t\t\t0xFF000000,\t/* 025 - WindowFrame */\n\t\t\t0xFF000000,\t/* 026 - WindowText */\n\t\t\t0x00FFFFFF,\t/* 027 - Transparent */\n\t\t\t0xFFF0F8FF,\t/* 028 - AliceBlue */\n\t\t\t0xFFFAEBD7,\t/* 029 - AntiqueWhite */\n\t\t\t0xFF00FFFF,\t/* 030 - Aqua */\n\t\t\t0xFF7FFFD4,\t/* 031 - Aquamarine */\n\t\t\t0xFFF0FFFF,\t/* 032 - Azure */\n\t\t\t0xFFF5F5DC,\t/* 033 - Beige */\n\t\t\t0xFFFFE4C4,\t/* 034 - Bisque */\n\t\t\t0xFF000000,\t/* 035 - Black */\n\t\t\t0xFFFFEBCD,\t/* 036 - BlanchedAlmond */\n\t\t\t0xFF0000FF,\t/* 037 - Blue */\n\t\t\t0xFF8A2BE2,\t/* 038 - BlueViolet */\n\t\t\t0xFFA52A2A,\t/* 039 - Brown */\n\t\t\t0xFFDEB887,\t/* 040 - BurlyWood */\n\t\t\t0xFF5F9EA0,\t/* 041 - CadetBlue */\n\t\t\t0xFF7FFF00,\t/* 042 - Chartreuse */\n\t\t\t0xFFD2691E,\t/* 043 - Chocolate */\n\t\t\t0xFFFF7F50,\t/* 044 - Coral */\n\t\t\t0xFF6495ED,\t/* 045 - CornflowerBlue */\n\t\t\t0xFFFFF8DC,\t/* 046 - Cornsilk */\n\t\t\t0xFFDC143C,\t/* 047 - Crimson */\n\t\t\t0xFF00FFFF,\t/* 048 - Cyan */\n\t\t\t0xFF00008B,\t/* 049 - DarkBlue */\n\t\t\t0xFF008B8B,\t/* 050 - DarkCyan */\n\t\t\t0xFFB8860B,\t/* 051 - DarkGoldenrod */\n\t\t\t0xFFA9A9A9,\t/* 052 - DarkGray */\n\t\t\t0xFF006400,\t/* 053 - DarkGreen */\n\t\t\t0xFFBDB76B,\t/* 054 - DarkKhaki */\n\t\t\t0xFF8B008B,\t/* 055 - DarkMagenta */\n\t\t\t0xFF556B2F,\t/* 056 - DarkOliveGreen */\n\t\t\t0xFFFF8C00,\t/* 057 - DarkOrange */\n\t\t\t0xFF9932CC,\t/* 058 - DarkOrchid */\n\t\t\t0xFF8B0000,\t/* 059 - DarkRed */\n\t\t\t0xFFE9967A,\t/* 060 - DarkSalmon */\n\t\t\t0xFF8FBC8B,\t/* 061 - DarkSeaGreen */\n\t\t\t0xFF483D8B,\t/* 062 - DarkSlateBlue */\n\t\t\t0xFF2F4F4F,\t/* 063 - DarkSlateGray */\n\t\t\t0xFF00CED1,\t/* 064 - DarkTurquoise */\n\t\t\t0xFF9400D3,\t/* 065 - DarkViolet */\n\t\t\t0xFFFF1493,\t/* 066 - DeepPink */\n\t\t\t0xFF00BFFF,\t/* 067 - DeepSkyBlue */\n\t\t\t0xFF696969,\t/* 068 - DimGray */\n\t\t\t0xFF1E90FF,\t/* 069 - DodgerBlue */\n\t\t\t0xFFB22222,\t/* 070 - Firebrick */\n\t\t\t0xFFFFFAF0,\t/* 071 - FloralWhite */\n\t\t\t0xFF228B22,\t/* 072 - ForestGreen */\n\t\t\t0xFFFF00FF,\t/* 073 - Fuchsia */\n\t\t\t0xFFDCDCDC,\t/* 074 - Gainsboro */\n\t\t\t0xFFF8F8FF,\t/* 075 - GhostWhite */\n\t\t\t0xFFFFD700,\t/* 076 - Gold */\n\t\t\t0xFFDAA520,\t/* 077 - Goldenrod */\n\t\t\t0xFF808080,\t/* 078 - Gray */\n\t\t\t0xFF008000,\t/* 079 - Green */\n\t\t\t0xFFADFF2F,\t/* 080 - GreenYellow */\n\t\t\t0xFFF0FFF0,\t/* 081 - Honeydew */\n\t\t\t0xFFFF69B4,\t/* 082 - HotPink */\n\t\t\t0xFFCD5C5C,\t/* 083 - IndianRed */\n\t\t\t0xFF4B0082,\t/* 084 - Indigo */\n\t\t\t0xFFFFFFF0,\t/* 085 - Ivory */\n\t\t\t0xFFF0E68C,\t/* 086 - Khaki */\n\t\t\t0xFFE6E6FA,\t/* 087 - Lavender */\n\t\t\t0xFFFFF0F5,\t/* 088 - LavenderBlush */\n\t\t\t0xFF7CFC00,\t/* 089 - LawnGreen */\n\t\t\t0xFFFFFACD,\t/* 090 - LemonChiffon */\n\t\t\t0xFFADD8E6,\t/* 091 - LightBlue */\n\t\t\t0xFFF08080,\t/* 092 - LightCoral */\n\t\t\t0xFFE0FFFF,\t/* 093 - LightCyan */\n\t\t\t0xFFFAFAD2,\t/* 094 - LightGoldenrodYellow */\n\t\t\t0xFFD3D3D3,\t/* 095 - LightGray */\n\t\t\t0xFF90EE90,\t/* 096 - LightGreen */\n\t\t\t0xFFFFB6C1,\t/* 097 - LightPink */\n\t\t\t0xFFFFA07A,\t/* 098 - LightSalmon */\n\t\t\t0xFF20B2AA,\t/* 099 - LightSeaGreen */\n\t\t\t0xFF87CEFA,\t/* 100 - LightSkyBlue */\n\t\t\t0xFF778899,\t/* 101 - LightSlateGray */\n\t\t\t0xFFB0C4DE,\t/* 102 - LightSteelBlue */\n\t\t\t0xFFFFFFE0,\t/* 103 - LightYellow */\n\t\t\t0xFF00FF00,\t/* 104 - Lime */\n\t\t\t0xFF32CD32,\t/* 105 - LimeGreen */\n\t\t\t0xFFFAF0E6,\t/* 106 - Linen */\n\t\t\t0xFFFF00FF,\t/* 107 - Magenta */\n\t\t\t0xFF800000,\t/* 108 - Maroon */\n\t\t\t0xFF66CDAA,\t/* 109 - MediumAquamarine */\n\t\t\t0xFF0000CD,\t/* 110 - MediumBlue */\n\t\t\t0xFFBA55D3,\t/* 111 - MediumOrchid */\n\t\t\t0xFF9370DB,\t/* 112 - MediumPurple */\n\t\t\t0xFF3CB371,\t/* 113 - MediumSeaGreen */\n\t\t\t0xFF7B68EE,\t/* 114 - MediumSlateBlue */\n\t\t\t0xFF00FA9A,\t/* 115 - MediumSpringGreen */\n\t\t\t0xFF48D1CC,\t/* 116 - MediumTurquoise */\n\t\t\t0xFFC71585,\t/* 117 - MediumVioletRed */\n\t\t\t0xFF191970,\t/* 118 - MidnightBlue */\n\t\t\t0xFFF5FFFA,\t/* 119 - MintCream */\n\t\t\t0xFFFFE4E1,\t/* 120 - MistyRose */\n\t\t\t0xFFFFE4B5,\t/* 121 - Moccasin */\n\t\t\t0xFFFFDEAD,\t/* 122 - NavajoWhite */\n\t\t\t0xFF000080,\t/* 123 - Navy */\n\t\t\t0xFFFDF5E6,\t/* 124 - OldLace */\n\t\t\t0xFF808000,\t/* 125 - Olive */\n\t\t\t0xFF6B8E23,\t/* 126 - OliveDrab */\n\t\t\t0xFFFFA500,\t/* 127 - Orange */\n\t\t\t0xFFFF4500,\t/* 128 - OrangeRed */\n\t\t\t0xFFDA70D6,\t/* 129 - Orchid */\n\t\t\t0xFFEEE8AA,\t/* 130 - PaleGoldenrod */\n\t\t\t0xFF98FB98,\t/* 131 - PaleGreen */\n\t\t\t0xFFAFEEEE,\t/* 132 - PaleTurquoise */\n\t\t\t0xFFDB7093,\t/* 133 - PaleVioletRed */\n\t\t\t0xFFFFEFD5,\t/* 134 - PapayaWhip */\n\t\t\t0xFFFFDAB9,\t/* 135 - PeachPuff */\n\t\t\t0xFFCD853F,\t/* 136 - Peru */\n\t\t\t0xFFFFC0CB,\t/* 137 - Pink */\n\t\t\t0xFFDDA0DD,\t/* 138 - Plum */\n\t\t\t0xFFB0E0E6,\t/* 139 - PowderBlue */\n\t\t\t0xFF800080,\t/* 140 - Purple */\n\t\t\t0xFFFF0000,\t/* 141 - Red */\n\t\t\t0xFFBC8F8F,\t/* 142 - RosyBrown */\n\t\t\t0xFF4169E1,\t/* 143 - RoyalBlue */\n\t\t\t0xFF8B4513,\t/* 144 - SaddleBrown */\n\t\t\t0xFFFA8072,\t/* 145 - Salmon */\n\t\t\t0xFFF4A460,\t/* 146 - SandyBrown */\n\t\t\t0xFF2E8B57,\t/* 147 - SeaGreen */\n\t\t\t0xFFFFF5EE,\t/* 148 - SeaShell */\n\t\t\t0xFFA0522D,\t/* 149 - Sienna */\n\t\t\t0xFFC0C0C0,\t/* 150 - Silver */\n\t\t\t0xFF87CEEB,\t/* 151 - SkyBlue */\n\t\t\t0xFF6A5ACD,\t/* 152 - SlateBlue */\n\t\t\t0xFF708090,\t/* 153 - SlateGray */\n\t\t\t0xFFFFFAFA,\t/* 154 - Snow */\n\t\t\t0xFF00FF7F,\t/* 155 - SpringGreen */\n\t\t\t0xFF4682B4,\t/* 156 - SteelBlue */\n\t\t\t0xFFD2B48C,\t/* 157 - Tan */\n\t\t\t0xFF008080,\t/* 158 - Teal */\n\t\t\t0xFFD8BFD8,\t/* 159 - Thistle */\n\t\t\t0xFFFF6347,\t/* 160 - Tomato */\n\t\t\t0xFF40E0D0,\t/* 161 - Turquoise */\n\t\t\t0xFFEE82EE,\t/* 162 - Violet */\n\t\t\t0xFFF5DEB3,\t/* 163 - Wheat */\n\t\t\t0xFFFFFFFF,\t/* 164 - White */\n\t\t\t0xFFF5F5F5,\t/* 165 - WhiteSmoke */\n\t\t\t0xFFFFFF00,\t/* 166 - Yellow */\n\t\t\t0xFF9ACD32,\t/* 167 - YellowGreen */\n\t\t\t0xFFECE9D8,\t/* 168 - ButtonFace */\n\t\t\t0xFFFFFFFF,\t/* 169 - ButtonHighlight */\n\t\t\t0xFFACA899,\t/* 170 - ButtonShadow */\n\t\t\t0xFF3D95FF,\t/* 171 - GradientActiveCaption */\n\t\t\t0xFF9DB9EB,\t/* 172 - GradientInactiveCaption */\n\t\t\t0xFFECE9D8,\t/* 173 - MenuBar */\n\t\t\t0xFF316AC5,\t/* 174 - MenuHighlight */\n\t\t};\n\n\t\tinternal static Color FromKnownColor(KnownColor knownColor) {\n\t\t\tint idx = (int)knownColor;\n\t\t\treturn Color.FromArgb((int)ArgbValues[idx]);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/LibIGraph.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Runtime.InteropServices;\nusing System.Drawing.Imaging;\nusing System.Drawing.Text;\nusing System.Drawing.Drawing2D;\n\nnamespace System.Drawing {\n\tinternal static class LibIGraph {\n\n\t\t#region Graphics methods\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr GetScreen(out int xSize, out int ySize, out PixelFormat pixelFormat);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr GetGraphicsFromImage(IntPtr imageNative);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DisposeGraphics(IntPtr graphics);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void TextRenderingHint_Set(IntPtr graphics, TextRenderingHint textRenderingHint);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void Clear(IntPtr native, int argb);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DrawLine_Ints(IntPtr graphics, IntPtr pen, int x1, int y1, int x2, int y2);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void FillRectangle_Ints(IntPtr graphics, IntPtr brush, int x, int y, int width, int height);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DrawEllipse_Ints(IntPtr graphics, IntPtr pen, int x, int y, int width, int height);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void FillEllipse_Ints(IntPtr graphics, IntPtr brush, int x, int y, int width, int height);\n\n\t\t[DllImport(\"libIGraph\", CharSet = CharSet.Unicode)]\n\t\textern public static void DrawString(IntPtr graphics, string s, IntPtr font, IntPtr brush, int x1, int y1, int x2, int y2, IntPtr format);\n\n\t\t[DllImport(\"libIGraph\", CharSet = CharSet.Unicode)]\n\t\textern public static void MeasureString(IntPtr graphics, string s, IntPtr font, int width, IntPtr format, out int szWidth, out int szHeight);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DrawImageUnscaled(IntPtr graphics, IntPtr image, int x, int y);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void Graphics_SetClip(IntPtr graphics, IntPtr region);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void Graphics_CopyFromScreen(IntPtr graphics, int srcX, int srcY, int destX, int destY, int sizeX, int sizeY);\n\n\t\t#endregion\n\n\t\t#region Pen methods\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr CreatePen_Color(float width, int argb);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DisposePen(IntPtr native);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void Pen_SetCol(IntPtr native, int argb);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void Pen_SetWidth(IntPtr native, float width);\n\n\t\t#endregion\n\n\t\t#region Brush methods\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr CreateBrush_Solid(int argb);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr CreateBrush_Hatch(HatchStyle hatchStyle, int foreCol, int backCol);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr CreateBrush_LinearGradient(int x1, int y1, int x2, int y2, int col1, int col2);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DisposeBrush(IntPtr native);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void SolidBrush_SetCol(IntPtr native, int argb);\n\n\t\t#endregion\n\n\t\t#region FontFamily methods\n\n\t\t[DllImport(\"libIGraph\", CharSet=CharSet.Ansi)]\n\t\textern public static IntPtr CreateFontFamily_Name(string name);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DisposeFontFamily(IntPtr native);\n\n\t\t#endregion\n\n\t\t#region Font methods\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr _CreateFont(IntPtr family, float emSize, FontStyle style);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DisposeFont(IntPtr native);\n\n\t\t#endregion\n\n\t\t#region StringFormat methods\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr CreateStringFormat(StringAlignment alignment, StringFormatFlags formatFlags, StringAlignment lineAlignment, StringTrimming stringTrimming);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DisposeStringFormat(IntPtr native);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void StringFormat_SetTrimming(IntPtr stringFormat, StringTrimming trimming);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void StringFormat_SetAlignment(IntPtr stringFormat, StringAlignment alignment);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void StringFormat_SetLineAlignment(IntPtr stringFormat, StringAlignment lineAlignment);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void StringFormat_SetFormatFlags(IntPtr stringFormat, StringFormatFlags formatFlags);\n\n\t\t#endregion\n\n\t\t#region Image methods\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DisposeImage(IntPtr native);\n\n\t\t#endregion\n\n\t\t#region Bitmap methods\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr _CreateBitmap(int width, int height, PixelFormat pixelFormat);\n\n\t\t[DllImport(\"libIGraph\", CharSet = CharSet.Ansi)]\n\t\textern public static IntPtr BitmapFromFile(string filename, out int width, out int height, out PixelFormat pixelFormat);\n\n\t\t#endregion\n\n\t\t#region Region methods\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr CreateRegion_Infinite();\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static IntPtr CreateRegion_Rect(int x, int y, int width, int height);\n\n\t\t[DllImport(\"libIGraph\")]\n\t\textern public static void DisposeRegion(IntPtr native);\n\n\t\t#endregion\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Pen.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic sealed class Pen : MarshalByRefObject, IDisposable, ICloneable {\n\n\t\tinternal IntPtr native = IntPtr.Zero;\n\t\tprivate Color color;\n\t\tprivate float width;\n\t\tinternal bool canChange = true;\n\n\t\t~Pen() {\n\t\t\tthis.Dispose(false);\n\t\t}\n\n\t\tpublic Pen(Color color) : this(color, 1.0f) { }\n\n\t\tpublic Pen(Color color, float width) {\n\t\t\tif (width < 1.0f) {\n\t\t\t\twidth = 1.0f;\n\t\t\t}\n\t\t\tthis.color = color;\n\t\t\tthis.width = width;\n\t\t\tnative = LibIGraph.CreatePen_Color(width, color.ToArgb());\n\t\t}\n\n\t\tpublic Color Color {\n\t\t\tget {\n\t\t\t\treturn this.color;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (!this.canChange) {\n\t\t\t\t\tthrow new ArgumentException(\"This SolidBrush cannot be changed.\");\n\t\t\t\t}\n\t\t\t\tthis.color = value;\n\t\t\t\tLibIGraph.Pen_SetCol(this.native, value.ToArgb());\n\t\t\t}\n\t\t}\n\n\t\tpublic float Width {\n\t\t\tget {\n\t\t\t\treturn this.width;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (!this.canChange) {\n\t\t\t\t\tthrow new ArgumentException(\"This Pen cannot be changed.\");\n\t\t\t\t}\n\t\t\t\tif (value < 1.0f) {\n\t\t\t\t\tvalue = 1.0f;\n\t\t\t\t}\n\t\t\t\tLibIGraph.Pen_SetWidth(this.native, value);\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose() {\n\t\t\tthis.Dispose(true);\n\t\t\tGC.SuppressFinalize(this);\n\t\t}\n\n\t\tprivate void Dispose(bool disposing) {\n\t\t\tif (!this.canChange && disposing) {\n\t\t\t\tthrow new ArgumentException(\"This Pen cannot be disposed of.\");\n\t\t\t}\n\t\t\tif (this.native != IntPtr.Zero) {\n\t\t\t\tLibIGraph.DisposePen(this.native);\n\t\t\t\tthis.native = IntPtr.Zero;\n\t\t\t}\n\t\t}\n\n\t\tpublic object Clone() {\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Pens.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic static class Pens {\n\n\t\tprivate static Pen aliceblue;\n\t\tprivate static Pen antiquewhite;\n\t\tprivate static Pen aqua;\n\t\tprivate static Pen aquamarine;\n\t\tprivate static Pen azure;\n\t\tprivate static Pen beige;\n\t\tprivate static Pen bisque;\n\t\tprivate static Pen black;\n\t\tprivate static Pen blanchedalmond;\n\t\tprivate static Pen blue;\n\t\tprivate static Pen blueviolet;\n\t\tprivate static Pen brown;\n\t\tprivate static Pen burlywood;\n\t\tprivate static Pen cadetblue;\n\t\tprivate static Pen chartreuse;\n\t\tprivate static Pen chocolate;\n\t\tprivate static Pen coral;\n\t\tprivate static Pen cornflowerblue;\n\t\tprivate static Pen cornsilk;\n\t\tprivate static Pen crimson;\n\t\tprivate static Pen cyan;\n\t\tprivate static Pen darkblue;\n\t\tprivate static Pen darkcyan;\n\t\tprivate static Pen darkgoldenrod;\n\t\tprivate static Pen darkgray;\n\t\tprivate static Pen darkgreen;\n\t\tprivate static Pen darkkhaki;\n\t\tprivate static Pen darkmagenta;\n\t\tprivate static Pen darkolivegreen;\n\t\tprivate static Pen darkorange;\n\t\tprivate static Pen darkorchid;\n\t\tprivate static Pen darkred;\n\t\tprivate static Pen darksalmon;\n\t\tprivate static Pen darkseagreen;\n\t\tprivate static Pen darkslateblue;\n\t\tprivate static Pen darkslategray;\n\t\tprivate static Pen darkturquoise;\n\t\tprivate static Pen darkviolet;\n\t\tprivate static Pen deeppink;\n\t\tprivate static Pen deepskyblue;\n\t\tprivate static Pen dimgray;\n\t\tprivate static Pen dodgerblue;\n\t\tprivate static Pen firebrick;\n\t\tprivate static Pen floralwhite;\n\t\tprivate static Pen forestgreen;\n\t\tprivate static Pen fuchsia;\n\t\tprivate static Pen gainsboro;\n\t\tprivate static Pen ghostwhite;\n\t\tprivate static Pen gold;\n\t\tprivate static Pen goldenrod;\n\t\tprivate static Pen gray;\n\t\tprivate static Pen green;\n\t\tprivate static Pen greenyellow;\n\t\tprivate static Pen honeydew;\n\t\tprivate static Pen hotpink;\n\t\tprivate static Pen indianred;\n\t\tprivate static Pen indigo;\n\t\tprivate static Pen ivory;\n\t\tprivate static Pen khaki;\n\t\tprivate static Pen lavender;\n\t\tprivate static Pen lavenderblush;\n\t\tprivate static Pen lawngreen;\n\t\tprivate static Pen lemonchiffon;\n\t\tprivate static Pen lightblue;\n\t\tprivate static Pen lightcoral;\n\t\tprivate static Pen lightcyan;\n\t\tprivate static Pen lightgoldenrodyellow;\n\t\tprivate static Pen lightgray;\n\t\tprivate static Pen lightgreen;\n\t\tprivate static Pen lightpink;\n\t\tprivate static Pen lightsalmon;\n\t\tprivate static Pen lightseagreen;\n\t\tprivate static Pen lightskyblue;\n\t\tprivate static Pen lightslategray;\n\t\tprivate static Pen lightsteelblue;\n\t\tprivate static Pen lightyellow;\n\t\tprivate static Pen lime;\n\t\tprivate static Pen limegreen;\n\t\tprivate static Pen linen;\n\t\tprivate static Pen magenta;\n\t\tprivate static Pen maroon;\n\t\tprivate static Pen mediumaquamarine;\n\t\tprivate static Pen mediumblue;\n\t\tprivate static Pen mediumorchid;\n\t\tprivate static Pen mediumpurple;\n\t\tprivate static Pen mediumseagreen;\n\t\tprivate static Pen mediumslateblue;\n\t\tprivate static Pen mediumspringgreen;\n\t\tprivate static Pen mediumturquoise;\n\t\tprivate static Pen mediumvioletred;\n\t\tprivate static Pen midnightblue;\n\t\tprivate static Pen mintcream;\n\t\tprivate static Pen mistyrose;\n\t\tprivate static Pen moccasin;\n\t\tprivate static Pen navajowhite;\n\t\tprivate static Pen navy;\n\t\tprivate static Pen oldlace;\n\t\tprivate static Pen olive;\n\t\tprivate static Pen olivedrab;\n\t\tprivate static Pen orange;\n\t\tprivate static Pen orangered;\n\t\tprivate static Pen orchid;\n\t\tprivate static Pen palegoldenrod;\n\t\tprivate static Pen palegreen;\n\t\tprivate static Pen paleturquoise;\n\t\tprivate static Pen palevioletred;\n\t\tprivate static Pen papayawhip;\n\t\tprivate static Pen peachpuff;\n\t\tprivate static Pen peru;\n\t\tprivate static Pen pink;\n\t\tprivate static Pen plum;\n\t\tprivate static Pen powderblue;\n\t\tprivate static Pen purple;\n\t\tprivate static Pen red;\n\t\tprivate static Pen rosybrown;\n\t\tprivate static Pen royalblue;\n\t\tprivate static Pen saddlebrown;\n\t\tprivate static Pen salmon;\n\t\tprivate static Pen sandybrown;\n\t\tprivate static Pen seagreen;\n\t\tprivate static Pen seashell;\n\t\tprivate static Pen sienna;\n\t\tprivate static Pen silver;\n\t\tprivate static Pen skyblue;\n\t\tprivate static Pen slateblue;\n\t\tprivate static Pen slategray;\n\t\tprivate static Pen snow;\n\t\tprivate static Pen springgreen;\n\t\tprivate static Pen steelblue;\n\t\tprivate static Pen tan;\n\t\tprivate static Pen teal;\n\t\tprivate static Pen thistle;\n\t\tprivate static Pen tomato;\n\t\tprivate static Pen transparent;\n\t\tprivate static Pen turquoise;\n\t\tprivate static Pen violet;\n\t\tprivate static Pen wheat;\n\t\tprivate static Pen white;\n\t\tprivate static Pen whitesmoke;\n\t\tprivate static Pen yellow;\n\t\tprivate static Pen yellowgreen;\n\n\t\tpublic static Pen AliceBlue {\n\t\t\tget {\n\t\t\t\tif (aliceblue == null) {\n\t\t\t\t\taliceblue = new Pen(Color.AliceBlue);\n\t\t\t\t\taliceblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn aliceblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen AntiqueWhite {\n\t\t\tget {\n\t\t\t\tif (antiquewhite == null) {\n\t\t\t\t\tantiquewhite = new Pen(Color.AntiqueWhite);\n\t\t\t\t\tantiquewhite.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn antiquewhite;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Aqua {\n\t\t\tget {\n\t\t\t\tif (aqua == null) {\n\t\t\t\t\taqua = new Pen(Color.Aqua);\n\t\t\t\t\taqua.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn aqua;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Aquamarine {\n\t\t\tget {\n\t\t\t\tif (aquamarine == null) {\n\t\t\t\t\taquamarine = new Pen(Color.Aquamarine);\n\t\t\t\t\taquamarine.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn aquamarine;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Azure {\n\t\t\tget {\n\t\t\t\tif (azure == null) {\n\t\t\t\t\tazure = new Pen(Color.Azure);\n\t\t\t\t\tazure.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn azure;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Beige {\n\t\t\tget {\n\t\t\t\tif (beige == null) {\n\t\t\t\t\tbeige = new Pen(Color.Beige);\n\t\t\t\t\tbeige.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn beige;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Bisque {\n\t\t\tget {\n\t\t\t\tif (bisque == null) {\n\t\t\t\t\tbisque = new Pen(Color.Bisque);\n\t\t\t\t\tbisque.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn bisque;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Black {\n\t\t\tget {\n\t\t\t\tif (black == null) {\n\t\t\t\t\tblack = new Pen(Color.Black);\n\t\t\t\t\tblack.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn black;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen BlanchedAlmond {\n\t\t\tget {\n\t\t\t\tif (blanchedalmond == null) {\n\t\t\t\t\tblanchedalmond = new Pen(Color.BlanchedAlmond);\n\t\t\t\t\tblanchedalmond.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn blanchedalmond;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Blue {\n\t\t\tget {\n\t\t\t\tif (blue == null) {\n\t\t\t\t\tblue = new Pen(Color.Blue);\n\t\t\t\t\tblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn blue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen BlueViolet {\n\t\t\tget {\n\t\t\t\tif (blueviolet == null) {\n\t\t\t\t\tblueviolet = new Pen(Color.BlueViolet);\n\t\t\t\t\tblueviolet.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn blueviolet;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Brown {\n\t\t\tget {\n\t\t\t\tif (brown == null) {\n\t\t\t\t\tbrown = new Pen(Color.Brown);\n\t\t\t\t\tbrown.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn brown;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen BurlyWood {\n\t\t\tget {\n\t\t\t\tif (burlywood == null) {\n\t\t\t\t\tburlywood = new Pen(Color.BurlyWood);\n\t\t\t\t\tburlywood.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn burlywood;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen CadetBlue {\n\t\t\tget {\n\t\t\t\tif (cadetblue == null) {\n\t\t\t\t\tcadetblue = new Pen(Color.CadetBlue);\n\t\t\t\t\tcadetblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn cadetblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Chartreuse {\n\t\t\tget {\n\t\t\t\tif (chartreuse == null) {\n\t\t\t\t\tchartreuse = new Pen(Color.Chartreuse);\n\t\t\t\t\tchartreuse.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn chartreuse;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Chocolate {\n\t\t\tget {\n\t\t\t\tif (chocolate == null) {\n\t\t\t\t\tchocolate = new Pen(Color.Chocolate);\n\t\t\t\t\tchocolate.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn chocolate;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Coral {\n\t\t\tget {\n\t\t\t\tif (coral == null) {\n\t\t\t\t\tcoral = new Pen(Color.Coral);\n\t\t\t\t\tcoral.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn coral;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen CornflowerBlue {\n\t\t\tget {\n\t\t\t\tif (cornflowerblue == null) {\n\t\t\t\t\tcornflowerblue = new Pen(Color.CornflowerBlue);\n\t\t\t\t\tcornflowerblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn cornflowerblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Cornsilk {\n\t\t\tget {\n\t\t\t\tif (cornsilk == null) {\n\t\t\t\t\tcornsilk = new Pen(Color.Cornsilk);\n\t\t\t\t\tcornsilk.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn cornsilk;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Crimson {\n\t\t\tget {\n\t\t\t\tif (crimson == null) {\n\t\t\t\t\tcrimson = new Pen(Color.Crimson);\n\t\t\t\t\tcrimson.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn crimson;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Cyan {\n\t\t\tget {\n\t\t\t\tif (cyan == null) {\n\t\t\t\t\tcyan = new Pen(Color.Cyan);\n\t\t\t\t\tcyan.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn cyan;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkBlue {\n\t\t\tget {\n\t\t\t\tif (darkblue == null) {\n\t\t\t\t\tdarkblue = new Pen(Color.DarkBlue);\n\t\t\t\t\tdarkblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkCyan {\n\t\t\tget {\n\t\t\t\tif (darkcyan == null) {\n\t\t\t\t\tdarkcyan = new Pen(Color.DarkCyan);\n\t\t\t\t\tdarkcyan.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkcyan;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkGoldenrod {\n\t\t\tget {\n\t\t\t\tif (darkgoldenrod == null) {\n\t\t\t\t\tdarkgoldenrod = new Pen(Color.DarkGoldenrod);\n\t\t\t\t\tdarkgoldenrod.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkgoldenrod;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkGray {\n\t\t\tget {\n\t\t\t\tif (darkgray == null) {\n\t\t\t\t\tdarkgray = new Pen(Color.DarkGray);\n\t\t\t\t\tdarkgray.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkgray;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkGreen {\n\t\t\tget {\n\t\t\t\tif (darkgreen == null) {\n\t\t\t\t\tdarkgreen = new Pen(Color.DarkGreen);\n\t\t\t\t\tdarkgreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkgreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkKhaki {\n\t\t\tget {\n\t\t\t\tif (darkkhaki == null) {\n\t\t\t\t\tdarkkhaki = new Pen(Color.DarkKhaki);\n\t\t\t\t\tdarkkhaki.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkkhaki;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkMagenta {\n\t\t\tget {\n\t\t\t\tif (darkmagenta == null) {\n\t\t\t\t\tdarkmagenta = new Pen(Color.DarkMagenta);\n\t\t\t\t\tdarkmagenta.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkmagenta;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkOliveGreen {\n\t\t\tget {\n\t\t\t\tif (darkolivegreen == null) {\n\t\t\t\t\tdarkolivegreen = new Pen(Color.DarkOliveGreen);\n\t\t\t\t\tdarkolivegreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkolivegreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkOrange {\n\t\t\tget {\n\t\t\t\tif (darkorange == null) {\n\t\t\t\t\tdarkorange = new Pen(Color.DarkOrange);\n\t\t\t\t\tdarkorange.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkorange;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkOrchid {\n\t\t\tget {\n\t\t\t\tif (darkorchid == null) {\n\t\t\t\t\tdarkorchid = new Pen(Color.DarkOrchid);\n\t\t\t\t\tdarkorchid.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkorchid;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkRed {\n\t\t\tget {\n\t\t\t\tif (darkred == null) {\n\t\t\t\t\tdarkred = new Pen(Color.DarkRed);\n\t\t\t\t\tdarkred.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkred;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkSalmon {\n\t\t\tget {\n\t\t\t\tif (darksalmon == null) {\n\t\t\t\t\tdarksalmon = new Pen(Color.DarkSalmon);\n\t\t\t\t\tdarksalmon.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darksalmon;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkSeaGreen {\n\t\t\tget {\n\t\t\t\tif (darkseagreen == null) {\n\t\t\t\t\tdarkseagreen = new Pen(Color.DarkSeaGreen);\n\t\t\t\t\tdarkseagreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkseagreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkSlateBlue {\n\t\t\tget {\n\t\t\t\tif (darkslateblue == null) {\n\t\t\t\t\tdarkslateblue = new Pen(Color.DarkSlateBlue);\n\t\t\t\t\tdarkslateblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkslateblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkSlateGray {\n\t\t\tget {\n\t\t\t\tif (darkslategray == null) {\n\t\t\t\t\tdarkslategray = new Pen(Color.DarkSlateGray);\n\t\t\t\t\tdarkslategray.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkslategray;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkTurquoise {\n\t\t\tget {\n\t\t\t\tif (darkturquoise == null) {\n\t\t\t\t\tdarkturquoise = new Pen(Color.DarkTurquoise);\n\t\t\t\t\tdarkturquoise.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkturquoise;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DarkViolet {\n\t\t\tget {\n\t\t\t\tif (darkviolet == null) {\n\t\t\t\t\tdarkviolet = new Pen(Color.DarkViolet);\n\t\t\t\t\tdarkviolet.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn darkviolet;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DeepPink {\n\t\t\tget {\n\t\t\t\tif (deeppink == null) {\n\t\t\t\t\tdeeppink = new Pen(Color.DeepPink);\n\t\t\t\t\tdeeppink.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn deeppink;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DeepSkyBlue {\n\t\t\tget {\n\t\t\t\tif (deepskyblue == null) {\n\t\t\t\t\tdeepskyblue = new Pen(Color.DeepSkyBlue);\n\t\t\t\t\tdeepskyblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn deepskyblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DimGray {\n\t\t\tget {\n\t\t\t\tif (dimgray == null) {\n\t\t\t\t\tdimgray = new Pen(Color.DimGray);\n\t\t\t\t\tdimgray.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn dimgray;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen DodgerBlue {\n\t\t\tget {\n\t\t\t\tif (dodgerblue == null) {\n\t\t\t\t\tdodgerblue = new Pen(Color.DodgerBlue);\n\t\t\t\t\tdodgerblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn dodgerblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Firebrick {\n\t\t\tget {\n\t\t\t\tif (firebrick == null) {\n\t\t\t\t\tfirebrick = new Pen(Color.Firebrick);\n\t\t\t\t\tfirebrick.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn firebrick;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen FloralWhite {\n\t\t\tget {\n\t\t\t\tif (floralwhite == null) {\n\t\t\t\t\tfloralwhite = new Pen(Color.FloralWhite);\n\t\t\t\t\tfloralwhite.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn floralwhite;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen ForestGreen {\n\t\t\tget {\n\t\t\t\tif (forestgreen == null) {\n\t\t\t\t\tforestgreen = new Pen(Color.ForestGreen);\n\t\t\t\t\tforestgreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn forestgreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Fuchsia {\n\t\t\tget {\n\t\t\t\tif (fuchsia == null) {\n\t\t\t\t\tfuchsia = new Pen(Color.Fuchsia);\n\t\t\t\t\tfuchsia.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn fuchsia;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Gainsboro {\n\t\t\tget {\n\t\t\t\tif (gainsboro == null) {\n\t\t\t\t\tgainsboro = new Pen(Color.Gainsboro);\n\t\t\t\t\tgainsboro.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn gainsboro;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen GhostWhite {\n\t\t\tget {\n\t\t\t\tif (ghostwhite == null) {\n\t\t\t\t\tghostwhite = new Pen(Color.GhostWhite);\n\t\t\t\t\tghostwhite.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn ghostwhite;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Gold {\n\t\t\tget {\n\t\t\t\tif (gold == null) {\n\t\t\t\t\tgold = new Pen(Color.Gold);\n\t\t\t\t\tgold.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn gold;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Goldenrod {\n\t\t\tget {\n\t\t\t\tif (goldenrod == null) {\n\t\t\t\t\tgoldenrod = new Pen(Color.Goldenrod);\n\t\t\t\t\tgoldenrod.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn goldenrod;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Gray {\n\t\t\tget {\n\t\t\t\tif (gray == null) {\n\t\t\t\t\tgray = new Pen(Color.Gray);\n\t\t\t\t\tgray.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn gray;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Green {\n\t\t\tget {\n\t\t\t\tif (green == null) {\n\t\t\t\t\tgreen = new Pen(Color.Green);\n\t\t\t\t\tgreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn green;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen GreenYellow {\n\t\t\tget {\n\t\t\t\tif (greenyellow == null) {\n\t\t\t\t\tgreenyellow = new Pen(Color.GreenYellow);\n\t\t\t\t\tgreenyellow.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn greenyellow;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Honeydew {\n\t\t\tget {\n\t\t\t\tif (honeydew == null) {\n\t\t\t\t\thoneydew = new Pen(Color.Honeydew);\n\t\t\t\t\thoneydew.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn honeydew;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen HotPink {\n\t\t\tget {\n\t\t\t\tif (hotpink == null) {\n\t\t\t\t\thotpink = new Pen(Color.HotPink);\n\t\t\t\t\thotpink.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn hotpink;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen IndianRed {\n\t\t\tget {\n\t\t\t\tif (indianred == null) {\n\t\t\t\t\tindianred = new Pen(Color.IndianRed);\n\t\t\t\t\tindianred.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn indianred;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Indigo {\n\t\t\tget {\n\t\t\t\tif (indigo == null) {\n\t\t\t\t\tindigo = new Pen(Color.Indigo);\n\t\t\t\t\tindigo.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn indigo;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Ivory {\n\t\t\tget {\n\t\t\t\tif (ivory == null) {\n\t\t\t\t\tivory = new Pen(Color.Ivory);\n\t\t\t\t\tivory.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn ivory;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Khaki {\n\t\t\tget {\n\t\t\t\tif (khaki == null) {\n\t\t\t\t\tkhaki = new Pen(Color.Khaki);\n\t\t\t\t\tkhaki.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn khaki;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Lavender {\n\t\t\tget {\n\t\t\t\tif (lavender == null) {\n\t\t\t\t\tlavender = new Pen(Color.Lavender);\n\t\t\t\t\tlavender.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lavender;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LavenderBlush {\n\t\t\tget {\n\t\t\t\tif (lavenderblush == null) {\n\t\t\t\t\tlavenderblush = new Pen(Color.LavenderBlush);\n\t\t\t\t\tlavenderblush.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lavenderblush;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LawnGreen {\n\t\t\tget {\n\t\t\t\tif (lawngreen == null) {\n\t\t\t\t\tlawngreen = new Pen(Color.LawnGreen);\n\t\t\t\t\tlawngreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lawngreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LemonChiffon {\n\t\t\tget {\n\t\t\t\tif (lemonchiffon == null) {\n\t\t\t\t\tlemonchiffon = new Pen(Color.LemonChiffon);\n\t\t\t\t\tlemonchiffon.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lemonchiffon;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightBlue {\n\t\t\tget {\n\t\t\t\tif (lightblue == null) {\n\t\t\t\t\tlightblue = new Pen(Color.LightBlue);\n\t\t\t\t\tlightblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightCoral {\n\t\t\tget {\n\t\t\t\tif (lightcoral == null) {\n\t\t\t\t\tlightcoral = new Pen(Color.LightCoral);\n\t\t\t\t\tlightcoral.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightcoral;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightCyan {\n\t\t\tget {\n\t\t\t\tif (lightcyan == null) {\n\t\t\t\t\tlightcyan = new Pen(Color.LightCyan);\n\t\t\t\t\tlightcyan.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightcyan;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightGoldenrodYellow {\n\t\t\tget {\n\t\t\t\tif (lightgoldenrodyellow == null) {\n\t\t\t\t\tlightgoldenrodyellow = new Pen(Color.LightGoldenrodYellow);\n\t\t\t\t\tlightgoldenrodyellow.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightgoldenrodyellow;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightGray {\n\t\t\tget {\n\t\t\t\tif (lightgray == null) {\n\t\t\t\t\tlightgray = new Pen(Color.LightGray);\n\t\t\t\t\tlightgray.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightgray;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightGreen {\n\t\t\tget {\n\t\t\t\tif (lightgreen == null) {\n\t\t\t\t\tlightgreen = new Pen(Color.LightGreen);\n\t\t\t\t\tlightgreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightgreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightPink {\n\t\t\tget {\n\t\t\t\tif (lightpink == null) {\n\t\t\t\t\tlightpink = new Pen(Color.LightPink);\n\t\t\t\t\tlightpink.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightpink;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightSalmon {\n\t\t\tget {\n\t\t\t\tif (lightsalmon == null) {\n\t\t\t\t\tlightsalmon = new Pen(Color.LightSalmon);\n\t\t\t\t\tlightsalmon.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightsalmon;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightSeaGreen {\n\t\t\tget {\n\t\t\t\tif (lightseagreen == null) {\n\t\t\t\t\tlightseagreen = new Pen(Color.LightSeaGreen);\n\t\t\t\t\tlightseagreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightseagreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightSkyBlue {\n\t\t\tget {\n\t\t\t\tif (lightskyblue == null) {\n\t\t\t\t\tlightskyblue = new Pen(Color.LightSkyBlue);\n\t\t\t\t\tlightskyblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightskyblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightSlateGray {\n\t\t\tget {\n\t\t\t\tif (lightslategray == null) {\n\t\t\t\t\tlightslategray = new Pen(Color.LightSlateGray);\n\t\t\t\t\tlightslategray.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightslategray;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightSteelBlue {\n\t\t\tget {\n\t\t\t\tif (lightsteelblue == null) {\n\t\t\t\t\tlightsteelblue = new Pen(Color.LightSteelBlue);\n\t\t\t\t\tlightsteelblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightsteelblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LightYellow {\n\t\t\tget {\n\t\t\t\tif (lightyellow == null) {\n\t\t\t\t\tlightyellow = new Pen(Color.LightYellow);\n\t\t\t\t\tlightyellow.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lightyellow;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Lime {\n\t\t\tget {\n\t\t\t\tif (lime == null) {\n\t\t\t\t\tlime = new Pen(Color.Lime);\n\t\t\t\t\tlime.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn lime;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen LimeGreen {\n\t\t\tget {\n\t\t\t\tif (limegreen == null) {\n\t\t\t\t\tlimegreen = new Pen(Color.LimeGreen);\n\t\t\t\t\tlimegreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn limegreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Linen {\n\t\t\tget {\n\t\t\t\tif (linen == null) {\n\t\t\t\t\tlinen = new Pen(Color.Linen);\n\t\t\t\t\tlinen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn linen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Magenta {\n\t\t\tget {\n\t\t\t\tif (magenta == null) {\n\t\t\t\t\tmagenta = new Pen(Color.Magenta);\n\t\t\t\t\tmagenta.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn magenta;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Maroon {\n\t\t\tget {\n\t\t\t\tif (maroon == null) {\n\t\t\t\t\tmaroon = new Pen(Color.Maroon);\n\t\t\t\t\tmaroon.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn maroon;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MediumAquamarine {\n\t\t\tget {\n\t\t\t\tif (mediumaquamarine == null) {\n\t\t\t\t\tmediumaquamarine = new Pen(Color.MediumAquamarine);\n\t\t\t\t\tmediumaquamarine.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mediumaquamarine;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MediumBlue {\n\t\t\tget {\n\t\t\t\tif (mediumblue == null) {\n\t\t\t\t\tmediumblue = new Pen(Color.MediumBlue);\n\t\t\t\t\tmediumblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mediumblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MediumOrchid {\n\t\t\tget {\n\t\t\t\tif (mediumorchid == null) {\n\t\t\t\t\tmediumorchid = new Pen(Color.MediumOrchid);\n\t\t\t\t\tmediumorchid.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mediumorchid;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MediumPurple {\n\t\t\tget {\n\t\t\t\tif (mediumpurple == null) {\n\t\t\t\t\tmediumpurple = new Pen(Color.MediumPurple);\n\t\t\t\t\tmediumpurple.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mediumpurple;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MediumSeaGreen {\n\t\t\tget {\n\t\t\t\tif (mediumseagreen == null) {\n\t\t\t\t\tmediumseagreen = new Pen(Color.MediumSeaGreen);\n\t\t\t\t\tmediumseagreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mediumseagreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MediumSlateBlue {\n\t\t\tget {\n\t\t\t\tif (mediumslateblue == null) {\n\t\t\t\t\tmediumslateblue = new Pen(Color.MediumSlateBlue);\n\t\t\t\t\tmediumslateblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mediumslateblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MediumSpringGreen {\n\t\t\tget {\n\t\t\t\tif (mediumspringgreen == null) {\n\t\t\t\t\tmediumspringgreen = new Pen(Color.MediumSpringGreen);\n\t\t\t\t\tmediumspringgreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mediumspringgreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MediumTurquoise {\n\t\t\tget {\n\t\t\t\tif (mediumturquoise == null) {\n\t\t\t\t\tmediumturquoise = new Pen(Color.MediumTurquoise);\n\t\t\t\t\tmediumturquoise.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mediumturquoise;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MediumVioletRed {\n\t\t\tget {\n\t\t\t\tif (mediumvioletred == null) {\n\t\t\t\t\tmediumvioletred = new Pen(Color.MediumVioletRed);\n\t\t\t\t\tmediumvioletred.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mediumvioletred;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MidnightBlue {\n\t\t\tget {\n\t\t\t\tif (midnightblue == null) {\n\t\t\t\t\tmidnightblue = new Pen(Color.MidnightBlue);\n\t\t\t\t\tmidnightblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn midnightblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MintCream {\n\t\t\tget {\n\t\t\t\tif (mintcream == null) {\n\t\t\t\t\tmintcream = new Pen(Color.MintCream);\n\t\t\t\t\tmintcream.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mintcream;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen MistyRose {\n\t\t\tget {\n\t\t\t\tif (mistyrose == null) {\n\t\t\t\t\tmistyrose = new Pen(Color.MistyRose);\n\t\t\t\t\tmistyrose.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn mistyrose;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Moccasin {\n\t\t\tget {\n\t\t\t\tif (moccasin == null) {\n\t\t\t\t\tmoccasin = new Pen(Color.Moccasin);\n\t\t\t\t\tmoccasin.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn moccasin;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen NavajoWhite {\n\t\t\tget {\n\t\t\t\tif (navajowhite == null) {\n\t\t\t\t\tnavajowhite = new Pen(Color.NavajoWhite);\n\t\t\t\t\tnavajowhite.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn navajowhite;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Navy {\n\t\t\tget {\n\t\t\t\tif (navy == null) {\n\t\t\t\t\tnavy = new Pen(Color.Navy);\n\t\t\t\t\tnavy.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn navy;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen OldLace {\n\t\t\tget {\n\t\t\t\tif (oldlace == null) {\n\t\t\t\t\toldlace = new Pen(Color.OldLace);\n\t\t\t\t\toldlace.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn oldlace;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Olive {\n\t\t\tget {\n\t\t\t\tif (olive == null) {\n\t\t\t\t\tolive = new Pen(Color.Olive);\n\t\t\t\t\tolive.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn olive;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen OliveDrab {\n\t\t\tget {\n\t\t\t\tif (olivedrab == null) {\n\t\t\t\t\tolivedrab = new Pen(Color.OliveDrab);\n\t\t\t\t\tolivedrab.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn olivedrab;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Orange {\n\t\t\tget {\n\t\t\t\tif (orange == null) {\n\t\t\t\t\torange = new Pen(Color.Orange);\n\t\t\t\t\torange.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn orange;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen OrangeRed {\n\t\t\tget {\n\t\t\t\tif (orangered == null) {\n\t\t\t\t\torangered = new Pen(Color.OrangeRed);\n\t\t\t\t\torangered.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn orangered;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Orchid {\n\t\t\tget {\n\t\t\t\tif (orchid == null) {\n\t\t\t\t\torchid = new Pen(Color.Orchid);\n\t\t\t\t\torchid.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn orchid;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen PaleGoldenrod {\n\t\t\tget {\n\t\t\t\tif (palegoldenrod == null) {\n\t\t\t\t\tpalegoldenrod = new Pen(Color.PaleGoldenrod);\n\t\t\t\t\tpalegoldenrod.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn palegoldenrod;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen PaleGreen {\n\t\t\tget {\n\t\t\t\tif (palegreen == null) {\n\t\t\t\t\tpalegreen = new Pen(Color.PaleGreen);\n\t\t\t\t\tpalegreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn palegreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen PaleTurquoise {\n\t\t\tget {\n\t\t\t\tif (paleturquoise == null) {\n\t\t\t\t\tpaleturquoise = new Pen(Color.PaleTurquoise);\n\t\t\t\t\tpaleturquoise.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn paleturquoise;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen PaleVioletRed {\n\t\t\tget {\n\t\t\t\tif (palevioletred == null) {\n\t\t\t\t\tpalevioletred = new Pen(Color.PaleVioletRed);\n\t\t\t\t\tpalevioletred.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn palevioletred;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen PapayaWhip {\n\t\t\tget {\n\t\t\t\tif (papayawhip == null) {\n\t\t\t\t\tpapayawhip = new Pen(Color.PapayaWhip);\n\t\t\t\t\tpapayawhip.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn papayawhip;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen PeachPuff {\n\t\t\tget {\n\t\t\t\tif (peachpuff == null) {\n\t\t\t\t\tpeachpuff = new Pen(Color.PeachPuff);\n\t\t\t\t\tpeachpuff.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn peachpuff;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Peru {\n\t\t\tget {\n\t\t\t\tif (peru == null) {\n\t\t\t\t\tperu = new Pen(Color.Peru);\n\t\t\t\t\tperu.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn peru;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Pink {\n\t\t\tget {\n\t\t\t\tif (pink == null) {\n\t\t\t\t\tpink = new Pen(Color.Pink);\n\t\t\t\t\tpink.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn pink;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Plum {\n\t\t\tget {\n\t\t\t\tif (plum == null) {\n\t\t\t\t\tplum = new Pen(Color.Plum);\n\t\t\t\t\tplum.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn plum;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen PowderBlue {\n\t\t\tget {\n\t\t\t\tif (powderblue == null) {\n\t\t\t\t\tpowderblue = new Pen(Color.PowderBlue);\n\t\t\t\t\tpowderblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn powderblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Purple {\n\t\t\tget {\n\t\t\t\tif (purple == null) {\n\t\t\t\t\tpurple = new Pen(Color.Purple);\n\t\t\t\t\tpurple.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn purple;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Red {\n\t\t\tget {\n\t\t\t\tif (red == null) {\n\t\t\t\t\tred = new Pen(Color.Red);\n\t\t\t\t\tred.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn red;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen RosyBrown {\n\t\t\tget {\n\t\t\t\tif (rosybrown == null) {\n\t\t\t\t\trosybrown = new Pen(Color.RosyBrown);\n\t\t\t\t\trosybrown.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn rosybrown;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen RoyalBlue {\n\t\t\tget {\n\t\t\t\tif (royalblue == null) {\n\t\t\t\t\troyalblue = new Pen(Color.RoyalBlue);\n\t\t\t\t\troyalblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn royalblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen SaddleBrown {\n\t\t\tget {\n\t\t\t\tif (saddlebrown == null) {\n\t\t\t\t\tsaddlebrown = new Pen(Color.SaddleBrown);\n\t\t\t\t\tsaddlebrown.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn saddlebrown;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Salmon {\n\t\t\tget {\n\t\t\t\tif (salmon == null) {\n\t\t\t\t\tsalmon = new Pen(Color.Salmon);\n\t\t\t\t\tsalmon.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn salmon;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen SandyBrown {\n\t\t\tget {\n\t\t\t\tif (sandybrown == null) {\n\t\t\t\t\tsandybrown = new Pen(Color.SandyBrown);\n\t\t\t\t\tsandybrown.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn sandybrown;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen SeaGreen {\n\t\t\tget {\n\t\t\t\tif (seagreen == null) {\n\t\t\t\t\tseagreen = new Pen(Color.SeaGreen);\n\t\t\t\t\tseagreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn seagreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen SeaShell {\n\t\t\tget {\n\t\t\t\tif (seashell == null) {\n\t\t\t\t\tseashell = new Pen(Color.SeaShell);\n\t\t\t\t\tseashell.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn seashell;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Sienna {\n\t\t\tget {\n\t\t\t\tif (sienna == null) {\n\t\t\t\t\tsienna = new Pen(Color.Sienna);\n\t\t\t\t\tsienna.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn sienna;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Silver {\n\t\t\tget {\n\t\t\t\tif (silver == null) {\n\t\t\t\t\tsilver = new Pen(Color.Silver);\n\t\t\t\t\tsilver.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn silver;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen SkyBlue {\n\t\t\tget {\n\t\t\t\tif (skyblue == null) {\n\t\t\t\t\tskyblue = new Pen(Color.SkyBlue);\n\t\t\t\t\tskyblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn skyblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen SlateBlue {\n\t\t\tget {\n\t\t\t\tif (slateblue == null) {\n\t\t\t\t\tslateblue = new Pen(Color.SlateBlue);\n\t\t\t\t\tslateblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn slateblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen SlateGray {\n\t\t\tget {\n\t\t\t\tif (slategray == null) {\n\t\t\t\t\tslategray = new Pen(Color.SlateGray);\n\t\t\t\t\tslategray.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn slategray;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Snow {\n\t\t\tget {\n\t\t\t\tif (snow == null) {\n\t\t\t\t\tsnow = new Pen(Color.Snow);\n\t\t\t\t\tsnow.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn snow;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen SpringGreen {\n\t\t\tget {\n\t\t\t\tif (springgreen == null) {\n\t\t\t\t\tspringgreen = new Pen(Color.SpringGreen);\n\t\t\t\t\tspringgreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn springgreen;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen SteelBlue {\n\t\t\tget {\n\t\t\t\tif (steelblue == null) {\n\t\t\t\t\tsteelblue = new Pen(Color.SteelBlue);\n\t\t\t\t\tsteelblue.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn steelblue;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Tan {\n\t\t\tget {\n\t\t\t\tif (tan == null) {\n\t\t\t\t\ttan = new Pen(Color.Tan);\n\t\t\t\t\ttan.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn tan;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Teal {\n\t\t\tget {\n\t\t\t\tif (teal == null) {\n\t\t\t\t\tteal = new Pen(Color.Teal);\n\t\t\t\t\tteal.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn teal;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Thistle {\n\t\t\tget {\n\t\t\t\tif (thistle == null) {\n\t\t\t\t\tthistle = new Pen(Color.Thistle);\n\t\t\t\t\tthistle.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn thistle;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Tomato {\n\t\t\tget {\n\t\t\t\tif (tomato == null) {\n\t\t\t\t\ttomato = new Pen(Color.Tomato);\n\t\t\t\t\ttomato.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn tomato;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Transparent {\n\t\t\tget {\n\t\t\t\tif (transparent == null) {\n\t\t\t\t\ttransparent = new Pen(Color.Transparent);\n\t\t\t\t\ttransparent.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn transparent;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Turquoise {\n\t\t\tget {\n\t\t\t\tif (turquoise == null) {\n\t\t\t\t\tturquoise = new Pen(Color.Turquoise);\n\t\t\t\t\tturquoise.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn turquoise;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Violet {\n\t\t\tget {\n\t\t\t\tif (violet == null) {\n\t\t\t\t\tviolet = new Pen(Color.Violet);\n\t\t\t\t\tviolet.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn violet;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Wheat {\n\t\t\tget {\n\t\t\t\tif (wheat == null) {\n\t\t\t\t\twheat = new Pen(Color.Wheat);\n\t\t\t\t\twheat.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn wheat;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen White {\n\t\t\tget {\n\t\t\t\tif (white == null) {\n\t\t\t\t\twhite = new Pen(Color.White);\n\t\t\t\t\twhite.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn white;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen WhiteSmoke {\n\t\t\tget {\n\t\t\t\tif (whitesmoke == null) {\n\t\t\t\t\twhitesmoke = new Pen(Color.WhiteSmoke);\n\t\t\t\t\twhitesmoke.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn whitesmoke;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen Yellow {\n\t\t\tget {\n\t\t\t\tif (yellow == null) {\n\t\t\t\t\tyellow = new Pen(Color.Yellow);\n\t\t\t\t\tyellow.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn yellow;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Pen YellowGreen {\n\t\t\tget {\n\t\t\t\tif (yellowgreen == null) {\n\t\t\t\t\tyellowgreen = new Pen(Color.YellowGreen);\n\t\t\t\t\tyellowgreen.canChange = false;\n\t\t\t\t}\n\t\t\t\treturn yellowgreen;\n\n\t\t\t}\n\t\t}\n\t\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Point.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic struct Point {\n\n\t\tpublic static readonly Point Empty = new Point();\n\n\t\tprivate int x, y;\n\n\t\tpublic Point(int dw) {\n\t\t\tthis.x = dw >> 16;\n\t\t\tthis.y = dw & 0xffff;\n\t\t}\n\n\t\tpublic Point(int x, int y) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}\n\n\t\tpublic Point(Size sz) {\n\t\t\tthis.x = sz.Width;\n\t\t\tthis.y = sz.Height;\n\t\t}\n\n\t\tpublic int X {\n\t\t\tget {\n\t\t\t\treturn this.x;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.x = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Y {\n\t\t\tget {\n\t\t\t\treturn this.y;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.y = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn this.x == 0 && this.y == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Offset(int dx, int dy) {\n\t\t\tthis.x += dx;\n\t\t\tthis.y += dy;\n\t\t}\n\n\t\tpublic void Offset(Point pt) {\n\t\t\tthis.x += pt.x;\n\t\t\tthis.y += pt.y;\n\t\t}\n\n\t\tpublic static Point Add(Point pt, Size sz) {\n\t\t\treturn new Point(pt.x + sz.Width, pt.y + sz.Height);\n\t\t}\n\n\t\tpublic static Point Subtract(Point pt, Size sz) {\n\t\t\treturn new Point(pt.x - sz.Width, pt.y - sz.Height);\n\t\t}\n\n\t\tpublic static Point operator +(Point pt, Size sz) {\n\t\t\treturn new Point(pt.x + sz.Width, pt.y + sz.Height);\n\t\t}\n\n\t\tpublic static Point operator -(Point pt, Size sz) {\n\t\t\treturn new Point(pt.x - sz.Width, pt.y - sz.Height);\n\t\t}\n\n\t\tpublic static bool operator ==(Point a, Point b) {\n\t\t\treturn ((a.x == b.x) && (a.y == b.y));\n\t\t}\n\n\t\tpublic static bool operator !=(Point a, Point b) {\n\t\t\treturn ((a.x != b.x) || (a.y != b.y));\n\t\t}\n\n\t\tpublic static explicit operator Size(Point pt) {\n\t\t\treturn new Size(pt.x, pt.x);\n\t\t}\n\n\t\tpublic override bool Equals(object o) {\n\t\t\tif (!(o is Point)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn this == (Point)o;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn x ^ y;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn string.Format(\"{{X={0},Y={1}}}\", x, y);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/PointF.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic struct PointF {\n\n\t\tprivate float x, y;\n\n\t\tpublic static readonly PointF Empty;\n\n\t\tpublic PointF(float x, float y) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}\n\n\t\tpublic float X {\n\t\t\tget {\n\t\t\t\treturn this.x;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.x = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Y {\n\t\t\tget {\n\t\t\t\treturn this.y;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.y = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn this.x == 0.0f && this.y == 0.0f;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(PointF a, PointF b) {\n\t\t\treturn a.x == b.x && a.y == b.y;\n\t\t}\n\n\t\tpublic static bool operator !=(PointF a, PointF b) {\n\t\t\treturn a.x != b.x || a.y != b.y;\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\treturn obj is PointF && (PointF)obj == this;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.x ^ (int)this.y;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn String.Format(\"{{X={0}, Y={1}}}\", this.x, this.y);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Rectangle.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic struct Rectangle {\n\n\t\tpublic static readonly Rectangle Empty = new Rectangle();\n\n\t\tpublic static Rectangle FromLTRB(int left, int top, int right, int bottom) {\n\t\t\treturn new Rectangle(left, top, right - left, bottom - top);\n\t\t}\n\n\t\tpublic static Rectangle Inflate(Rectangle rect, int x, int y) {\n\t\t\tRectangle r = new Rectangle(rect.Location, rect.Size);\n\t\t\tr.Inflate(x, y);\n\t\t\treturn r;\n\t\t}\n\n\t\tprivate int x, y, width, height;\n\n\t\tpublic Rectangle(int x, int y, int width, int height) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t}\n\n\t\tpublic Rectangle(Point loc, Size sz) {\n\t\t\tthis.x = loc.X;\n\t\t\tthis.y = loc.Y;\n\t\t\tthis.width = sz.Width;\n\t\t\tthis.height = sz.Height;\n\t\t}\n\n\t\tpublic int X {\n\t\t\tget {\n\t\t\t\treturn this.x;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.x = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Y {\n\t\t\tget {\n\t\t\t\treturn this.y;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.y = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Width {\n\t\t\tget {\n\t\t\t\treturn this.width;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.width = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Height {\n\t\t\tget {\n\t\t\t\treturn this.height;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.height = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Left {\n\t\t\tget {\n\t\t\t\treturn this.x;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Right {\n\t\t\tget {\n\t\t\t\treturn this.x + this.width;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Top {\n\t\t\tget {\n\t\t\t\treturn this.y;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Bottom {\n\t\t\tget {\n\t\t\t\treturn this.y + this.height;\n\t\t\t}\n\t\t}\n\n\t\tpublic Point Location {\n\t\t\tget {\n\t\t\t\treturn new Point(this.x, this.y);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.x = value.X;\n\t\t\t\tthis.y = value.Y;\n\t\t\t}\n\t\t}\n\n\t\tpublic Size Size {\n\t\t\tget {\n\t\t\t\treturn new Size(this.width, this.height);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.width = value.Width;\n\t\t\t\tthis.height = value.Height;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Inflate(int width, int height) {\n\t\t\tthis.x -= width;\n\t\t\tthis.y -= height;\n\t\t\tthis.width += width * 2;\n\t\t\tthis.height += height * 2;\n\t\t}\n\n\n\t\tpublic void Inflate(Size sz) {\n\t\t\tInflate(sz.Width, sz.Height);\n\t\t}\n\n\t\tpublic void Offset(Point pt) {\n\t\t\tthis.x += pt.X;\n\t\t\tthis.y += pt.Y;\n\t\t}\n\n\t\tpublic void Offset(int dx, int dy) {\n\t\t\tthis.x += dx;\n\t\t\tthis.y += dy;\n\t\t}\n\n\t\tpublic bool Contains(int x, int y) {\n\t\t\treturn (x >= Left) && (x < Right) && (y >= Top) && (y < Bottom);\n\t\t}\n\n\t\tpublic bool Contains(Point pt) {\n\t\t\treturn Contains(pt.X, pt.Y);\n\t\t}\n\n\t\tpublic bool Contains(Rectangle rect) {\n\t\t\treturn rect == Intersect(this, rect);\n\t\t}\n\n\t\tpublic bool IntersectsWith(Rectangle r) {\n\t\t\treturn !((Left >= r.Right) || (Right <= r.Left) || (Top >= r.Bottom) || (Bottom <= r.Top));\n\t\t}\n\n\t\tprivate bool IntersectsWithInclusive(Rectangle r) {\n\t\t\treturn !((Left > r.Right) || (Right < r.Left) || (Top > r.Bottom) || (Bottom < r.Top));\n\t\t}\n\n\t\tpublic void Intersect(Rectangle r) {\n\t\t\tthis = Rectangle.Intersect(this, r);\n\t\t}\n\n\t\tpublic static Rectangle Intersect(Rectangle r1, Rectangle r2) {\n\t\t\t// MS.NET returns a non-empty rectangle if the two rectangles\n\t\t\t// touch each other\n\t\t\tif (!r1.IntersectsWithInclusive(r2)) {\n\t\t\t\treturn Empty;\n\t\t\t}\n\n\t\t\treturn Rectangle.FromLTRB(\n\t\t\t\tMath.Max(r1.x, r2.x),\n\t\t\t\tMath.Max(r1.y, r2.y),\n\t\t\t\tMath.Min(r1.Right, r2.Right),\n\t\t\t\tMath.Min(r1.Bottom, r2.Bottom));\n\t\t}\n\n\t\tpublic static bool operator ==(Rectangle r1, Rectangle r2) {\n\t\t\treturn ((r1.Location == r2.Location) && (r1.Size == r2.Size));\n\t\t}\n\n\t\tpublic static bool operator !=(Rectangle r1, Rectangle r2) {\n\t\t\treturn ((r1.Location != r2.Location) || (r1.Size != r2.Size));\n\t\t}\n\n\t\tpublic override bool Equals(object o) {\n\t\t\tif (!(o is Rectangle)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn this == (Rectangle)o;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn ((this.height + this.width) ^ this.x) + this.y;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn String.Format(\"{{X={0},Y={1},Width={2},Height={3}}}\", this.x, this.y, this.width, this.height);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/RectangleF.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic struct RectangleF {\n\t\n\t\tprivate float x, y, width, height;\n\n\t\tpublic static readonly RectangleF Empty;\n\n\t\tpublic RectangleF(PointF location, SizeF size) {\n\t\t\tthis.x = location.X;\n\t\t\tthis.y = location.Y;\n\t\t\tthis.width = size.Width;\n\t\t\tthis.height = size.Height;\n\t\t}\n\n\t\tpublic RectangleF(float x, float y, float width, float height) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t}\n\n\t\tpublic float X {\n\t\t\tget {\n\t\t\t\treturn this.x;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.x = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Y {\n\t\t\tget {\n\t\t\t\treturn this.y;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.y = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Width {\n\t\t\tget {\n\t\t\t\treturn this.width;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.width = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Height {\n\t\t\tget {\n\t\t\t\treturn this.height;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.height = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Left {\n\t\t\tget {\n\t\t\t\treturn this.x;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Right {\n\t\t\tget {\n\t\t\t\treturn this.x + this.width;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Top {\n\t\t\tget {\n\t\t\t\treturn this.y;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Bottom {\n\t\t\tget {\n\t\t\t\treturn this.y + this.height;\n\t\t\t}\n\t\t}\n\n\t\tpublic static implicit operator RectangleF(Rectangle r) {\n\t\t\treturn new RectangleF(r.X, r.Y, r.Width, r.Height);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Region.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic sealed class Region : MarshalByRefObject, IDisposable {\n\n\t\tinternal IntPtr native = IntPtr.Zero;\n\t\tprivate bool isInfinite;\n\n\t\tpublic Region() {\n\t\t\tthis.native = LibIGraph.CreateRegion_Infinite();\n\t\t\tthis.isInfinite = true;\n\t\t}\n\n\t\tpublic Region(Rectangle rect) {\n\t\t\tthis.native = LibIGraph.CreateRegion_Rect(rect.X, rect.Y, rect.Width, rect.Height);\n\t\t\tthis.isInfinite = false;\n\t\t}\n\n\t\t~Region() {\n\t\t\tthis.Dispose();\n\t\t}\n\n\t\tpublic void Dispose() {\n\t\t\tif (this.native != null) {\n\t\t\t\tLibIGraph.DisposeRegion(this.native);\n\t\t\t\tthis.native = IntPtr.Zero;\n\t\t\t\tGC.SuppressFinalize(this);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsInfinite(Graphics g) {\n\t\t\treturn this.isInfinite;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/Size.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic struct Size {\n\n\t\tpublic static readonly Size Empty = new Size();\n\n\t\tprivate int width, height;\n\n\t\tpublic Size(int width, int height) {\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t}\n\n\t\tpublic Size(Point pt) {\n\t\t\tthis.width = pt.X;\n\t\t\tthis.height = pt.Y;\n\t\t}\n\n\t\tpublic int Width {\n\t\t\tget {\n\t\t\t\treturn this.width;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.width = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Height {\n\t\t\tget {\n\t\t\t\treturn this.height;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.height = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn this.width == 0 && this.height == 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Size Add(Size a, Size b) {\n\t\t\treturn new Size(a.Width + b.Width, a.Height + b.Height);\n\t\t}\n\n\t\tpublic static Size Subtract(Size a, Size b) {\n\t\t\treturn new Size(a.Width - b.Width, a.Height - b.Height);\n\t\t}\n\n\t\tpublic static Size operator +(Size a, Size b) {\n\t\t\treturn new Size(a.Width + b.Width, a.Height + b.Height);\n\t\t}\n\n\t\tpublic static Size operator -(Size a, Size b) {\n\t\t\treturn new Size(a.Width - b.Width, a.Height - b.Height);\n\t\t}\n\n\t\tpublic static bool operator ==(Size a, Size b) {\n\t\t\treturn ((a.Width == b.Width) && (a.Height == b.Height));\n\t\t}\n\n\t\tpublic static bool operator !=(Size a, Size b) {\n\t\t\treturn ((a.Width != b.Width) || (a.Height != b.Height));\n\t\t}\n\n\t\tpublic static explicit operator Point(Size sz) {\n\t\t\treturn new Point(sz.Width, sz.Height);\n\t\t}\n\n\t\tpublic override bool Equals(object o) {\n\t\t\tif (!(o is Size)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn this == (Size)o;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn width ^ height;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn String.Format(\"{{Width={0}, Height={1}}}\", width, height);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/SizeF.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic struct SizeF {\n\n\t\tprivate float width, height;\n\n\t\tpublic static readonly SizeF Empty;\n\n\t\tpublic SizeF(PointF pt) {\n\t\t\tthis.width = pt.X;\n\t\t\tthis.height = pt.Y;\n\t\t}\n\n\t\tpublic SizeF(SizeF size) {\n\t\t\tthis.width = size.width;\n\t\t\tthis.height = size.height;\n\t\t}\n\n\t\tpublic SizeF(float width, float height) {\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t}\n\n\t\tpublic float Width {\n\t\t\tget {\n\t\t\t\treturn this.width;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.width = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic float Height {\n\t\t\tget {\n\t\t\t\treturn this.height;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.height = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsEmpty {\n\t\t\tget {\n\t\t\t\treturn this.width == 0.0f && this.height == 0.0f;\n\t\t\t}\n\t\t}\n\n\t\tpublic static bool operator ==(SizeF a, SizeF b) {\n\t\t\treturn a.width == b.width && a.height == b.height;\n\t\t}\n\n\t\tpublic static bool operator !=(SizeF a, SizeF b) {\n\t\t\treturn a.width != b.width || a.height != b.height;\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\treturn obj is SizeF && (SizeF)obj == this;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.width ^ (int)this.height;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn string.Format(\"{{Width={0}, Height={1}}}\", width, height);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/SolidBrush.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic sealed class SolidBrush : Brush {\n\n\t\tprivate Color col;\n\t\tinternal bool canChange = true;\n\n\t\tpublic SolidBrush(Color col) {\n\t\t\tthis.col = col;\n\t\t\tbase.native = LibIGraph.CreateBrush_Solid(col.ToArgb());\n\t\t}\n\n\t\tpublic Color Color {\n\t\t\tget {\n\t\t\t\treturn this.col;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (canChange) {\n\t\t\t\t\tthis.col = value;\n\t\t\t\t\tLibIGraph.SolidBrush_SetCol(base.native, value.ToArgb());\n\t\t\t\t} else {\n\t\t\t\t\tthrow new ArgumentException(\"This SolidBrush cannot be changed.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprotected override void Dispose(bool disposing) {\n\t\t\tif (disposing && !this.canChange) {\n\t\t\t\t// If this is a system brush, then refuse to dispose of it.\n\t\t\t\tthrow new ArgumentException(\"This SolidBrush cannot be changed.\");\n\t\t\t}\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/StringAlignment.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic enum StringAlignment {\n\t\tNear = 0,\n\t\tCenter = 1,\n\t\tFar = 2\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/StringFormat.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic sealed class StringFormat : MarshalByRefObject, IDisposable, ICloneable {\n\n\t\tinternal IntPtr native = IntPtr.Zero;\n\n\t\tprivate static StringFormat genericDefault = null;\n\t\tprivate static StringFormat genericTypographic = null;\n\n\t\tprivate StringTrimming trimming;\n\t\tprivate StringAlignment alignment;\n\t\tprivate StringAlignment lineAlignment;\n\t\tprivate StringFormatFlags stringFormatFlags;\n\n\t\tpublic StringFormat() : this(0) { }\n\n\t\tpublic StringFormat(StringFormatFlags options) {\n\t\t\tthis.native = LibIGraph.CreateStringFormat\n\t\t\t\t(StringAlignment.Near, options, StringAlignment.Near, StringTrimming.None);\n\t\t\tthis.trimming = StringTrimming.None;\n\t\t\tthis.alignment = StringAlignment.Near;\n\t\t\tthis.lineAlignment = StringAlignment.Near;\n\t\t\tthis.stringFormatFlags = options;\n\t\t}\n\n\t\t~StringFormat() {\n\t\t\tthis.Dispose();\n\t\t}\n\n\t\tpublic StringTrimming Trimming {\n\t\t\tget {\n\t\t\t\treturn this.trimming;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tLibIGraph.StringFormat_SetTrimming(this.native, value);\n\t\t\t\tthis.trimming = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic StringAlignment Alignment {\n\t\t\tget {\n\t\t\t\treturn this.alignment;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tLibIGraph.StringFormat_SetAlignment(this.native, value);\n\t\t\t\tthis.alignment = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic StringAlignment LineAlignment {\n\t\t\tget {\n\t\t\t\treturn this.lineAlignment;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tLibIGraph.StringFormat_SetLineAlignment(this.native, value);\n\t\t\t\tthis.lineAlignment = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic StringFormatFlags FormatFlags {\n\t\t\tget {\n\t\t\t\treturn this.stringFormatFlags;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tLibIGraph.StringFormat_SetFormatFlags(this.native, value);\n\t\t\t\tthis.stringFormatFlags = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic static StringFormat GenericDefault {\n\t\t\tget {\n\t\t\t\tif (genericDefault == null) {\n\t\t\t\t\tgenericDefault = new StringFormat();\n\t\t\t\t\tgenericDefault.Trimming = StringTrimming.Character;\n\t\t\t\t}\n\t\t\t\treturn genericDefault;\n\t\t\t}\n\t\t}\n\n\t\tpublic static StringFormat GenericTypographic {\n\t\t\tget {\n\t\t\t\tif (genericTypographic == null) {\n\t\t\t\t\tgenericTypographic = new StringFormat\n\t\t\t\t\t\t(StringFormatFlags.NoClip | StringFormatFlags.FitBlackBox | StringFormatFlags.LineLimit);\n\t\t\t\t}\n\t\t\t\treturn genericTypographic;\n\t\t\t}\n\t\t}\n\n\t\tpublic object Clone() {\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\tpublic void Dispose() {\n\t\t\tif (this.native != IntPtr.Zero) {\n\t\t\t\tLibIGraph.DisposeStringFormat(this.native);\n\t\t\t\tthis.native = IntPtr.Zero;\n\t\t\t\tGC.SuppressFinalize(this);\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/StringFormatFlags.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic enum StringFormatFlags {\n\t\tDirectionRightToLeft = 0x0001,\n\t\tDirectionVertical = 0x0002,\n\t\tFitBlackBox = 0x0004,\n\t\tDisplayFormatControl = 0x0020,\n\t\tNoFontFallback = 0x0400,\n\t\tMeasureTrailingSpaces = 0x0800,\n\t\tNoWrap = 0x1000,\n\t\tLineLimit = 0x2000,\n\t\tNoClip = 0x4000\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing/StringTrimming.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing {\n\tpublic enum StringTrimming {\n\t\tNone = 0,\n\t\tCharacter = 1,\n\t\tWord = 2,\n\t\tEllipsisCharacter = 3,\n\t\tEllipsisWord = 4,\n\t\tEllipsisPath = 5\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing.Drawing2D/HatchBrush.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing.Drawing2D {\n\tpublic sealed class HatchBrush : Brush {\n\n\t\tpublic HatchBrush(HatchStyle hatchStyle, Color foreColor, Color backColor) {\n\t\t\tthis.hatchStyle = hatchStyle;\n\t\t\tthis.foreCol = foreColor;\n\t\t\tthis.backCol = backColor;\n\t\t\tbase.native = LibIGraph.CreateBrush_Hatch(hatchStyle, foreCol.ToArgb(), backCol.ToArgb());\n\t\t}\n\n\t\tpublic HatchBrush(HatchStyle hatchStyle, Color foreColor) : this(hatchStyle, foreColor, Color.Black) { }\n\n\t\tprivate HatchStyle hatchStyle;\n\t\tprivate Color foreCol, backCol;\n\n\t\tpublic HatchStyle HatchStyle {\n\t\t\tget {\n\t\t\t\treturn this.hatchStyle;\n\t\t\t}\n\t\t}\n\n\t\tpublic Color ForegroundColor {\n\t\t\tget {\n\t\t\t\treturn this.foreCol;\n\t\t\t}\n\t\t}\n\n\t\tpublic Color BackgroundColor {\n\t\t\tget {\n\t\t\t\treturn this.backCol;\n\t\t\t}\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing.Drawing2D/HatchStyle.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing.Drawing2D {\n\tpublic enum HatchStyle {\n\t\tBackwardDiagonal = 3,\n\t\tCross = LargeGrid,\n\t\tDarkDownwardDiagonal = 20,\n\t\tDarkHorizontal = 29,\n\t\tDarkUpwardDiagonal = 21,\n\t\tDarkVertical = 28,\n\t\tDashedDownwardDiagonal = 30,\n\t\tDashedHorizontal = 32,\n\t\tDashedUpwardDiagonal = 31,\n\t\tDashedVertical = 33,\n\t\tDiagonalBrick = 38,\n\t\tDiagonalCross = 5,\n\t\tDivot = 42,\n\t\tDottedDiamond = 44,\n\t\tDottedGrid = 43,\n\t\tForwardDiagonal = 2,\n\t\tHorizontal = 0,\n\t\tHorizontalBrick = 39,\n\t\tLargeCheckerBoard = 50,\n\t\tLargeConfetti = 35,\n\t\tLargeGrid = 4,\n\t\tLightDownwardDiagonal = 18,\n\t\tLightHorizontal = 25,\n\t\tLightUpwardDiagonal = 19,\n\t\tLightVertical = 24,\n\t\tMax = 4,\n\t\tMin = 0,\n\t\tNarrowHorizontal = 27,\n\t\tNarrowVertical = 26,\n\t\tOutlinedDiamond = 51,\n\t\tPercent05 = 6,\n\t\tPercent10 = 7,\n\t\tPercent20 = 8,\n\t\tPercent25 = 9,\n\t\tPercent30 = 10,\n\t\tPercent40 = 11,\n\t\tPercent50 = 12,\n\t\tPercent60 = 13,\n\t\tPercent70 = 14,\n\t\tPercent75 = 15,\n\t\tPercent80 = 16,\n\t\tPercent90 = 17,\n\t\tPlaid = 41,\n\t\tShingle = 45,\n\t\tSmallCheckerBoard = 49,\n\t\tSmallConfetti = 34,\n\t\tSmallGrid = 48,\n\t\tSolidDiamond = 52,\n\t\tSphere = 47,\n\t\tTrellis = 46,\n\t\tVertical = 1,\n\t\tWave = 37,\n\t\tWeave = 40,\n\t\tWideDownwardDiagonal = 22,\n\t\tWideUpwardDiagonal = 23,\n\t\tZigZag = 36\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing.Drawing2D/LinearGradientBrush.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing.Drawing2D {\n\tpublic sealed class LinearGradientBrush : Brush {\n\n\t\tpublic LinearGradientBrush(Point point1, Point point2, Color col1, Color col2) {\n\t\t\tbase.native = LibIGraph.CreateBrush_LinearGradient\n\t\t\t\t(point1.X, point1.Y, point2.X, point2.Y, col1.ToArgb(), col2.ToArgb());\n\t\t}\n\n\t\tpublic LinearGradientBrush(PointF point1, PointF point2, Color col1, Color col2) {\n\t\t\tbase.native = LibIGraph.CreateBrush_LinearGradient\n\t\t\t\t((int)point1.X, (int)point1.Y, (int)point2.X, (int)point2.Y, col1.ToArgb(), col2.ToArgb());\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing.Drawing2D/WrapMode.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing.Drawing2D {\n\tpublic enum WrapMode {\n\t\tTile = 0,\n\t\tTileFlipX = 1,\n\t\tTileFlipY = 2,\n\t\tTileFlipXY = 3,\n\t\tClamp = 4\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing.Imaging/PixelFormat.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace System.Drawing.Imaging {\n\tpublic enum PixelFormat {\n\t\tAlpha = 262144,\n\t\tCanonical = 2097152,\n\t\tDontCare = 0,\n\t\tExtended = 1048576,\n\t\tFormat16bppArgb1555 = 397319,\n\t\tFormat16bppGrayScale = 1052676,\n\t\tFormat16bppRgb555 = 135173,\n\t\tFormat16bppRgb565 = 135174,\n\t\tFormat1bppIndexed = 196865,\n\t\tFormat24bppRgb = 137224,\n\t\tFormat32bppArgb = 2498570,\n\t\tFormat32bppPArgb = 925707,\n\t\tFormat32bppRgb = 139273,\n\t\tFormat48bppRgb = 1060876,\n\t\tFormat4bppIndexed = 197634,\n\t\tFormat64bppArgb = 3424269,\n\t\tFormat64bppPArgb = 1851406,\n\t\tFormat8bppIndexed = 198659,\n\t\tGdi = 131072,\n\t\tIndexed = 65536,\n\t\tMax = 15,\n\t\tPAlpha = 524288,\n\t\tUndefined = 0,\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing.Text/TextRenderingHint.cs",
    "content": "// Copyright (c) 2009 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Drawing.Text {\n\tpublic enum TextRenderingHint {\n\t\tAntiAlias = 4,\n\t\tAntiAliasGridFit = 3,\n\t\tClearTypeGridFit = 5,\n\t\tSingleBitPerPixel = 2,\n\t\tSingleBitPerPixelGridFit = 1,\n\t\tSystemDefault = 0\n\t}\n}\n"
  },
  {
    "path": "System.Drawing/System.Drawing.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.30729</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{0F7F935F-E3F5-40AD-BD22-0BA43721560F}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>System.Drawing</RootNamespace>\n    <AssemblyName>System.Drawing</AssemblyName>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <UpgradeBackupLocation>\n    </UpgradeBackupLocation>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>DEBUG;TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <NoStdLib>true</NoStdLib>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <NoStdLib>true</NoStdLib>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"System.Drawing.Drawing2D\\HatchBrush.cs\" />\n    <Compile Include=\"System.Drawing.Drawing2D\\HatchStyle.cs\" />\n    <Compile Include=\"System.Drawing.Drawing2D\\LinearGradientBrush.cs\" />\n    <Compile Include=\"System.Drawing.Drawing2D\\WrapMode.cs\" />\n    <Compile Include=\"System.Drawing.Imaging\\PixelFormat.cs\" />\n    <Compile Include=\"System.Drawing.Text\\TextRenderingHint.cs\" />\n    <Compile Include=\"System.Drawing\\Bitmap.cs\" />\n    <Compile Include=\"System.Drawing\\Brush.cs\" />\n    <Compile Include=\"System.Drawing\\Brushes.cs\" />\n    <Compile Include=\"System.Drawing\\Color.cs\" />\n    <Compile Include=\"System.Drawing\\Font.cs\" />\n    <Compile Include=\"System.Drawing\\FontFamily.cs\" />\n    <Compile Include=\"System.Drawing\\FontStyle.cs\" />\n    <Compile Include=\"System.Drawing\\Graphics.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"System.Drawing\\Image.cs\" />\n    <Compile Include=\"System.Drawing\\KnownColor.cs\" />\n    <Compile Include=\"System.Drawing\\KnownColors.cs\" />\n    <Compile Include=\"System.Drawing\\LibIGraph.cs\" />\n    <Compile Include=\"System.Drawing\\Pen.cs\" />\n    <Compile Include=\"System.Drawing\\Pens.cs\" />\n    <Compile Include=\"System.Drawing\\Point.cs\" />\n    <Compile Include=\"System.Drawing\\PointF.cs\" />\n    <Compile Include=\"System.Drawing\\Rectangle.cs\" />\n    <Compile Include=\"System.Drawing\\RectangleF.cs\" />\n    <Compile Include=\"System.Drawing\\Region.cs\" />\n    <Compile Include=\"System.Drawing\\Size.cs\" />\n    <Compile Include=\"System.Drawing\\SizeF.cs\" />\n    <Compile Include=\"System.Drawing\\SolidBrush.cs\" />\n    <Compile Include=\"System.Drawing\\StringAlignment.cs\" />\n    <Compile Include=\"System.Drawing\\StringFormat.cs\" />\n    <Compile Include=\"System.Drawing\\StringFormatFlags.cs\" />\n    <Compile Include=\"System.Drawing\\StringTrimming.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.2.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <ItemGroup>\n    <ProjectReference Include=\"..\\corlib\\corlib.csproj\">\n      <Project>{6a77a7c0-fb66-4caa-94ee-142dba20655d}</Project>\n      <Name>corlib</Name>\n    </ProjectReference>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <PropertyGroup>\n    <PostBuildEvent>xcopy $(TargetPath) $(SolutionDir)Builds\\$(ConfigurationName)\\ /Y</PostBuildEvent>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "corlib/Properties/AssemblyInfo.cs",
    "content": "﻿/*using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"corlib\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"corlib\")]\n[assembly: AssemblyCopyright(\"Copyright ©  2007\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components.  If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"32d5f5f8-8b09-424d-ad44-4ed1da918a19\")]\n\n// Version information for an assembly consists of the following four values:\n//\n//      Major Version\n//      Minor Version \n//      Build Number\n//      Revision\n//\n// You can specify all the values or you can default the Revision and Build Numbers \n// by using the '*' as shown below:\n[assembly: AssemblyVersion(\"2.0.0.0\")]\n[assembly: AssemblyFileVersion(\"2.0.0.0\")]\n*/"
  },
  {
    "path": "corlib/System/Action.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic delegate void Action<T> (T obj);\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Activator.cs",
    "content": "﻿// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace corlib.System {\n\n\tpublic static class Activator {\n\n\n\n\t}\n\n}\n"
  },
  {
    "path": "corlib/System/ArgumentException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class ArgumentException : SystemException {\n\n\t\tprivate string paramName;\n\n\t\tpublic ArgumentException() : base(\"An invalid argument was specified.\") { }\n\n\t\tpublic ArgumentException(string message) : base(message) { }\n\n\t\tpublic ArgumentException(string message, Exception innerException) : base(message, innerException) { }\n\n\t\tpublic ArgumentException(string message, string paramName)\n\t\t\t: base(message) {\n\n\t\t\tthis.paramName = paramName;\n\t\t}\n\n\t\tpublic virtual string ParamName {\n\t\t\tget {\n\t\t\t\treturn paramName;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string Message {\n\t\t\tget {\n\t\t\t\tstring baseMsg = base.Message;\n\t\t\t\tif (baseMsg == null) {\n\t\t\t\t\tbaseMsg = \"An invalid argument was specified.\";\n\t\t\t\t}\n\t\t\t\tif (paramName == null) {\n\t\t\t\t\treturn baseMsg;\n\t\t\t\t} else {\n\t\t\t\t\treturn baseMsg + Environment.NewLine + \"Parameter name: \" + paramName;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/ArgumentNullException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class ArgumentNullException : ArgumentException {\n\n\t\tpublic ArgumentNullException() : base(\"Argument cannot be null.\") { }\n\n\t\tpublic ArgumentNullException(string paramName) : base(\"Argument cannot be null.\", paramName) { }\n\n\t\tpublic ArgumentNullException(string paramName, string message) : base(message, paramName) { }\n\n\t\tpublic ArgumentNullException(string message, Exception innerException)\n\t\t\t: base(message, innerException) {\n\t\t}\n\t\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System/ArgumentOutOfRangeException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class ArgumentOutOfRangeException : ArgumentException {\n\n\t\tpublic ArgumentOutOfRangeException() : base(\"Argument is out of range.\") { }\n\n\t\tpublic ArgumentOutOfRangeException(string paramName) : base(\"Argument is out of range.\", paramName) { }\n\n\t\tpublic ArgumentOutOfRangeException(string paramName, string msg) : base(msg, paramName) { }\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/ArithmeticException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class ArithmeticException : SystemException {\n\n\t\tpublic ArithmeticException() : base(\"Overflow or underflow in the arithmetic operation.\") { }\n\t\tpublic ArithmeticException(string msg) : base(msg) { }\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Array.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace System {\n\n\tpublic abstract class Array : ICloneable, IList, ICollection, IEnumerable {\n\n\t\tprivate class NonGenericEnumerator : IEnumerator {\n\n\t\t\tprivate Array array;\n\t\t\tprivate int index, length;\n\n\t\t\tpublic NonGenericEnumerator(Array array) {\n\t\t\t\tthis.array = array;\n\t\t\t\tthis.index = -1;\n\t\t\t\tthis.length = array.length;\n\t\t\t}\n\n\t\t\tpublic object Current {\n\t\t\t\tget {\n\t\t\t\t\tif (index < 0) {\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Enumeration has not started\");\n\t\t\t\t\t}\n\t\t\t\t\tif (index >= length) {\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Enumeration has finished\");\n\t\t\t\t\t}\n\t\t\t\t\treturn array.GetValue(index);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool MoveNext() {\n\t\t\t\tindex++;\n\t\t\t\treturn (index < length);\n\t\t\t}\n\n\t\t\tpublic void Reset() {\n\t\t\t\tindex = -1;\n\t\t\t}\n\n\t\t}\n\n\t\tprivate struct GenericEnumerator<T> : IEnumerator<T> {\n\n\t\t\tprivate Array array;\n\t\t\tprivate int index, length;\n\n\t\t\tpublic GenericEnumerator(Array array) {\n\t\t\t\tthis.array = array;\n\t\t\t\tthis.index = -1;\n\t\t\t\tthis.length = array.length;\n\t\t\t}\n\n\t\t\tpublic T Current {\n\t\t\t\tget {\n\t\t\t\t\tif (index < 0) {\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Enumeration has not started\");\n\t\t\t\t\t}\n\t\t\t\t\tif (index >= length) {\n\t\t\t\t\t\tthrow new InvalidOperationException(\"Enumeration has finished\");\n\t\t\t\t\t}\n\t\t\t\t\treturn (T)array.GetValue(index);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Dispose() {\n\t\t\t}\n\n\t\t\tobject IEnumerator.Current {\n\t\t\t\tget {\n\t\t\t\t\treturn this.Current;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool MoveNext() {\n\t\t\t\tindex++;\n\t\t\t\treturn (index < length);\n\t\t\t}\n\n\t\t\tpublic void Reset() {\n\t\t\t\tthis.index = -1;\n\t\t\t}\n\t\t}\n\n\t\tprivate Array() {\n\t\t}\n\n\t\t#region Generic interface methods\n\n\t\t// The name of these methods are important. They are directly referenced in the interpreter.\n\t\tprivate IEnumerator<T> Internal_GetGenericEnumerator<T>() {\n\t\t\treturn new GenericEnumerator<T>(this);\n\t\t}\n\n\t\tprivate bool Internal_GenericIsReadOnly() {\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate void Internal_GenericAdd<T>(T item) {\n\t\t\tthrow new NotSupportedException(\"Collection is read-only\");\n\t\t}\n\n\t\tprivate void Internal_GenericClear() {\n\t\t\tArray.Clear(this, 0, this.length);\n\t\t}\n\n\t\tprivate bool Internal_GenericContains<T>(T item) {\n\t\t\treturn Array.IndexOf(this, (object)item) >= 0;\n\t\t}\n\n\t\tprivate void Internal_GenericCopyTo<T>(T[] array, int arrayIndex) {\n\t\t\tArray.Copy(this, 0, (Array)array, arrayIndex, this.length);\n\t\t}\n\n\t\tprivate bool Internal_GenericRemove<T>(T item) {\n\t\t\tthrow new NotSupportedException(\"Collection is read-only\");\n\t\t}\n\n\t\tprivate int Internal_GenericIndexOf<T>(T item) {\n\t\t\treturn IndexOf(this, (object)item);\n\t\t}\n\n\t\tprivate void Internal_GenericInsert<T>(int index, T item) {\n\t\t\tthrow new NotSupportedException(\"List is read-only\");\n\t\t}\n\n\t\tprivate void Internal_GenericRemoveAt(int index) {\n\t\t\tthrow new NotSupportedException(\"List is read-only\");\n\t\t}\n\n\t\tprivate T Internal_GenericGetItem<T>(int index) {\n\t\t\treturn (T)GetValue(index);\n\t\t}\n\n\t\tprivate void Internal_GenericSetItem<T>(int index, T value) {\n\t\t\tSetValue((object)value, index);\n\t\t}\n\n\t\t#endregion\n\n        // This must be the only field, as it ties up with the Array definition in DNA\n#pragma warning disable 0169, 0649\n        private int length;\n#pragma warning restore 0169, 0649\n\n        public int Length {\n\t\t\tget {\n\t\t\t\treturn this.length;\n\t\t\t}\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private object Internal_GetValue(int index);\n\n\t\t/// <summary>\n\t\t/// Returns true if the value set ok, returns false if the Type was wrong\n\t\t/// </summary>\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public bool Internal_SetValue(object value, int index);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static void Clear(Array array, int index, int length);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static bool Internal_Copy(Array src, int srcIndex, Array dst, int dstIndex, int length);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static void Resize<T>(ref T[] array, int newSize);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static void Reverse(Array array, int index, int length);\n\n\t\tpublic static void Reverse(Array array) {\n\t\t\tReverse(array, 0, array.length);\n\t\t}\n\n\t\tpublic static int IndexOf(Array array, object value) {\n\t\t\treturn IndexOf(array, value, 0, array.length);\n\t\t}\n\n\t\tpublic static int IndexOf(Array array, object value, int startIndex) {\n\t\t\treturn IndexOf(array, value, startIndex, array.length - startIndex);\n\t\t}\n\n\t\tpublic static int IndexOf(Array array, object value, int startIndex, int count) {\n\t\t\tif (array == null) {\n\t\t\t\tthrow new ArgumentNullException(\"array\");\n\t\t\t}\n\t\t\tint max = startIndex + count;\n\t\t\tif (startIndex < 0 || max > array.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tfor (int i = startIndex; i < max; i++) {\n\t\t\t\tif (object.Equals(value, array.GetValue(i))) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic static void Copy(Array srcArray, int srcIndex, Array dstArray, int dstIndex, int length) {\n\t\t\tif (srcArray == null || dstArray == null) {\n\t\t\t\tthrow new ArgumentNullException((srcArray == null) ? \"sourceArray\" : \"destinationArray\");\n\t\t\t}\n\t\t\tif (srcIndex < 0 || dstIndex < 0 || length < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tif (srcIndex + length > srcArray.length || dstIndex + length > dstArray.length) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\tif (Internal_Copy(srcArray, srcIndex, dstArray, dstIndex, length)) {\n\t\t\t\t// When src element type can always be cast to dst element type, then can do a really fast copy.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tint start, inc, end;\n\t\t\t// Need to make sure it works even if both arrays are the same\n\t\t\tif (dstIndex > srcIndex) {\n\t\t\t\tstart = 0;\n\t\t\t\tinc = 1;\n\t\t\t\tend = length;\n\t\t\t} else {\n\t\t\t\tstart = length - 1;\n\t\t\t\tinc = -1;\n\t\t\t\tend = -1;\n\t\t\t}\n\t\t\tfor (int i = start; i != end; i += inc) {\n\t\t\t\tobject item = srcArray.GetValue(srcIndex + i);\n\t\t\t\tdstArray.SetValue(item, dstIndex + i);\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Copy(Array srcArray, Array dstArray, int length) {\n\t\t\tCopy(srcArray, 0, dstArray, 0, length);\n\t\t}\n\n\t\tpublic static int IndexOf<T>(T[] array, T value) {\n\t\t\treturn IndexOf((Array)array, (object)value);\n\t\t}\n\n\t\tpublic static int IndexOf<T>(T[] array, T value, int startIndex) {\n\t\t\treturn IndexOf((Array)array, (object)value, startIndex);\n\t\t}\n\n\t\tpublic static int IndexOf<T>(T[] array, T value, int startIndex, int count) {\n\t\t\treturn IndexOf((Array)array, (object)value, startIndex, count);\n\t\t}\n\n\t\tpublic object GetValue(int index) {\n\t\t\tif (index < 0 || index >= this.length) {\n\t\t\t\tthrow new IndexOutOfRangeException();\n\t\t\t}\n\t\t\treturn Internal_GetValue(index);\n\t\t}\n\n\t\tpublic void SetValue(object value, int index) {\n\t\t\tif (index < 0 || index >= this.length) {\n\t\t\t\tthrow new IndexOutOfRangeException();\n\t\t\t}\n\t\t\tif (!Internal_SetValue(value, index)) {\n\t\t\t\tthrow new InvalidCastException();\n\t\t\t}\n\t\t}\n\n\t\tpublic int Rank {\n\t\t\tget {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\tpublic int GetLength(int dimension) {\n\t\t\tif (dimension != 0) {\n\t\t\t\tthrow new IndexOutOfRangeException();\n\t\t\t}\n\t\t\treturn this.length;\n\t\t}\n\n\t\tpublic int GetLowerBound(int dimension) {\n\t\t\tif (dimension != 0) {\n\t\t\t\tthrow new IndexOutOfRangeException();\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic int GetUpperBound(int dimension) {\n\t\t\tif (dimension != 0) {\n\t\t\t\tthrow new IndexOutOfRangeException();\n\t\t\t}\n\t\t\treturn this.length - 1;\n\t\t}\n\n\t\tpublic static TOutput[] ConvertAll<TInput, TOutput>(TInput[] array, Converter<TInput, TOutput> converter) {\n\t\t\tif (array == null) {\n\t\t\t\tthrow new ArgumentNullException(\"array\");\n\t\t\t}\n\t\t\tif (converter == null) {\n\t\t\t\tthrow new ArgumentNullException(\"converter\");\n\t\t\t}\n\n\t\t\tTOutput[] output = new TOutput[array.Length];\n\t\t\tint arrayLen = array.Length;\n\t\t\tfor (int i = 0; i < arrayLen; i++) {\n\t\t\t\toutput[i] = converter(array[i]);\n\t\t\t}\n\n\t\t\treturn output;\n\t\t}\n\n\n\t\t#region Interface Members\n\n\t\tpublic object Clone() {\n\t\t\treturn object.Clone(this);\n\t\t}\n\n\t\tpublic bool IsFixedSize {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsReadOnly {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tobject IList.this[int index] {\n\t\t\tget {\n\t\t\t\tif (index < 0 || index >= this.length) {\n\t\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t\t}\n\t\t\t\treturn GetValue(index);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (index < 0 || index >= this.length) {\n\t\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t\t}\n\t\t\t\tSetValue(value, index);\n\t\t\t}\n\t\t}\n\n\t\tint IList.Add(object value) {\n\t\t\tthrow new NotSupportedException(\"Collection is read-only\");\n\t\t}\n\n\t\tvoid IList.Clear() {\n\t\t\tArray.Clear(this, 0, this.length);\n\t\t}\n\n\t\tbool IList.Contains(object value) {\n\t\t\treturn (IndexOf(this, value) >= 0);\n\t\t}\n\n\t\tint IList.IndexOf(object value) {\n\t\t\treturn IndexOf(this, value);\n\t\t}\n\n\t\tvoid IList.Insert(int index, object value) {\n\t\t\tthrow new NotSupportedException(\"Collection is read-only\");\n\t\t}\n\n\t\tvoid IList.Remove(object value) {\n\t\t\tthrow new NotSupportedException(\"Collection is read-only\");\n\t\t}\n\n\t\tvoid IList.RemoveAt(int index) {\n\t\t\tthrow new NotSupportedException(\"Collection is read-only\");\n\t\t}\n\n\t\tint ICollection.Count {\n\t\t\tget {\n\t\t\t\treturn this.length;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsSynchronized {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic object SyncRoot {\n\t\t\tget {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tpublic void CopyTo(Array array, int index) {\n\t\t\tCopy(this, 0, array, index, this.length);\n\t\t}\n\n\t\tpublic IEnumerator GetEnumerator() {\n\t\t\treturn new NonGenericEnumerator(this);\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator() {\n\t\t\treturn GetEnumerator();\n\t\t}\n\n\t\t#endregion\n\t}\n\n}\n#endif\n"
  },
  {
    "path": "corlib/System/ArrayTypeMismatchException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class ArrayTypeMismatchException : SystemException {\n\n\t\tpublic ArrayTypeMismatchException() : base(\"Source array type cannot be assigned to destination array type.\") { }\n\t\tpublic ArrayTypeMismatchException(string msg) : base(msg) { }\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/AsyncCallback.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\n\tpublic delegate void AsyncCallback(IAsyncResult ar);\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Attribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic abstract class Attribute {\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/AttributeTargets.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\n\tpublic enum AttributeTargets {\n\t\tAssembly = 0x00000001,\n\t\tModule = 0x00000002,\n\t\tClass = 0x00000004,\n\t\tStruct = 0x00000008,\n\t\tEnum = 0x00000010,\n\t\tConstructor = 0x00000020,\n\t\tMethod = 0x00000040,\n\t\tProperty = 0x00000080,\n\t\tField = 0x00000100,\n\t\tEvent = 0x00000200,\n\t\tInterface = 0x00000400,\n\t\tParameter = 0x00000800,\n\t\tDelegate = 0x00001000,\n\t\tReturnValue = 0x00002000,\n\t\tGenericParameter = 0x00004000,\n\n\t\tAll = Assembly | Module | Class | Struct | Enum | Constructor |\n\t\t\tMethod | Property | Field | Event | Interface | Parameter | Delegate | ReturnValue | GenericParameter\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/AttributeUsageAttribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System {\n\n    [AttributeUsage(AttributeTargets.Class)]\n\tpublic sealed class AttributeUsageAttribute : Attribute {\n\n\t\tAttributeTargets validOn;\n\t\tbool allowMultiple = false;\n\t\tbool inherited = true;\n\n\t\tpublic AttributeUsageAttribute(AttributeTargets validOn) {\n\t\t\tthis.validOn = validOn;\n\t\t}\n\n\t\tpublic bool AllowMultiple {\n\t\t\tget {\n\t\t\t\treturn allowMultiple;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tallowMultiple = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool Inherited {\n\t\t\tget {\n\t\t\t\treturn inherited;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tinherited = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic AttributeTargets ValidOn {\n\t\t\tget {\n\t\t\t\treturn validOn;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/BitConverter.cs",
    "content": "#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nnamespace System {\n\tpublic static class BitConverter {\n\n\t\tpublic static readonly bool IsLittleEndian = AmILittleEndian();\n\n\t\tprivate unsafe static bool AmILittleEndian() {\n\t\t\tint i = 1;\n\t\t\tbyte b = *((byte*)&i);\n\t\t\treturn (b == 1);\n\t\t}\n\n\t\tpublic unsafe static long DoubleToInt64Bits(double value) {\n\t\t\treturn *((long*)&value);\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Boolean.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic struct Boolean : IComparable, IComparable<bool>, IEquatable<bool> {\n\n\t\tpublic static readonly string TrueString = \"True\";\n\t\tpublic static readonly string FalseString = \"False\";\n\n\t\tinternal bool m_value;\n\n\t\tpublic override string ToString() {\n\t\t\treturn this.m_value ? TrueString : FalseString;\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\treturn (obj is bool) && ((bool)obj).m_value == this.m_value;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (this.m_value) ? 1 : 0;\n\t\t}\n\n\t\tpublic static bool Parse(string value) {\n\t\t\tif (value == null) {\n\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t}\n\t\t\tvalue = value.Trim();\n\t\t\tif (value == TrueString) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (value == FalseString) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthrow new FormatException(\"Value is not a valid boolean\");\n\t\t}\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is int)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((bool)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<bool> Members\n\n\t\tpublic int CompareTo(bool x) {\n\t\t\treturn (this.m_value == x) ? 0 : ((this.m_value) ? 1 : -1);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<bool> Members\n\n\t\tpublic bool Equals(bool x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\t\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System/Byte.cs",
    "content": "#if !LOCALTEST\n\nusing System.Globalization;\nnamespace System {\n\tpublic struct Byte : IFormattable, IComparable, IComparable<byte>, IEquatable<byte> {\n\t\tpublic const byte MinValue = 0;\n\t\tpublic const byte MaxValue = 255;\n\n#pragma warning disable 0169, 0649\n        internal byte m_value;\n#pragma warning restore 0169, 0649\n\n        public override bool Equals(object obj) {\n\t\t\treturn (obj is byte) && ((byte)obj).m_value == this.m_value;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.m_value;\n\t\t}\n\n\t\t#region ToString methods\n\n\t\tpublic override string ToString() {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value));\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider formatProvider) {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value), formatProvider);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn this.ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider formatProvider) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(formatProvider);\n\t\t\treturn NumberFormatter.NumberToString(format, this.m_value, nfi);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is byte)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((byte)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<byte> Members\n\n\t\tpublic int CompareTo(byte x) {\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<byte> Members\n\n\t\tpublic bool Equals(byte x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Char.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Runtime.CompilerServices;\nusing System.Globalization;\n\nnamespace System {\n\tpublic struct Char : IComparable, IComparable<char>, IEquatable<char> {\n\n\t\t// Note that this array must be ordered, because binary searching is used on it.\n\t\tinternal static readonly char[] WhiteChars = {\n\t\t\t(char) 0x9, (char) 0xA, (char) 0xB, (char) 0xC, (char) 0xD,\n\t\t\t(char) 0x85, (char) 0x1680, (char) 0x2028, (char) 0x2029,\n\t\t\t(char) 0x20, (char) 0xA0, (char) 0x2000, (char) 0x2001,\n\t\t\t(char) 0x2002, (char) 0x2003, (char) 0x2004, (char) 0x2005,\n\t\t\t(char) 0x2006, (char) 0x2007, (char) 0x2008, (char) 0x2009,\n\t\t\t(char) 0x200A, (char) 0x200B, (char) 0x3000, (char) 0xFEFF };\n\n\n\t\tinternal char m_value;\n\n\t\tpublic override string ToString() {\n\t\t\treturn new string(m_value, 1);\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\treturn (obj is char && ((char)obj).m_value == this.m_value);\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.m_value;\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern static public UnicodeCategory GetUnicodeCategory(char c);\n\n\t\tpublic static UnicodeCategory GetUnicodeCategory(string str, int index) {\n\t\t\tif (str == null) {\n\t\t\t\tthrow new ArgumentNullException(\"str\");\n\t\t\t}\n\t\t\tif (index < 0 || index >= str.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\treturn GetUnicodeCategory(str[index]);\n\t\t}\n\n\t\tpublic static bool IsWhiteSpace(char c) {\n\t\t\t// TODO: Make this use Array.BinarySearch() when implemented\n\t\t\tfor (int i = 0; i < WhiteChars.Length; i++) {\n\t\t\t\tif (WhiteChars[i] == c) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic static bool IsWhiteSpace(string str, int index) {\n\t\t\tif (str == null) {\n\t\t\t\tthrow new ArgumentNullException(\"str\");\n\t\t\t}\n\t\t\tif (index < 0 || index >= str.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\treturn IsWhiteSpace(str[index]);\n\t\t}\n\n\t\tpublic static bool IsLetter(char c) {\n\t\t\treturn GetUnicodeCategory(c) <= UnicodeCategory.OtherLetter;\n\t\t}\n\n\t\tpublic static bool IsLetter(string str, int index) {\n\t\t\tif (str == null) {\n\t\t\t\tthrow new ArgumentNullException(\"str\");\n\t\t\t}\n\t\t\tif (index < 0 || index >= str.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\treturn IsLetter(str[index]);\n\t\t}\n\n\t\tpublic static bool IsDigit(char c) {\n\t\t\treturn GetUnicodeCategory(c) == UnicodeCategory.DecimalDigitNumber;\n\t\t}\n\n\t\tpublic static bool IsDigit(string str, int index) {\n\t\t\tif (str == null) {\n\t\t\t\tthrow new ArgumentNullException(\"str\");\n\t\t\t}\n\t\t\tif (index < 0 || index >= str.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\treturn IsDigit(str[index]);\n\t\t}\n\n\t\tpublic static bool IsLower(char c) {\n\t\t\treturn GetUnicodeCategory(c) == UnicodeCategory.LowercaseLetter;\n\t\t}\n\n\t\tpublic static bool IsLower(string str, int index) {\n\t\t\tif (str == null) {\n\t\t\t\tthrow new ArgumentNullException(\"str\");\n\t\t\t}\n\t\t\tif (index < 0 || index >= str.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\treturn IsLower(str[index]);\n\t\t}\n\n\t\tpublic static bool IsUpper(char c) {\n\t\t\treturn GetUnicodeCategory(c) == UnicodeCategory.UppercaseLetter;\n\t\t}\n\n\t\tpublic static bool IsUpper(string str, int index) {\n\t\t\tif (str == null) {\n\t\t\t\tthrow new ArgumentNullException(\"str\");\n\t\t\t}\n\t\t\tif (index < 0 || index >= str.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\treturn IsUpper(str[index]);\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static char ToLowerInvariant(char c);\n\n\t\tpublic static char ToLower(char c) {\n\t\t\treturn ToLower(c, CultureInfo.CurrentCulture);\n\t\t}\n\n\t\tpublic static char ToLower(char c, CultureInfo culture) {\n\t\t\tif (culture == null) {\n\t\t\t\tthrow new ArgumentNullException(\"culture\");\n\t\t\t}\n\t\t\tif (culture.LCID == 0x7f) {\n\t\t\t\t// Invariant culture\n\t\t\t\treturn ToLowerInvariant(c);\n\t\t\t}\n\t\t\treturn '?';\n\t\t\t//return culture.TextInfo.ToUpper(c);\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static char ToUpperInvariant(char c);\n\n\t\tpublic static char ToUpper(char c) {\n\t\t\treturn ToUpper(c, CultureInfo.CurrentCulture);\n\t\t}\n\n\t\tpublic static char ToUpper(char c, CultureInfo culture) {\n\t\t\tif (culture == null) {\n\t\t\t\tthrow new ArgumentNullException(\"culture\");\n\t\t\t}\n\t\t\tif (culture.LCID == 0x7f) {\n\t\t\t\t// Invariant culture\n\t\t\t\treturn ToUpperInvariant(c);\n\t\t\t}\n\t\t\treturn '?';\n\t\t\t//return culture.TextInfo.ToUpper(c);\n\t\t}\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is char)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((char)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<char> Members\n\n\t\tpublic int CompareTo(char x) {\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<char> Members\n\n\t\tpublic bool Equals(char x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/CharEnumerator.cs",
    "content": "#if !LOCALTEST\n\nusing System.Collections.Generic;\nusing System.Collections;\n\nnamespace System {\n\tpublic sealed class CharEnumerator : ICloneable, IEnumerator, IEnumerator<char> {\n\n\t\tprivate string str;\n\t\tprivate int index;\n\t\tprivate int length;\n\n\t\tinternal CharEnumerator(string s) {\n\t\t\tthis.str = s;\n\t\t\tthis.index = -1;\n\t\t\tthis.length = s.Length;\n\t\t}\n\n\t\t#region IClonable Members\n\n\t\tpublic object Clone() {\n\t\t\treturn object.Clone(this);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEnumerator Members\n\n\t\tobject IEnumerator.Current {\n\t\t\tget {\n\t\t\t\treturn Current;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool MoveNext() {\n\t\t\tthis.index++;\n\t\t\treturn (this.index < this.length);\n\t\t}\n\n\t\tpublic void Reset() {\n\t\t\tthis.index = -1;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEnumerator<char> Members\n\n\t\tpublic char Current {\n\t\t\tget {\n\t\t\t\tif (index == -1 || index >= length) {\n\t\t\t\t\tthrow new InvalidOperationException(\"The position is not valid.\");\n\t\t\t\t}\n\t\t\t\treturn str[index];\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IDisposable Members\n\n\t\tpublic void Dispose() {\n\t\t\t// Nothing needed\n\t\t}\n\n\t\t#endregion\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Console.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\n\nnamespace System {\n\tpublic static class Console {\n\n\t\tstatic byte[] ascii2ConsoleKey_Map = new byte[128] {\n\t\t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9   , 0x00, 0x00, 0x00, 13  , 0x00, 0x00, \n\t\t\t0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27  , 0x00, 0x00, 0x00, 0x00, \n\t\t\t32  , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n\t\t\t48  , 49  , 50  , 51  , 52  , 53  , 54  , 55  , 56  , 57  , 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \n\t\t\t0x00, 65  , 66  , 67  , 68  , 69  , 70  , 71  , 72  , 73  , 74  , 75  , 76  , 77  , 78  , 79  , \n\t\t\t80  , 81  , 82  , 83  , 84  , 85  , 86  , 87  , 88  , 89  , 90  , 0x00, 0x00, 0x00, 0x00, 0x00, \n\t\t\t0x00, 65  , 66  , 67  , 68  , 69  , 70  , 71  , 72  , 73  , 74  , 75  , 76  , 77  , 78  , 79  , \n\t\t\t80  , 81  , 82  , 83  , 84  , 85  , 86  , 87  , 88  , 89  , 90  , 0x00, 0x00, 0x00, 0x00, 0x00, \n\t\t};\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static void Write(string s);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static int Internal_ReadKey();\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static bool Internal_KeyAvailable();\n\n\t\t#region Write Methods\n\n\t\tpublic static void Write(object value) {\n\t\t\tif (value != null) {\n\t\t\t\tWrite(value.ToString());\n\t\t\t}\n\t\t}\n\n\t\tpublic static void Write(char value) {\n\t\t\tWrite(value.ToString());\n\t\t}\n\n\t\tpublic static void Write(string format, params object[] args) {\n\t\t\tWrite(string.Format(format, args));\n\t\t}\n\n\t\tpublic static void Write(string format, object obj1) {\n\t\t\tWrite(format, new object[] { obj1 });\n\t\t}\n\n\t\tpublic static void Write(string format, object obj1, object obj2) {\n\t\t\tWrite(format, new object[] { obj1, obj2 });\n\t\t}\n\n\t\tpublic static void Write(string format, object obj1, object obj2, object obj3) {\n\t\t\tWrite(format, new object[] { obj1, obj2, obj3 });\n\t\t}\n\n\t\tpublic static void Write(string format, object obj1, object obj2, object obj3, object obj4) {\n\t\t\tWrite(format, new object[] { obj1, obj2, obj3, obj4 });\n\t\t}\n\n\t\t#endregion\n\n\t\t#region WriteLine Methods\n\n\t\tpublic static void WriteLine(string value) {\n\t\t\tWrite(value);\n\t\t\tWrite(Environment.NewLine);\n\t\t}\n\n\t\tpublic static void WriteLine() {\n\t\t\tWriteLine(string.Empty);\n\t\t}\n\n\t\tpublic static void WriteLine(bool value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(sbyte value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(byte value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(int value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(uint value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(long value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(ulong value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(char value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(float value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(double value) {\n\t\t\tWriteLine(value.ToString());\n\t\t}\n\n\t\tpublic static void WriteLine(object value) {\n\t\t\tif (value == null) {\n\t\t\t\tWriteLine();\n\t\t\t} else {\n\t\t\t\tWriteLine(value.ToString());\n\t\t\t}\n\t\t}\n\n\t\tpublic static void WriteLine(string format, params object[] args) {\n\t\t\tWriteLine(string.Format(format, args));\n\t\t}\n\n\t\tpublic static void WriteLine(string format, object obj1) {\n\t\t\tWriteLine(format, new object[] { obj1 });\n\t\t}\n\n\t\tpublic static void WriteLine(string format, object obj1, object obj2) {\n\t\t\tWriteLine(format, new object[] { obj1, obj2 });\n\t\t}\n\n\t\tpublic static void WriteLine(string format, object obj1, object obj2, object obj3) {\n\t\t\tWriteLine(format, new object[] { obj1, obj2, obj3 });\n\t\t}\n\n\t\tpublic static void WriteLine(string format, object obj1, object obj2, object obj3, object obj4) {\n\t\t\tWriteLine(format, new object[] { obj1, obj2, obj3, obj4 });\n\t\t}\n\n\t\t#endregion\n\n\t\t#region ReadKey Methods\n\n\t\tpublic static bool KeyAvailable {\n\t\t\tget {\n\t\t\t\treturn Internal_KeyAvailable();\n\t\t\t}\n\t\t}\n\n\t\tpublic static ConsoleKeyInfo ReadKey() {\n\t\t\treturn ReadKey(false);\n\t\t}\n\n\t\tpublic static ConsoleKeyInfo ReadKey(bool intercept) {\n\t\t\tint key = Internal_ReadKey();\n\t\t\tchar c = (char)key;\n\t\t\tif (!intercept) {\n\t\t\t\tWrite(c);\n\t\t\t}\n\t\t\tConsoleKey k;\n\t\t\tif (key < 128) {\n\t\t\t\tk = (ConsoleKey)ascii2ConsoleKey_Map[key];\n\t\t\t} else {\n\t\t\t\tk = ConsoleKey.Unknown;\n\t\t\t}\n\t\t\treturn new ConsoleKeyInfo(c, k, false, false, false);\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/ConsoleKey.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\tpublic enum ConsoleKey {\n\t\tUnknown = 0, // Non-standard\n\t\tBackspace = 8,\n\t\tTab = 9,\n\t\tClear = 12,\n\t\tEnter = 13,\n\t\tPause = 19,\n\t\tEscape = 27,\n\t\tSpacebar = 32,\n\t\tPageUp = 33,\n\t\tPageDown = 34,\n\t\tEnd = 35,\n\t\tHome = 36,\n\t\tLeftArrow = 37,\n\t\tUpArrow = 38,\n\t\tRightArrow = 39,\n\t\tDownArrow = 40,\n\t\tSelect = 41,\n\t\tPrint = 42,\n\t\tExecute = 43,\n\t\tPrintScreen = 44,\n\t\tInsert = 45,\n\t\tDelete = 46,\n\t\tHelp = 47,\n\t\tD0 = 48,\n\t\tD1 = 49,\n\t\tD2 = 50,\n\t\tD3 = 51,\n\t\tD4 = 52,\n\t\tD5 = 53,\n\t\tD6 = 54,\n\t\tD7 = 55,\n\t\tD8 = 56,\n\t\tD9 = 57,\n\t\tA = 65,\n\t\tB = 66,\n\t\tC = 67,\n\t\tD = 68,\n\t\tE = 69,\n\t\tF = 70,\n\t\tG = 71,\n\t\tH = 72,\n\t\tI = 73,\n\t\tJ = 74,\n\t\tK = 75,\n\t\tL = 76,\n\t\tM = 77,\n\t\tN = 78,\n\t\tO = 79,\n\t\tP = 80,\n\t\tQ = 81,\n\t\tR = 82,\n\t\tS = 83,\n\t\tT = 84,\n\t\tU = 85,\n\t\tV = 86,\n\t\tW = 87,\n\t\tX = 88,\n\t\tY = 89,\n\t\tZ = 90,\n\t\tLeftWindows = 91,\n\t\tRightWindows = 92,\n\t\tApplications = 93,\n\t\tSleep = 95,\n\t\tNumPad0 = 96,\n\t\tNumPad1 = 97,\n\t\tNumPad2 = 98,\n\t\tNumPad3 = 99,\n\t\tNumPad4 = 100,\n\t\tNumPad5 = 101,\n\t\tNumPad6 = 102,\n\t\tNumPad7 = 103,\n\t\tNumPad8 = 104,\n\t\tNumPad9 = 105,\n\t\tMultiply = 106,\n\t\tAdd = 107,\n\t\tSeparator = 108,\n\t\tSubtract = 109,\n\t\tDecimal = 110,\n\t\tDivide = 111,\n\t\tF1 = 112,\n\t\tF2 = 113,\n\t\tF3 = 114,\n\t\tF4 = 115,\n\t\tF5 = 116,\n\t\tF6 = 117,\n\t\tF7 = 118,\n\t\tF8 = 119,\n\t\tF9 = 120,\n\t\tF10 = 121,\n\t\tF11 = 122,\n\t\tF12 = 123,\n\t\tF13 = 124,\n\t\tF14 = 125,\n\t\tF15 = 126,\n\t\tF16 = 127,\n\t\tF17 = 128,\n\t\tF18 = 129,\n\t\tF19 = 130,\n\t\tF20 = 131,\n\t\tF21 = 132,\n\t\tF22 = 133,\n\t\tF23 = 134,\n\t\tF24 = 135,\n\t\tBrowserBack = 166,\n\t\tBrowserForward = 167,\n\t\tBrowserRefresh = 168,\n\t\tBrowserStop = 169,\n\t\tBrowserSearch = 170,\n\t\tBrowserFavorites = 171,\n\t\tBrowserHome = 172,\n\t\tVolumeMute = 173,\n\t\tVolumeDown = 174,\n\t\tVolumeUp = 175,\n\t\tMediaNext = 176,\n\t\tMediaPrevious = 177,\n\t\tMediaStop = 178,\n\t\tMediaPlay = 179,\n\t\tLaunchMail = 180,\n\t\tLaunchMediaSelect = 181,\n\t\tLaunchApp1 = 182,\n\t\tLaunchApp2 = 183,\n\t\tOem1 = 186,\n\t\tOemPlus = 187,\n\t\tOemComma = 188,\n\t\tOemMinus = 189,\n\t\tOemPeriod = 190,\n\t\tOem2 = 191,\n\t\tOem3 = 192,\n\t\tOem4 = 219,\n\t\tOem5 = 220,\n\t\tOem6 = 221,\n\t\tOem7 = 222,\n\t\tOem8 = 223,\n\t\tOem102 = 226,\n\t\tProcess = 229,\n\t\tPacket = 231,\n\t\tAttention = 246,\n\t\tCrSel = 247,\n\t\tExSel = 248,\n\t\tEraseEndOfFile = 249,\n\t\tPlay = 250,\n\t\tZoom = 251,\n\t\tNoName = 252,\n\t\tPa1 = 253,\n\t\tOemClear = 254,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/ConsoleKeyInfo.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic struct ConsoleKeyInfo {\n\t\tinternal static ConsoleKeyInfo Empty = new ConsoleKeyInfo('\\0', 0, false, false, false);\n\t\tConsoleKey key;\n\t\tchar keychar;\n\t\tConsoleModifiers modifiers;\n\n\t\tpublic ConsoleKeyInfo(char keyChar, ConsoleKey key, bool shift, bool alt, bool control) {\n\t\t\tthis.key = key;\n\t\t\tthis.keychar = keyChar;\n\t\t\tmodifiers = 0;\n\t\t\tSetModifiers(shift, alt, control);\n\t\t}\n\n\t\tinternal ConsoleKeyInfo(ConsoleKeyInfo other) {\n\t\t\tthis.key = other.key;\n\t\t\tthis.keychar = other.keychar;\n\t\t\tthis.modifiers = other.modifiers;\n\t\t}\n\n\t\tinternal void SetKey(ConsoleKey key) {\n\t\t\tthis.key = key;\n\t\t}\n\n\t\tinternal void SetKeyChar(char keyChar) {\n\t\t\tthis.keychar = keyChar;\n\t\t}\n\n\t\tinternal void SetModifiers(bool shift, bool alt, bool control) {\n\t\t\tthis.modifiers = (shift) ? ConsoleModifiers.Shift : 0;\n\t\t\tthis.modifiers |= (alt) ? ConsoleModifiers.Alt : 0;\n\t\t\tthis.modifiers |= (control) ? ConsoleModifiers.Control : 0;\n\t\t}\n\n\t\tpublic ConsoleKey Key {\n\t\t\tget { return key; }\n\t\t}\n\n\t\tpublic char KeyChar {\n\t\t\tget { return keychar; }\n\t\t}\n\n\t\tpublic ConsoleModifiers Modifiers {\n\t\t\tget { return modifiers; }\n\t\t}\n\n\t\tpublic override bool Equals(object o) {\n\t\t\tif (!(o is ConsoleKeyInfo))\n\t\t\t\treturn false;\n\t\t\treturn Equals((ConsoleKeyInfo)o);\n\t\t}\n\n\t\tpublic bool Equals(ConsoleKeyInfo o) {\n\t\t\treturn key == o.key && o.keychar == keychar && o.modifiers == modifiers;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn key.GetHashCode() ^ keychar.GetHashCode() ^ modifiers.GetHashCode();\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/ConsoleModifiers.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\t[Flags]\n\tpublic enum ConsoleModifiers {\n\t\tAlt = 1,\n\t\tShift = 2,\n\t\tControl = 4\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Converter.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic delegate TOutput Converter<TInput, TOutput>(TInput input);\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/DateTime.cs",
    "content": "#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.Globalization;\nusing System.Text;\nnamespace System {\n\tpublic struct DateTime : IFormattable, IComparable, IComparable<DateTime>, IEquatable<DateTime> {\n\n\t\tpublic static readonly DateTime MinValue = new DateTime(0);\n\t\tpublic static readonly DateTime MaxValue = new DateTime(3155378975999999999L);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static long InternalUtcNow();\n\n\t\tprivate TimeSpan ticks;\n\t\tprivate DateTimeKind kind;\n\n\t\tprivate static readonly int[] daysMonth = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };\n\t\tprivate static readonly int[] daysMonthLeap = { 0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };\n\n\t\tprivate static int AbsoluteDays(int year, int month, int day) {\n\t\t\tint[] days;\n\t\t\tint temp = 0, m = 1;\n\n\t\t\tdays = (IsLeapYear(year) ? daysMonthLeap : daysMonth);\n\n\t\t\twhile (m < month)\n\t\t\t\ttemp += days[m++];\n\t\t\treturn ((day - 1) + temp + (365 * (year - 1)) + ((year - 1) / 4) - ((year - 1) / 100) + ((year - 1) / 400));\n\t\t}\n\n\t\tpublic DateTime(long ticks) {\n\t\t\tthis.ticks = new TimeSpan(ticks);\n\t\t\tthis.kind = DateTimeKind.Unspecified;\n\t\t}\n\n\t\tpublic DateTime(long ticks, DateTimeKind kind) {\n\t\t\tthis.ticks = new TimeSpan(ticks);\n\t\t\tthis.kind = kind;\n\t\t}\n\n\t\tpublic DateTime(int year, int month, int day)\n\t\t\t: this(year, month, day, 0, 0, 0, 0, DateTimeKind.Unspecified) {\n\t\t}\n\n\t\tpublic DateTime(int year, int month, int day, int hour, int minute, int second)\n\t\t\t: this(year, month, day, hour, minute, second, 0, DateTimeKind.Unspecified) {\n\t\t}\n\n\t\tpublic DateTime(int year, int month, int day, int hour, int minute, int second, DateTimeKind kind)\n\t\t\t: this(year, month, day, hour, minute, second, 0, kind) {\n\t\t}\n\n\t\tpublic DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond)\n\t\t\t: this(year, month, day, hour, minute, second, millisecond, DateTimeKind.Unspecified) {\n\t\t}\n\n\t\tpublic DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, DateTimeKind kind) {\n\t\t\tticks = new TimeSpan(AbsoluteDays(year, month, day), hour, minute, second, millisecond);\n\t\t\tthis.kind = kind;\n\t\t}\n\n\t\tpublic DateTime Date {\n\t\t\tget {\n\t\t\t\treturn new DateTime(this.Year, this.Month, this.Day, 0, 0, 0, this.kind);\n\t\t\t}\n\t\t}\n\n\t\tpublic int Day {\n\t\t\tget {\n\t\t\t\treturn this.FromTicks(Which.Day);\n\t\t\t}\n\t\t}\n\n\t\tpublic DayOfWeek DayOfWeek {\n\t\t\tget {\n\t\t\t\treturn (DayOfWeek)((this.ticks.Days + 1) % 7);\n\t\t\t}\n\t\t}\n\n\t\tpublic int DayOfYear {\n\t\t\tget {\n\t\t\t\treturn this.FromTicks(Which.DayYear);\n\t\t\t}\n\t\t}\n\n\t\tpublic int Hour {\n\t\t\tget {\n\t\t\t\treturn this.ticks.Hours;\n\t\t\t}\n\t\t}\n\n\t\tpublic DateTimeKind Kind {\n\t\t\tget {\n\t\t\t\treturn this.kind;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Millisecond {\n\t\t\tget {\n\t\t\t\treturn this.ticks.MilliSeconds;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Minute {\n\t\t\tget {\n\t\t\t\treturn this.ticks.Minutes;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Month {\n\t\t\tget {\n\t\t\t\treturn this.FromTicks(Which.Month);\n\t\t\t}\n\t\t}\n\n\t\tpublic int Second {\n\t\t\tget {\n\t\t\t\treturn this.ticks.Seconds;\n\t\t\t}\n\t\t}\n\n\t\tpublic long Ticks {\n\t\t\tget {\n\t\t\t\treturn this.ticks.Ticks;\n\t\t\t}\n\t\t}\n\n\t\tpublic TimeSpan TimeOfDay {\n\t\t\tget {\n\t\t\t\treturn new TimeSpan(this.ticks.Ticks % TimeSpan.TicksPerDay);\n\t\t\t}\n\t\t}\n\n\t\tpublic int Year {\n\t\t\tget {\n\t\t\t\treturn this.FromTicks(Which.Year);\n\t\t\t}\n\t\t}\n\n\t\tpublic static DateTime UtcNow {\n\t\t\tget {\n\t\t\t\treturn new DateTime(InternalUtcNow(), DateTimeKind.Utc);\n\t\t\t}\n\t\t}\n\n\t\tprivate enum Which {\n\t\t\tDay,\n\t\t\tDayYear,\n\t\t\tMonth,\n\t\t\tYear\n\t\t};\n\n\t\tpublic DateTime Add(TimeSpan ts) {\n\t\t\treturn new DateTime(this.ticks.Ticks + ts.Ticks, this.kind);\n\t\t}\n\n\t\tpublic TimeSpan Subtract(DateTime dt) {\n\t\t\treturn this.ticks - dt.ticks;\n\t\t}\n\n\t\tpublic DateTime Subtract(TimeSpan ts) {\n\t\t\treturn new DateTime(this.ticks.Ticks - ts.Ticks, this.kind);\n\t\t}\n\n\t\tpublic DateTime AddDays(double days) {\n\t\t\treturn this.AddTicks((long)(days * (double)TimeSpan.TicksPerDay));\n\t\t}\n\n\t\tpublic DateTime AddHours(double hours) {\n\t\t\treturn this.AddTicks((long)(hours * (double)TimeSpan.TicksPerHour));\n\t\t}\n\n\t\tpublic DateTime AddMilliseconds(double ms) {\n\t\t\treturn this.AddTicks((long)(ms * (double)TimeSpan.TicksPerMillisecond));\n\t\t}\n\n\t\tpublic DateTime AddMinutes(double mins) {\n\t\t\treturn this.AddTicks((long)(mins * (double)TimeSpan.TicksPerMinute));\n\t\t}\n\n\t\tpublic DateTime AddSeconds(double seconds) {\n\t\t\treturn this.AddTicks((long)(seconds * (double)TimeSpan.TicksPerSecond));\n\t\t}\n\n\t\tpublic DateTime AddTicks(long ticks) {\n\t\t\treturn new DateTime(this.ticks.Ticks + ticks, this.kind);\n\t\t}\n\n\t\tpublic DateTime AddMonths(int months) {\n\t\t\tint day, month, year, maxday;\n\t\t\tDateTime temp;\n\n\t\t\tday = this.Day;\n\t\t\tmonth = this.Month + (months % 12);\n\t\t\tyear = this.Year + months / 12;\n\n\t\t\tif (month < 1) {\n\t\t\t\tmonth = 12 + month;\n\t\t\t\tyear--;\n\t\t\t} else if (month > 12) {\n\t\t\t\tmonth = month - 12;\n\t\t\t\tyear++;\n\t\t\t}\n\t\t\tmaxday = DaysInMonth(year, month);\n\t\t\tif (day > maxday)\n\t\t\t\tday = maxday;\n\n\t\t\ttemp = new DateTime(year, month, day);\n\t\t\ttemp.kind = kind;\n\t\t\treturn temp.Add(this.TimeOfDay);\n\t\t}\n\n\t\tpublic DateTime AddYears(int years) {\n\t\t\treturn this.AddMonths(years * 12);\n\t\t}\n\n\t\tpublic static DateTime operator +(DateTime d, TimeSpan t) {\n\t\t\treturn d.Add(t);\n\t\t}\n\n\t\tpublic static TimeSpan operator -(DateTime d1, DateTime d2) {\n\t\t\treturn d1.Subtract(d2);\n\t\t}\n\n\t\tpublic static DateTime operator -(DateTime d, TimeSpan t) {\n\t\t\treturn d.Subtract(t);\n\t\t}\n\n\t\tpublic static bool operator ==(DateTime d1, DateTime d2) {\n\t\t\treturn d1.ticks == d2.ticks;\n\t\t}\n\n\t\tpublic static bool operator !=(DateTime d1, DateTime d2) {\n\t\t\treturn d1.ticks != d2.ticks;\n\t\t}\n\n\t\tpublic static bool operator >(DateTime d1, DateTime d2) {\n\t\t\treturn d1.ticks > d2.ticks;\n\t\t}\n\n\t\tpublic static bool operator >=(DateTime d1, DateTime d2) {\n\t\t\treturn d1.ticks >= d2.ticks;\n\t\t}\n\n\t\tpublic static bool operator <(DateTime d1, DateTime d2) {\n\t\t\treturn d1.ticks < d2.ticks;\n\t\t}\n\n\t\tpublic static bool operator <=(DateTime d1, DateTime d2) {\n\t\t\treturn d1.ticks <= d2.ticks;\n\t\t}\n\n\t\tprivate const int dp400 = 146097;\n\t\tprivate const int dp100 = 36524;\n\t\tprivate const int dp4 = 1461;\n\n\t\tpublic static bool IsLeapYear(int year) {\n\t\t\treturn ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0);\n\t\t}\n\n\t\tprivate int FromTicks(Which what) {\n\t\t\tint num400, num100, num4, numyears;\n\t\t\tint M = 1;\n\n\t\t\tint[] days = daysMonth;\n\t\t\tint totaldays = this.ticks.Days;\n\n\t\t\tnum400 = (totaldays / dp400);\n\t\t\ttotaldays -= num400 * dp400;\n\n\t\t\tnum100 = (totaldays / dp100);\n\t\t\tif (num100 == 4)   // leap\n\t\t\t\tnum100 = 3;\n\t\t\ttotaldays -= (num100 * dp100);\n\n\t\t\tnum4 = totaldays / dp4;\n\t\t\ttotaldays -= (num4 * dp4);\n\n\t\t\tnumyears = totaldays / 365;\n\n\t\t\tif (numyears == 4) {\n\t\t\t\t//leap\n\t\t\t\tnumyears = 3;\n\t\t\t}\n\t\t\tif (what == Which.Year) {\n\t\t\t\treturn num400 * 400 + num100 * 100 + num4 * 4 + numyears + 1;\n\t\t\t}\n\n\t\t\ttotaldays -= (numyears * 365);\n\t\t\tif (what == Which.DayYear) {\n\t\t\t\treturn totaldays + 1;\n\t\t\t}\n\n\t\t\tif ((numyears == 3) && ((num100 == 3) || !(num4 == 24))) {\n\t\t\t\t//31 dec leapyear\n\t\t\t\tdays = daysMonthLeap;\n\t\t\t}\n\n\t\t\twhile (totaldays >= days[M]) {\n\t\t\t\ttotaldays -= days[M++];\n\t\t\t}\n\n\t\t\tif (what == Which.Month) {\n\t\t\t\treturn M;\n\t\t\t}\n\n\t\t\treturn totaldays + 1;\n\t\t}\n\n\t\tpublic static int DaysInMonth(int year, int month) {\n\t\t\tif (month < 1 || month > 12) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tint[] days = (IsLeapYear(year) ? daysMonthLeap : daysMonth);\n\t\t\treturn days[month];\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\tif (!(obj is System.DateTime)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn ((DateTime)obj).ticks == ticks;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn this.ticks.GetHashCode();\n\t\t}\n\n\t\t#region ToString() stuff\n\n\t\tpublic override string ToString() {\n\t\t\treturn this.ToString(\"G\", null);\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider fp) {\n\t\t\treturn this.ToString(null, fp);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn this.ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider fp) {\n\t\t\tDateTimeFormatInfo dtf = DateTimeFormatInfo.GetInstance(fp);\n\n\t\t\tif (string.IsNullOrEmpty(format)) {\n\t\t\t\tformat = \"G\";\n\t\t\t}\n\n\t\t\tbool useUtc = false, useInvariant = false;\n\t\t\tif (format.Length == 1) {\n\t\t\t\tformat = GetStandardPattern(format[0], dtf, out useUtc, out useInvariant);\n\t\t\t}\n\n\t\t\treturn this.ToString2(format, dtf);\n\t\t}\n\n\t\t#region ToString helper functions\n\n\t\tprivate string ToString2(string format, DateTimeFormatInfo dfi) {\n\t\t\t// the length of the format is usually a good guess of the number\n\t\t\t// of chars in the result. Might save us a few bytes sometimes\n\t\t\t// Add + 10 for cases like mmmm dddd\n\t\t\tStringBuilder result = new StringBuilder(format.Length + 10);\n\n\t\t\t// For some cases, the output should not use culture dependent calendar\n\t\t\tDateTimeFormatInfo inv = DateTimeFormatInfo.InvariantInfo;\n\t\t\tif (format == inv.RFC1123Pattern)\n\t\t\t\tdfi = inv;\n\t\t\telse if (format == inv.UniversalSortableDateTimePattern)\n\t\t\t\tdfi = inv;\n\n\t\t\tint i = 0;\n\n\t\t\twhile (i < format.Length) {\n\t\t\t\tint tokLen;\n\t\t\t\tbool omitZeros = false;\n\t\t\t\tchar ch = format[i];\n\n\t\t\t\tswitch (ch) {\n\n\t\t\t\t//\n\t\t\t\t// Time Formats\n\t\t\t\t//\n\t\t\t\tcase 'h':\n\t\t\t\t\t// hour, [1, 12]\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\n\t\t\t\t\tint hr = this.Hour % 12;\n\t\t\t\t\tif (hr == 0)\n\t\t\t\t\t\thr = 12;\n\n\t\t\t\t\tZeroPad(result, hr, tokLen == 1 ? 1 : 2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'H':\n\t\t\t\t\t// hour, [0, 23]\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\t\t\t\t\tZeroPad(result, this.Hour, tokLen == 1 ? 1 : 2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'm':\n\t\t\t\t\t// minute, [0, 59]\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\t\t\t\t\tZeroPad(result, this.Minute, tokLen == 1 ? 1 : 2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 's':\n\t\t\t\t\t// second [0, 29]\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\t\t\t\t\tZeroPad(result, this.Second, tokLen == 1 ? 1 : 2);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'F':\n\t\t\t\t\tomitZeros = true;\n\t\t\t\t\tgoto case 'f';\n\t\t\t\tcase 'f':\n\t\t\t\t\t// fraction of second, to same number of\n\t\t\t\t\t// digits as there are f's\n\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\t\t\t\t\tif (tokLen > 7)\n\t\t\t\t\t\tthrow new FormatException(\"Invalid Format String\");\n\n\t\t\t\t\tint dec = (int)((long)(this.Ticks % TimeSpan.TicksPerSecond) / (long)Math.Pow(10, 7 - tokLen));\n\t\t\t\t\tint startLen = result.Length;\n\t\t\t\t\tZeroPad(result, dec, tokLen);\n\n\t\t\t\t\tif (omitZeros) {\n\t\t\t\t\t\twhile (result.Length > startLen && result[result.Length - 1] == '0')\n\t\t\t\t\t\t\tresult.Length--;\n\t\t\t\t\t\t// when the value was 0, then trim even preceding '.' (!) It is fixed character.\n\t\t\t\t\t\tif (dec == 0 && startLen > 0 && result[startLen - 1] == '.')\n\t\t\t\t\t\t\tresult.Length--;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 't':\n\t\t\t\t\t// AM/PM. t == first char, tt+ == full\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\t\t\t\t\tstring desig = this.Hour < 12 ? dfi.AMDesignator : dfi.PMDesignator;\n\n\t\t\t\t\tif (tokLen == 1) {\n\t\t\t\t\t\tif (desig.Length >= 1)\n\t\t\t\t\t\t\tresult.Append(desig[0]);\n\t\t\t\t\t} else\n\t\t\t\t\t\tresult.Append(desig);\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'z':\n\t\t\t\t\t// timezone. t = +/-h; tt = +/-hh; ttt+=+/-hh:mm\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\t\t\t\t\tthrow new NotImplementedException(\"TimeZone not supported\");\n\t\t\t\t\t/*TimeSpan offset = TimeZone.CurrentTimeZone.GetUtcOffset(this);\n\n\t\t\t\t\tif (offset.Ticks >= 0)\n\t\t\t\t\t\tresult.Append('+');\n\t\t\t\t\telse\n\t\t\t\t\t\tresult.Append('-');\n\n\t\t\t\t\tswitch (tokLen) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tresult.Append(Math.Abs(offset.Hours));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tresult.Append(Math.Abs(offset.Hours).ToString(\"00\"));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tresult.Append(Math.Abs(offset.Hours).ToString(\"00\"));\n\t\t\t\t\t\tresult.Append(':');\n\t\t\t\t\t\tresult.Append(Math.Abs(offset.Minutes).ToString(\"00\"));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;*/\n\t\t\t\tcase 'K': // 'Z' (UTC) or zzz (Local)\n\t\t\t\t\ttokLen = 1;\n\t\t\t\t\tswitch (kind) {\n\t\t\t\t\tcase DateTimeKind.Utc:\n\t\t\t\t\t\tresult.Append ('Z');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase DateTimeKind.Local:\n\t\t\t\t\t\tthrow new NotImplementedException(\"TimeZone not supported\");\n\t\t\t\t\t\t/*offset = TimeZone.CurrentTimeZone.GetUtcOffset (this);\n\t\t\t\t\t\tif (offset.Ticks >= 0)\n\t\t\t\t\t\t\tresult.Append ('+');\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tresult.Append ('-');\n\t\t\t\t\t\tresult.Append (Math.Abs (offset.Hours).ToString (\"00\"));\n\t\t\t\t\t\tresult.Append (':');\n\t\t\t\t\t\tresult.Append (Math.Abs (offset.Minutes).ToString (\"00\"));\n\t\t\t\t\t\tbreak;*/\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t//\n\t\t\t\t// Date tokens\n\t\t\t\t//\n\t\t\t\tcase 'd':\n\t\t\t\t\t// day. d(d?) = day of month (leading 0 if two d's)\n\t\t\t\t\t// ddd = three leter day of week\n\t\t\t\t\t// dddd+ full day-of-week\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\n\t\t\t\t\tif (tokLen <= 2)\n\t\t\t\t\t\tZeroPad(result, dfi.Calendar.GetDayOfMonth(this), tokLen == 1 ? 1 : 2);\n\t\t\t\t\telse if (tokLen == 3)\n\t\t\t\t\t\tresult.Append(dfi.GetAbbreviatedDayName(dfi.Calendar.GetDayOfWeek(this)));\n\t\t\t\t\telse\n\t\t\t\t\t\tresult.Append(dfi.GetDayName(dfi.Calendar.GetDayOfWeek(this)));\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'M':\n\t\t\t\t\t// Month.m(m?) = month # (with leading 0 if two mm)\n\t\t\t\t\t// mmm = 3 letter name\n\t\t\t\t\t// mmmm+ = full name\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\t\t\t\t\tint month = dfi.Calendar.GetMonth(this);\n\t\t\t\t\tif (tokLen <= 2)\n\t\t\t\t\t\tZeroPad(result, month, tokLen);\n\t\t\t\t\telse if (tokLen == 3)\n\t\t\t\t\t\tresult.Append(dfi.GetAbbreviatedMonthName(month));\n\t\t\t\t\telse\n\t\t\t\t\t\tresult.Append(dfi.GetMonthName(month));\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'y':\n\t\t\t\t\t// Year. y(y?) = two digit year, with leading 0 if yy\n\t\t\t\t\t// yyy+ full year, if yyy and yr < 1000, displayed as three digits\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\n\t\t\t\t\tif (tokLen <= 2)\n\t\t\t\t\t\tZeroPad(result, dfi.Calendar.GetYear(this) % 100, tokLen);\n\t\t\t\t\telse\n\t\t\t\t\t\tZeroPad(result, dfi.Calendar.GetYear(this), (tokLen == 3 ? 3 : 4));\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'g':\n\t\t\t\t\t// Era name\n\t\t\t\t\ttokLen = CountRepeat(format, i, ch);\n\t\t\t\t\tresult.Append(dfi.GetEraName(dfi.Calendar.GetEra(this)));\n\t\t\t\t\tbreak;\n\n\t\t\t\t//\n\t\t\t\t// Other\n\t\t\t\t//\n\t\t\t\tcase ':':\n\t\t\t\t\tresult.Append(dfi.TimeSeparator);\n\t\t\t\t\ttokLen = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '/':\n\t\t\t\t\tresult.Append(dfi.DateSeparator);\n\t\t\t\t\ttokLen = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\\'':\n\t\t\t\tcase '\"':\n\t\t\t\t\ttokLen = ParseQuotedString(format, i, result);\n\t\t\t\t\tbreak;\n\t\t\t\tcase '%':\n\t\t\t\t\tif (i >= format.Length - 1)\n\t\t\t\t\t\tthrow new FormatException(\"% at end of date time string\");\n\t\t\t\t\tif (format[i + 1] == '%')\n\t\t\t\t\t\tthrow new FormatException(\"%% in date string\");\n\n\t\t\t\t\t// Look for the next char\n\t\t\t\t\ttokLen = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '\\\\':\n\t\t\t\t\t// C-Style escape\n\t\t\t\t\tif (i >= format.Length - 1)\n\t\t\t\t\t\tthrow new FormatException(\"\\\\ at end of date time string\");\n\n\t\t\t\t\tresult.Append(format[i + 1]);\n\t\t\t\t\ttokLen = 2;\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t// catch all\n\t\t\t\t\tresult.Append(ch);\n\t\t\t\t\ttokLen = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ti += tokLen;\n\t\t\t}\n\t\t\treturn result.ToString();\n\t\t}\n\n\t\tprivate static int CountRepeat(string fmt, int p, char c) {\n\t\t\tint l = fmt.Length;\n\t\t\tint i = p + 1;\n\t\t\twhile ((i < l) && (fmt[i] == c))\n\t\t\t\ti++;\n\n\t\t\treturn i - p;\n\t\t}\n\n\t\tprivate static void ZeroPad(StringBuilder output, int digits, int len) {\n\t\t\tchar[] buffer = new char[16];\n\t\t\tint pos = 16;\n\n\t\t\tdo {\n\t\t\t\tbuffer[--pos] = (char)('0' + digits % 10);\n\t\t\t\tdigits /= 10;\n\t\t\t\tlen--;\n\t\t\t} while (digits > 0);\n\n\t\t\twhile (len-- > 0) {\n\t\t\t\tbuffer[--pos] = '0';\n\t\t\t}\n\n\t\t\toutput.Append(buffer, pos, 16 - pos);\n\t\t}\n\n\t\tprivate static int ParseQuotedString(string fmt, int pos, StringBuilder output) {\n\t\t\t// pos == position of \" or '\n\n\t\t\tint len = fmt.Length;\n\t\t\tint start = pos;\n\t\t\tchar quoteChar = fmt[pos++];\n\n\t\t\twhile (pos < len) {\n\t\t\t\tchar ch = fmt[pos++];\n\n\t\t\t\tif (ch == quoteChar)\n\t\t\t\t\treturn pos - start;\n\n\t\t\t\tif (ch == '\\\\') {\n\t\t\t\t\t// C-Style escape\n\t\t\t\t\tif (pos >= len)\n\t\t\t\t\t\tthrow new FormatException(\"Un-ended quote\");\n\n\t\t\t\t\toutput.Append(fmt[pos++]);\n\t\t\t\t} else {\n\t\t\t\t\toutput.Append(ch);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthrow new FormatException(\"Un-ended quote\");\n\t\t}\n\n\t\tprivate static string GetStandardPattern(char format, DateTimeFormatInfo dfi, out bool useUtc, out bool useInvariant) {\n\t\t\tString pattern;\n\n\t\t\tuseUtc = false;\n\t\t\tuseInvariant = false;\n\n\t\t\tswitch (format) {\n\t\t\tcase 'd':\n\t\t\t\tpattern = dfi.ShortDatePattern;\n\t\t\t\tbreak;\n\t\t\tcase 'D':\n\t\t\t\tpattern = dfi.LongDatePattern;\n\t\t\t\tbreak;\n\t\t\tcase 'f':\n\t\t\t\tpattern = dfi.LongDatePattern + \" \" + dfi.ShortTimePattern;\n\t\t\t\tbreak;\n\t\t\tcase 'F':\n\t\t\t\tpattern = dfi.FullDateTimePattern;\n\t\t\t\tbreak;\n\t\t\tcase 'g':\n\t\t\t\tpattern = dfi.ShortDatePattern + \" \" + dfi.ShortTimePattern;\n\t\t\t\tbreak;\n\t\t\tcase 'G':\n\t\t\t\tpattern = dfi.ShortDatePattern + \" \" + dfi.LongTimePattern;\n\t\t\t\tbreak;\n\t\t\tcase 'm':\n\t\t\tcase 'M':\n\t\t\t\tpattern = dfi.MonthDayPattern;\n\t\t\t\tbreak;\n#if NET_2_0\n\t\t\tcase 'o':\n\t\t\t\tpattern = dfi.RoundtripPattern;\n\t\t\t\tbreak;\n#endif\n\t\t\tcase 'r':\n\t\t\tcase 'R':\n\t\t\t\tpattern = dfi.RFC1123Pattern;\n\t\t\t\t// commented by LP 09/jun/2002, rfc 1123 pattern is always in GMT\n\t\t\t\t// uncommented by AE 27/may/2004\n\t\t\t\t//\t\t\t\tuseutc = true;\n\t\t\t\tuseInvariant = true;\n\t\t\t\tbreak;\n\t\t\tcase 's':\n\t\t\t\tpattern = dfi.SortableDateTimePattern;\n\t\t\t\tbreak;\n\t\t\tcase 't':\n\t\t\t\tpattern = dfi.ShortTimePattern;\n\t\t\t\tbreak;\n\t\t\tcase 'T':\n\t\t\t\tpattern = dfi.LongTimePattern;\n\t\t\t\tbreak;\n\t\t\tcase 'u':\n\t\t\t\tpattern = dfi.UniversalSortableDateTimePattern;\n\t\t\t\tuseUtc = true;\n\t\t\t\tbreak;\n\t\t\tcase 'U':\n\t\t\t\t//\t\t\t\tpattern = dfi.LongDatePattern + \" \" + dfi.LongTimePattern;\n\t\t\t\tpattern = dfi.FullDateTimePattern;\n\t\t\t\tuseUtc = true;\n\t\t\t\tbreak;\n\t\t\tcase 'y':\n\t\t\tcase 'Y':\n\t\t\t\tpattern = dfi.YearMonthPattern;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tpattern = null;\n\t\t\t\tbreak;\n\t\t\t//\t\t\t\tthrow new FormatException (String.Format (\"Invalid format pattern: '{0}'\", format));\n\t\t\t}\n\n\t\t\treturn pattern;\n\t\t}\n\n\t\t#endregion\n\n\t\t#endregion\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is DateTime)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((DateTime)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<DateTime> Members\n\n\t\tpublic int CompareTo(DateTime x) {\n\t\t\treturn this.ticks.CompareTo(x.ticks);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<DateTime> Members\n\n\t\tpublic bool Equals(DateTime x) {\n\t\t\treturn this.ticks.Equals(x.ticks);\n\t\t}\n\n\t\t#endregion\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/DateTimeKind.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic enum DateTimeKind {\n\t\tUnspecified,\n\t\tUtc,\n\t\tLocal\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/DayOfWeek.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\tpublic enum DayOfWeek {\n\t\tSunday,\n\t\tMonday,\n\t\tTuesday,\n\t\tWednesday,\n\t\tThursday,\n\t\tFriday,\n\t\tSaturday\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Decimal.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic struct Decimal {\n\n\t\t// internal representation of decimal\n#pragma warning disable 0169, 0649\n        private uint flags;\n\t\tprivate uint hi;\n\t\tprivate uint lo;\n\t\tprivate uint mid;\n#pragma warning restore 0169, 0649\n\n        public static int[] GetBits(Decimal d) {\n\t\t\treturn new int[] { 0, 0, 0, 0 };\n\t\t}\n\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System/Delegate.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\tpublic abstract class Delegate {\n\n\t\t// These must be the same as defined in the interpreter\n\t\t// If/when reflection is implemented, this IntPtr may change to MethodInfo\n\t\tprivate object targetObj = null;\n\t\tprivate IntPtr targetMethod = IntPtr.Zero;\n\t\tprotected Delegate pNext = null;\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\tDelegate d = obj as Delegate;\n\t\t\tif (d == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn d.targetObj == this.targetObj && d.targetMethod.Equals(this.targetMethod);\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\tint ret = targetMethod.GetHashCode();\n\t\t\tif (targetObj != null) {\n\t\t\t\tret ^= targetObj.GetHashCode();\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic static Delegate Combine(Delegate a, Delegate b) {\n\t\t\tif (a == null) {\n\t\t\t\treturn b;\n\t\t\t} else if (b == null) {\n\t\t\t\treturn a;\n\t\t\t}\n\n\t\t\tif (a.GetType() != b.GetType()) {\n\t\t\t\tthrow new ArgumentException(\"Incompatible delegate types\");\n\t\t\t}\n\n\t\t\treturn a.CombineImpl(b);\n\t\t}\n\n\t\tprotected virtual Delegate CombineImpl(Delegate d) {\n\t\t\tthrow new MulticastNotSupportedException();\n\t\t}\n\n\t\tpublic static Delegate Remove(Delegate source, Delegate value) {\n\t\t\tif (source == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn source.RemoveImpl(value);\n\t\t}\n\n\t\tprotected virtual Delegate RemoveImpl(Delegate d) {\n\t\t\tif (d.Equals(this)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System/Double.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Globalization;\nnamespace System {\n\tpublic struct Double : IFormattable, IComparable, IComparable<double>, IEquatable<double> {\n\n\t\tpublic const double Epsilon = 4.9406564584124650e-324;\n\t\tpublic const double MaxValue = 1.7976931348623157e308;\n\t\tpublic const double MinValue = -1.7976931348623157e308;\n\t\tpublic const double NaN = 0.0d / 0.0d;\n\t\tpublic const double NegativeInfinity = -1.0d / 0.0d;\n\t\tpublic const double PositiveInfinity = 1.0d / 0.0d;\n\n\t\tinternal double m_value;\n\n\t\tpublic static bool IsNaN(double d) {\n#pragma warning disable 1718\n\t\t\treturn d != d;\n#pragma warning restore\n\t\t}\n\n\t\tpublic static bool IsNegativeInfinity(double d) {\n\t\t\treturn (d < 0.0d && (d == NegativeInfinity || d == PositiveInfinity));\n\t\t}\n\n\t\tpublic static bool IsPositiveInfinity(double d) {\n\t\t\treturn (d > 0.0d && (d == NegativeInfinity || d == PositiveInfinity));\n\t\t}\n\n\t\tpublic static bool IsInfinity(double d) {\n\t\t\treturn (d == PositiveInfinity || d == NegativeInfinity);\n\t\t}\n\n\t\tpublic override bool Equals(object o) {\n\t\t\tif (!(o is System.Double)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (IsNaN((double)o)) {\n\t\t\t\treturn IsNaN(this.m_value);\n\t\t\t}\n\t\t\treturn ((double)o) == this.m_value;\n\t\t}\n\n\t\tpublic override unsafe int GetHashCode() {\n\t\t\tdouble d = m_value;\n\t\t\treturn (*((long*)&d)).GetHashCode();\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn ToString(null, null);\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider fp) {\n\t\t\treturn ToString(null, fp);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider fp) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(fp);\n\t\t\treturn NumberFormatter.NumberToString(format, this.m_value, nfi);\n\t\t}\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is double)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((double)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<double> Members\n\n\t\tpublic int CompareTo(double x) {\n\t\t\tif (double.IsNaN(this.m_value)) {\n\t\t\t\treturn double.IsNaN(x) ? 0 : -1;\n\t\t\t}\n\t\t\tif (double.IsNaN(x)) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<double> Members\n\n\t\tpublic bool Equals(double x) {\n\t\t\tif (double.IsNaN(this.m_value)) {\n\t\t\t\treturn double.IsNaN(x);\n\t\t\t}\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Enum.cs",
    "content": "#if !LOCALTEST\n\nusing System;\nusing System.Runtime.CompilerServices;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System {\n\tpublic abstract class Enum : ValueType {\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern static private void Internal_GetInfo(Type enumType, out string[] names, out int[] values);\n\n\t\tprivate static Dictionary<Type, EnumInfo> cache = new Dictionary<Type, EnumInfo>();\n\n\t\tpublic static string[] GetNames(Type enumType) {\n\t\t\tif (enumType == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tif (!enumType.IsEnum) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\tEnumInfo info = EnumInfo.GetInfo(enumType);\n\t\t\treturn info.GetNames();\n\t\t}\n\n\t\tprivate struct EnumInfo {\n\t\t\tprivate string[] names;\n\t\t\tprivate int[] values;\n\t\t\t\n\t\t\tpublic static EnumInfo GetInfo(Type enumType) {\n\t\t\t\tlock (cache) {\n\t\t\t\t\tEnumInfo info;\n\t\t\t\t\tif (!Enum.cache.TryGetValue(enumType, out info)) {\n\t\t\t\t\t\tinfo = new EnumInfo();\n\t\t\t\t\t\tEnum.Internal_GetInfo(enumType, out info.names, out info.values);\n\t\t\t\t\t\tEnum.cache.Add(enumType, info);\n\t\t\t\t\t}\n\t\t\t\t\treturn info;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic string GetName(int value) {\n\t\t\t\tint valuesLen = values.Length;\n\t\t\t\tfor (int i = 0; i < valuesLen; i++) {\n\t\t\t\t\tif (this.values[i] == value) {\n\t\t\t\t\t\treturn this.names[i];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Pretend it's got the [Flags] attribute, so look for bits set.\n\t\t\t\t// TODO Sort out Flags attribute properly\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tfor (int i = 0; i < valuesLen; i++) {\n\t\t\t\t\tint thisValue = this.values[i];\n\t\t\t\t\tif ((value & thisValue) == thisValue) {\n\t\t\t\t\t\tsb.Append(this.names[i]);\n\t\t\t\t\t\tsb.Append(\", \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (sb.Length > 0) {\n\t\t\t\t\treturn sb.ToString(0, sb.Length - 2);\n\t\t\t\t}\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic string[] GetNames() {\n\t\t\t\tList<string> names = new List<string>();\n\t\t\t\tfor (int i = 0; i < this.values.Length; i++) {\n\t\t\t\t\tnames.Add(this.GetName(this.values[i]));\n\t\t\t\t}\n\t\t\t\treturn names.ToArray();\n\t\t\t}\n\n\t\t}\n\n\t\tprotected Enum() { }\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private int Internal_GetValue();\n\n\t\tpublic static string GetName(Type enumType, object value) {\n\t\t\tif (enumType == null || value == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tif (!enumType.IsEnum) {\n\t\t\t\tthrow new ArgumentException(\"enumType is not an Enum type.\");\n\t\t\t}\n\t\t\tEnumInfo info = EnumInfo.GetInfo(enumType);\n\t\t\treturn info.GetName((int)value);\n\t\t}\n\n\t\tpublic static string Format(Type enumType, object value, string format) {\n\t\t\tif (enumType == null || value == null || format == null) {\n\t\t\t\tthrow new ArgumentNullException(\"enumType\");\n\t\t\t}\n\t\t\tif (!enumType.IsEnum) {\n\t\t\t\tthrow new ArgumentException(\"Type provided must be an Enum.\");\n\t\t\t}\n\t\t\tstring ret = GetName(enumType, value);\n\t\t\tif (ret == null) {\n\t\t\t\treturn value.ToString();\n\t\t\t} else {\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn Format(this.GetType(), this.Internal_GetValue(), \"G\");\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Environment.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.IO;\nnamespace System {\n\tpublic static class Environment {\n\n\t\tpublic static string NewLine {\n\t\t\tget {\n\t\t\t\treturn (Platform == PlatformID.Unix) ? \"\\n\" : \"\\r\\n\";\n\t\t\t}\n\t\t}\n\n\t\textern public static int TickCount {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\tinternal static string CultureDirectory {\n\t\t\tget {\n\t\t\t\treturn string.Format(\".{0}Cultures\", Path.DirectorySeparatorStr);\n\t\t\t}\n\t\t}\n\n\t\tprivate static OperatingSystem os = null;\n\n\t\tinternal static extern PlatformID Platform {\n\t\t\t[MethodImplAttribute(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\t[MethodImplAttribute(MethodImplOptions.InternalCall)]\n\t\tinternal static extern string GetOSVersionString();\n\n\t\tpublic static OperatingSystem OSVersion {\n\t\t\tget {\n\t\t\t\tif (os == null) {\n\t\t\t\t\tVersion v = Version.CreateFromString(GetOSVersionString());\n\t\t\t\t\tPlatformID p = Platform;\n\t\t\t\t\tos = new OperatingSystem(p, v);\n\t\t\t\t}\n\t\t\t\treturn os;\n\t\t\t}\n\t\t}\n\n\t\tinternal static bool IsRunningOnWindows {\n\t\t\tget {\n\t\t\t\treturn Platform != PlatformID.Unix;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Exception.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\tpublic class Exception {\n\n\t\tprivate Exception innerException;\n\t\tprivate string message;\n\t\tprivate int hresult = unchecked((int)0x80004005);\n\n\t\tpublic Exception() { }\n\n\t\tpublic Exception(string message) {\n\t\t\tthis.message = message;\n\t\t}\n\n\t\tpublic Exception(string message, Exception innerException) {\n\t\t\tthis.innerException = innerException;\n\t\t\tthis.message = message;\n\t\t}\n\n\t\tpublic virtual string Message {\n\t\t\tget {\n\t\t\t\treturn message;\n\t\t\t}\n\t\t}\n\n\t\tpublic Exception InnerException {\n\t\t\tget {\n\t\t\t\treturn innerException;\n\t\t\t}\n\t\t}\n\n\t\tprotected int HResult {\n\t\t\tget { return hresult; }\n\t\t\tset { hresult = value; }\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn Message ?? string.Empty;\n\t\t}\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System/FlagsAttribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\n\t[AttributeUsage(AttributeTargets.Enum, Inherited=false)]\n\tpublic sealed class FlagsAttribute : Attribute {\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/FormatException.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\tpublic class FormatException : SystemException {\n\t\tpublic FormatException() : base(\"Invalid Format.\") { }\n\t\tpublic FormatException(string msg) : base(msg) { }\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/GC.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nnamespace System {\n\tpublic static class GC {\n\n\t\tpublic static int MaxGeneration {\n\t\t\tget {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static int Internal_CollectionCount();\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static void Collect();\n\n\t\tpublic static void Collect(int generation) {\n\t\t\tif (generation < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"generation\");\n\t\t\t}\n\t\t\tCollect();\n\t\t}\n\n\t\tpublic static int CollectionCount(int generation) {\n\t\t\tif (generation < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"generation\");\n\t\t\t}\n\t\t\tif (generation != 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn Internal_CollectionCount();\n\t\t}\n\n\t\tpublic static int GetGeneration(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\tthrow new NullReferenceException();\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic static int GetGeneration(WeakReference wr) {\n\t\t\tif (wr == null || !wr.IsAlive) {\n\t\t\t\tthrow new NullReferenceException();\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static long GetTotalMemory(bool forceFullCollection);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static void SuppressFinalize(object obj);\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/IAsyncResult.cs",
    "content": "#if !LOCALTEST\n\nusing System.Threading;\n\nnamespace System {\n\tpublic interface IAsyncResult {\n\n\t\tobject AsyncState { get;}\n\t\tWaitHandle AsyncWaitHandle { get;\t\t}\n\t\tbool CompletedSynchronously { get;\t\t}\n\t\tbool IsCompleted { get;\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/ICloneable.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic interface ICloneable {\n\n\t\tobject Clone();\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/IComparable.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\n\tpublic interface IComparable {\n\t\tint CompareTo(object obj);\n\t}\n\n\tpublic interface IComparable<T> {\n\t\tint CompareTo(T x);\n\t}\n\n}\n\n#endif"
  },
  {
    "path": "corlib/System/ICustomFormatter.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic interface ICustomFormatter {\n\n\t\tstring Format(string format, object arg, IFormatProvider formatProvider);\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/IDisposable.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\tpublic interface IDisposable {\n\t\tvoid Dispose();\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/IEquatable.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\n\tpublic interface IEquatable<T> {\n\t\tbool Equals(T x);\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/IFormatProvider.cs",
    "content": "#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System {\n\tpublic interface IFormatProvider {\n\t\tobject GetFormat(Type formatType);\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/IFormattable.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic interface IFormattable {\n\n\t\tstring ToString(string format, IFormatProvider formatProvider);\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/IndexOutOfRangeException.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\tpublic class IndexOutOfRangeException : SystemException {\n\n\t\tpublic IndexOutOfRangeException() : base(\"Array index is out of range.\") { }\n\n\t\tpublic IndexOutOfRangeException(string message) : base(message) { }\n\n\t\tpublic IndexOutOfRangeException(string message, Exception innerException)\n\t\t\t: base(message, innerException) {\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Int16.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Globalization;\nnamespace System {\n\tpublic struct Int16 : IFormattable, IComparable, IComparable<short>, IEquatable<short> {\n\t\tpublic const short MaxValue = 0x7fff;\n\t\tpublic const short MinValue = -32768;\n\n#pragma warning disable 0169, 0649\n        internal short m_value;\n#pragma warning restore 0169, 0649\n\n        public override bool Equals(object obj) {\n\t\t\treturn (obj is short) && ((short)obj).m_value == this.m_value;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.m_value;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value));\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider formatProvider) {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value), formatProvider);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider formatProvider) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(formatProvider);\n\t\t\treturn NumberFormatter.NumberToString(format, m_value, nfi);\n\t\t}\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is short)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((short)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<short> Members\n\n\t\tpublic int CompareTo(short x) {\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<short> Members\n\n\t\tpublic bool Equals(short x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Int32.cs",
    "content": "#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.Globalization;\nusing System.Threading;\n\nnamespace System {\n\tpublic struct Int32 : IFormattable, IComparable, IComparable<int>,IEquatable<int> {\n\t\tpublic const int MaxValue = 0x7fffffff;\n\t\tpublic const int MinValue = -2147483648;\n\n\t\tinternal int m_value;\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\treturn (obj is int && ((int)obj).m_value == this.m_value);\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn this.m_value;\n\t\t}\n\n\t\t#region Parse methods\n\n\t\tpublic static int Parse(string s) {\n\t\t\treturn Parse(s, NumberStyles.Integer, null);\n\t\t}\n\n\t\tpublic static int Parse(string s, NumberStyles style) {\n\t\t\treturn Parse(s, style, null);\n\t\t}\n\n\t\tpublic static int Parse(string s, IFormatProvider formatProvider) {\n\t\t\treturn Parse(s, NumberStyles.Integer, formatProvider);\n\t\t}\n\n\t\tpublic static int Parse(string s, NumberStyles style, IFormatProvider formatProvider) {\n\t\t\tException e;\n\t\t\tint res;\n\t\t\tif (!ParseHelper.Parse(s, style, formatProvider, false, out res, out e)) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\treturn res;\n\t\t}\n\n\t\tpublic static bool TryParse(string s, out int result) {\n\t\t\treturn TryParse(s, NumberStyles.Integer, null, out result);\n\t\t}\n\n\t\tpublic static bool TryParse(string s, NumberStyles style,IFormatProvider format, out int result) {\n\t\t\tException e;\n\t\t\treturn ParseHelper.Parse(s, style, format, true, out result, out e);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region ToString methods\n\n\t\tpublic override string ToString() {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value));\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider formatProvider) {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value), formatProvider);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn this.ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider formatProvider) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(formatProvider);\n\t\t\treturn NumberFormatter.NumberToString(format, this.m_value, nfi);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is int)){\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((int)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<int> Members\n\n\t\tpublic int CompareTo(int x) {\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<int> Members\n\n\t\tpublic bool Equals(int x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Int64.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.Globalization;\nnamespace System {\n\tpublic struct Int64 : IFormattable, IComparable, IComparable<long>, IEquatable<long> {\n\t\tpublic const long MaxValue = 0x7fffffffffffffff;\n\t\tpublic const long MinValue = unchecked((long)0x8000000000000000);\n\n\t\tprivate long m_value;\n\n\t\tpublic override bool Equals(object o) {\n\t\t\treturn (o is long) && ((long)o).m_value == this.m_value;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)(m_value & 0xffffffff) ^ (int)(m_value >> 32);\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value));\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider formatProvider) {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value), formatProvider);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider formatProvider) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(formatProvider);\n\t\t\treturn NumberFormatter.NumberToString(format, m_value, nfi);\n\t\t}\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is long)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((long)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<long> Members\n\n\t\tpublic int CompareTo(long x) {\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<long> Members\n\n\t\tpublic bool Equals(long x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/IntPtr.cs",
    "content": "#if !LOCALTEST\n\nnamespace System {\n\tpublic unsafe struct IntPtr {\n\n\t\tpublic static readonly IntPtr Zero = new IntPtr(0);\n\n\t\tprivate void* value;\n\n\t\tpublic IntPtr(int value) {\n\t\t\tthis.value = (void*)value;\n\t\t}\n\n\t\tpublic IntPtr(long value) {\n\t\t\tthis.value = (void*)value;\n\t\t}\n\n\t\tpublic IntPtr(void* value) {\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tpublic static int Size {\n\t\t\tget {\n\t\t\t\treturn sizeof(void*);\n\t\t\t}\n\t\t}\n\n\t\tpublic int ToInt32() {\n\t\t\treturn (int)this.value;\n\t\t}\n\n\t\tpublic long ToInt64() {\n\t\t\treturn (long)this.value;\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\treturn (obj is IntPtr && ((IntPtr)obj).value == this.value);\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.value;\n\t\t}\n\n\t\tpublic static bool operator ==(IntPtr a, IntPtr b) {\n\t\t\treturn a.value == b.value;\n\t\t}\n\n\t\tpublic static bool operator !=(IntPtr a, IntPtr b) {\n\t\t\treturn a.value != b.value;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\tif (Size == 4) {\n\t\t\t\treturn string.Format(\"0x{0:x4}\", (int)this.value);\n\t\t\t} else {\n\t\t\t\treturn string.Format(\"0x{0:x8}\", (long)this.value);\n\t\t\t}\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/InvalidCastException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace System {\n\tpublic class InvalidCastException : SystemException {\n\n\t\tpublic InvalidCastException() : base(\"An invalid cast has occured\") { }\n\n\t}\n}\n"
  },
  {
    "path": "corlib/System/InvalidOperationException.cs",
    "content": "namespace System {\n\tpublic class InvalidOperationException : SystemException {\n\n\t\tpublic InvalidOperationException()\n\t\t\t: base(\"Operation is not valid due to the current state of the object\") { }\n\n\t\tpublic InvalidOperationException(string message) : base(message) { }\n\n\t\tpublic InvalidOperationException(string message, Exception innerException)\n\t\t\t: base(message, innerException) { }\n\n\t}\n}\n"
  },
  {
    "path": "corlib/System/MarshalByRefObject.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic abstract class MarshalByRefObject {\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Math.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System.Runtime.CompilerServices;\n\n#if LOCALTEST\nusing System;\nnamespace System_ {\n#else\nnamespace System {\n#endif\n\tpublic static class Math {\n\n\t\tpublic const double E = 2.7182818284590452354;\n\t\tpublic const double PI = 3.14159265358979323846;\n\n\t\t#region Abs()\n\n\t\tpublic static sbyte Abs(sbyte v) {\n\t\t\tif (v == sbyte.MinValue) {\n\t\t\t\tthrow new OverflowException(\"Value is too small\");\n\t\t\t}\n\t\t\treturn (v >= 0) ? v : (sbyte)-v;\n\t\t}\n\n\t\tpublic static short Abs(short v) {\n\t\t\tif (v == short.MinValue) {\n\t\t\t\tthrow new OverflowException(\"Value is too small\");\n\t\t\t}\n\t\t\treturn (v >= 0) ? v : (short)-v;\n\t\t}\n\n\t\tpublic static int Abs(int v) {\n\t\t\tif (v == int.MinValue) {\n\t\t\t\tthrow new OverflowException(\"Value is too small\");\n\t\t\t}\n\t\t\treturn (v >= 0) ? v : -v;\n\t\t}\n\n\t\tpublic static long Abs(long v) {\n\t\t\tif (v == long.MinValue) {\n\t\t\t\tthrow new OverflowException(\"Value is too small\");\n\t\t\t}\n\t\t\treturn (v >= 0) ? v : -v;\n\t\t}\n\n\t\tpublic static float Abs(float v) {\n\t\t\treturn (v >= 0) ? v : -v;\n\t\t}\n\n\t\tpublic static double Abs(double v) {\n\t\t\treturn (v >= 0) ? v : -v;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Min()\n\n\t\tpublic static sbyte Min(sbyte v1, sbyte v2) {\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static short Min(short v1, short v2) {\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static int Min(int v1, int v2) {\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static long Min(long v1, long v2) {\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static byte Min(byte v1, byte v2) {\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static ushort Min(ushort v1, ushort v2) {\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static uint Min(uint v1, uint v2) {\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static ulong Min(ulong v1, ulong v2) {\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static float Min(float v1, float v2) {\n\t\t\tif (float.IsNaN(v1) || float.IsNaN(v2)) {\n\t\t\t\treturn float.NaN;\n\t\t\t}\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static double Min(double v1, double v2) {\n\t\t\tif (double.IsNaN(v1) || double.IsNaN(v2)) {\n\t\t\t\treturn double.NaN;\n\t\t\t}\n\t\t\treturn (v1 < v2) ? v1 : v2;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Max()\n\n\t\tpublic static sbyte Max(sbyte v1, sbyte v2) {\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static short Max(short v1, short v2) {\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static int Max(int v1, int v2) {\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static long Max(long v1, long v2) {\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static byte Max(byte v1, byte v2) {\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static ushort Max(ushort v1, ushort v2) {\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static uint Max(uint v1, uint v2) {\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static ulong Max(ulong v1, ulong v2) {\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static float Max(float v1, float v2) {\n\t\t\tif (float.IsNaN(v1) || float.IsNaN(v2)) {\n\t\t\t\treturn float.NaN;\n\t\t\t}\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\tpublic static double Max(double v1, double v2) {\n\t\t\tif (double.IsNaN(v1) || double.IsNaN(v2)) {\n\t\t\t\treturn double.NaN;\n\t\t\t}\n\t\t\treturn (v1 > v2) ? v1 : v2;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Sign()\n\n\t\tpublic static int Sign(sbyte v) {\n\t\t\treturn (v > 0) ? 1 : ((v < 0) ? -1 : 0);\n\t\t}\n\n\t\tpublic static int Sign(short v) {\n\t\t\treturn (v > 0) ? 1 : ((v < 0) ? -1 : 0);\n\t\t}\n\n\t\tpublic static int Sign(int v) {\n\t\t\treturn (v > 0) ? 1 : ((v < 0) ? -1 : 0);\n\t\t}\n\n\t\tpublic static int Sign(long v) {\n\t\t\treturn (v > 0) ? 1 : ((v < 0) ? -1 : 0);\n\t\t}\n\n\t\tpublic static int Sign(float v) {\n\t\t\tif (float.IsNaN(v)) {\n\t\t\t\tthrow new ArithmeticException(\"NaN\");\n\t\t\t}\n\t\t\treturn (v > 0) ? 1 : ((v < 0) ? -1 : 0);\n\t\t}\n\n\t\tpublic static int Sign(double v) {\n\t\t\tif (double.IsNaN(v)) {\n\t\t\t\tthrow new ArithmeticException(\"NaN\");\n\t\t\t}\n\t\t\treturn (v > 0) ? 1 : ((v < 0) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t[MethodImplAttribute(MethodImplOptions.InternalCall)]\n\t\tpublic extern static double Sin(double x);\n\n\t\t[MethodImplAttribute(MethodImplOptions.InternalCall)]\n\t\tpublic extern static double Cos(double x);\n\n\t\t[MethodImplAttribute(MethodImplOptions.InternalCall)]\n\t\tpublic extern static double Tan(double x);\n\n\t\t[MethodImplAttribute(MethodImplOptions.InternalCall)]\n\t\tpublic extern static double Pow(double x, double y);\n\n\t\t[MethodImplAttribute(MethodImplOptions.InternalCall)]\n\t\tpublic extern static double Sqrt(double x);\n\t}\n}\n"
  },
  {
    "path": "corlib/System/MulticastDelegate.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic abstract class MulticastDelegate : Delegate {\n\n\t\tprotected override Delegate CombineImpl(Delegate follow) {\n\n\t\t\tMulticastDelegate ret = (MulticastDelegate)object.Clone(this);\n\t\t\tMulticastDelegate cur = ret;\n\n\t\t\t// Clone and add all the current delegate(s)\n\t\t\tfor (MulticastDelegate del = (MulticastDelegate)this.pNext; del != null; del = (MulticastDelegate)del.pNext) {\n\t\t\t\tcur.pNext = (MulticastDelegate)object.Clone(del);\n\t\t\t\tcur = (MulticastDelegate)cur.pNext;\n\t\t\t}\n\n\t\t\t// Add all the following delegate(s)\n\t\t\tcur.pNext = (MulticastDelegate)object.Clone(follow);\n\t\t\tcur = (MulticastDelegate)cur.pNext;\n\t\t\tfor (MulticastDelegate del = (MulticastDelegate)((MulticastDelegate)follow).pNext; del != null; del = (MulticastDelegate)del.pNext) {\n\t\t\t\tcur.pNext = (MulticastDelegate)object.Clone(del);\n\t\t\t\tcur = (MulticastDelegate)cur.pNext;\n\t\t\t}\n\t\t\tcur.pNext = null;\n\n\t\t\treturn ret;\n\t\t}\n\n\t\tprotected override Delegate RemoveImpl(Delegate d) {\n\n\t\t\tMulticastDelegate ret = null, cur = null;\n\n\t\t\tfor (MulticastDelegate del = this; del != null; del = (MulticastDelegate)del.pNext) {\n\t\t\t\t// Miss out the one we're removing\n\t\t\t\tif (!del.Equals(d)) {\n\t\t\t\t\tif (ret == null) {\n\t\t\t\t\t\tret = (MulticastDelegate)object.Clone(del);\n\t\t\t\t\t\tcur = ret;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcur.pNext = (MulticastDelegate)object.Clone(del);\n\t\t\t\t\t\tcur = (MulticastDelegate)cur.pNext;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (cur != null) {\n\t\t\t\tcur.pNext = null;\n\t\t\t}\n\n\t\t\treturn ret;\n\t\t}\n\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System/MulticastNotSupportedException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System {\n\tpublic class MulticastNotSupportedException : SystemException {\n\t\tpublic MulticastNotSupportedException()\n\t\t\t: base(\"This operation cannot be performed with the specified delagates.\") {\n\t\t}\n\n\t\tpublic MulticastNotSupportedException(string msg) : base(msg) { }\n\t}\n}\n"
  },
  {
    "path": "corlib/System/NotImplementedException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class NotImplementedException : SystemException {\n\t\tpublic NotImplementedException() : base(\"The requested feature is not implemented.\") { }\n\n\t\tpublic NotImplementedException(string message) : base(message) { }\n\n\t\tpublic NotImplementedException(string message, Exception inner) : base(message, inner) { }\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/NotSupportedException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class NotSupportedException : SystemException {\n\n\t\tpublic NotSupportedException() : base(\"Operation is not supported.\") { }\n\n\t\tpublic NotSupportedException(string message) : base(message) { }\n\n\t\tpublic NotSupportedException(string message, Exception innerException) : base(message, innerException) { }\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/NullReferenceException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class NullReferenceException : SystemException {\n\n\t\tpublic NullReferenceException(string msg) : base(msg) { }\n\n\t\tpublic NullReferenceException()\n\t\t\t: base(\"A null value was found where an object instance was required.\") {\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Nullable.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\n\tpublic static class Nullable {\n\t\tpublic static int Compare<T>(Nullable<T> left, Nullable<T> right) where T : struct {\n\t\t\tif (!left.HasValue && !right.HasValue) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\tif (!left.HasValue) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (!right.HasValue) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tIComparable iComp = left.Value as IComparable;\n\t\t\tif (iComp == null) {\n\t\t\t\tthrow new ArgumentException(\"At least one object must implement IComparable\");\n\t\t\t}\n\t\t\treturn iComp.CompareTo(right.Value);\n\t\t}\n\n\t\tpublic static bool Equals<T>(Nullable<T> value1, Nullable<T> value2) where T : struct {\n\t\t\treturn value1.Equals(value2);\n\t\t}\n\n\t\tpublic static Type GetUnderlyingType(Type nullableType) {\n\t\t\tif (nullableType == null) {\n\t\t\t\tthrow new ArgumentNullException(\"nullableType\");\n\t\t\t}\n\t\t\tif (nullableType.IsGenericType && nullableType.GetGenericTypeDefinition() == typeof(Nullable<>)) {\n\t\t\t\treturn nullableType.GetGenericArguments()[0];\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic struct Nullable<T> where T : struct {\n\n\t\t// Note the order of these must not be changed, as the interpreter assumes this order\n\t\tprivate bool hasValue;\n\t\tprivate T value;\n\n\t\tpublic Nullable(T value) {\n\t\t\tthis.hasValue = true;\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tpublic bool HasValue {\n\t\t\tget {\n\t\t\t\treturn this.hasValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic T Value {\n\t\t\tget {\n\t\t\t\tif (!this.hasValue) {\n\t\t\t\t\tthrow new InvalidOperationException(\"Nullable object must have a value\");\n\t\t\t\t}\n\t\t\t\treturn this.value;\n\t\t\t}\n\t\t}\n\n\t\tpublic T GetValueOrDefault() {\n\t\t\treturn this.GetValueOrDefault(default(T));\n\t\t}\n\n\t\tpublic T GetValueOrDefault(T def) {\n\t\t\treturn this.hasValue ? this.value : def;\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn !this.hasValue;\n\t\t\t}\n\t\t\tNullable<T> other = obj as Nullable<T>;\n\t\t\tif (other != null) {\n\t\t\t\tif (this.hasValue && other.hasValue) {\n\t\t\t\t\t// The values are value-types, so cannot be null\n\t\t\t\t\treturn this.value.Equals(other.value);\n\t\t\t\t} else {\n\t\t\t\t\treturn this.hasValue == other.hasValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\tif (this.hasValue) {\n\t\t\t\treturn this.value.GetHashCode();\n\t\t\t} else {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\tif (this.hasValue) {\n\t\t\t\treturn this.value.ToString();\n\t\t\t} else {\n\t\t\t\treturn string.Empty;\n\t\t\t}\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/NumberFormatter.cs",
    "content": "#if !LOCALTEST\n\nusing System.Collections;\nusing System.Globalization;\nusing System.Text;\n\nnamespace System {\n\tclass NumberFormatter {\n\t\tstatic char[] digitLowerTable = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };\n\t\tstatic char[] digitUpperTable = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };\n\n\t\t#region NumberToString\n\t\tpublic static string NumberToString(string format, sbyte value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X'))\n\t\t\t\treturn FormatHexadecimal(value >= 0 ? (ulong)value : (ulong)-value, value >= 0, 1, precision, specifier == 'X');\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, byte value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X'))\n\t\t\t\treturn FormatHexadecimal(value, true, 1, precision, specifier == 'X');\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, ushort value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X'))\n\t\t\t\treturn FormatHexadecimal(value, true, 2, precision, specifier == 'X');\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, short value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X'))\n\t\t\t\treturn FormatHexadecimal(value >= 0 ? (ulong)value : (ulong)-value, value >= 0, 2, precision, specifier == 'X');\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, uint value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X'))\n\t\t\t\treturn FormatHexadecimal(value, true, 4, precision, specifier == 'X');\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, int value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X'))\n\t\t\t\treturn FormatHexadecimal(value >= 0 ? (ulong)value : (ulong)-(long)value, value >= 0, 4, precision, specifier == 'X');\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, ulong value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X'))\n\t\t\t\treturn FormatHexadecimal(value, true, 8, precision, specifier == 'X');\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, long value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X'))\n\t\t\t\treturn FormatHexadecimal(value >= 0 ? (ulong)value : (ulong)-value, value >= 0, 8, precision, specifier == 'X');\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, float value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X')) throw new FormatException();\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, double value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X')) throw new FormatException();\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, decimal value, NumberFormatInfo nfi) {\n\t\t\tchar specifier;\n\t\t\tint precision;\n\t\t\tbool custom;\n\t\t\tParseBasicFormat(format, out specifier, out precision, out custom);\n\t\t\tif (!custom && (specifier == 'x' || specifier == 'X')) throw new FormatException();\n\t\t\treturn NumberToString(format, new NumberStore(value), nfi, specifier, precision, custom);\n\t\t}\n\t\tpublic static string NumberToString(string format, NumberStore ns, NumberFormatInfo nfi, char specifier, int precision, bool custom) {\n\t\t\tif (ns.IsNaN) {\n\t\t\t\treturn nfi.NaNSymbol;\n\t\t\t}\n\t\t\tif (ns.IsInfinity) {\n\t\t\t\tif (ns.Positive)\n\t\t\t\t\treturn nfi.PositiveInfinitySymbol;\n\t\t\t\telse\n\t\t\t\t\treturn nfi.NegativeInfinitySymbol;\n\t\t\t}\n\n\t\t\tif (nfi == null)\n\t\t\t\tnfi = NumberFormatInfo.GetInstance(null);\n\n\t\t\tif (custom) {\n\t\t\t\tif (ns.IsFloatingSource)\n\t\t\t\t\tns.RoundEffectiveDigits(ns.DefaultPrecision);\n\t\t\t\treturn FormatCustom(format, ns, nfi);\n\t\t\t}\n\n\t\t\tif (ns.IsFloatingSource) {\n\t\t\t\tswitch (specifier) {\n\t\t\t\tcase 'p':\n\t\t\t\tcase 'P':\n\t\t\t\tcase 'c':\n\t\t\t\tcase 'C':\n\t\t\t\tcase 'f':\n\t\t\t\tcase 'F':\n\t\t\t\tcase 'N':\n\t\t\t\tcase 'n':\n\t\t\t\t\tns.RoundEffectiveDigits(ns.DefaultPrecision);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'g':\n\t\t\t\tcase 'G':\n\t\t\t\t\tif (precision <= 0)\n\t\t\t\t\t\tns.RoundEffectiveDigits(ns.DefaultPrecision, ns.IsBankerApplicable, true);\n\t\t\t\t\telse\n\t\t\t\t\t\tns.RoundEffectiveDigits(precision);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'r':\n\t\t\t\tcase 'R':\n\t\t\t\t\tns.RoundEffectiveDigits(ns.DefaultMaxPrecision);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (precision > ns.DefaultPrecision)\n\t\t\t\t\t\tns.RoundEffectiveDigits(precision + 1);\n\t\t\t\t\telse\n\t\t\t\t\t\tns.RoundEffectiveDigits(ns.DefaultPrecision + 1);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tswitch (specifier) {\n\t\t\tcase 'c':\n\t\t\tcase 'C':\n\t\t\t\treturn FormatCurrency(ns, precision, nfi);\n\t\t\tcase 'd':\n\t\t\tcase 'D':\n\t\t\t\treturn FormatDecimal(ns, precision, nfi);\n\t\t\tcase 'e':\n\t\t\tcase 'E':\n\t\t\t\treturn FormatExponential(ns, precision, nfi, specifier == 'E');\n\t\t\tcase 'f':\n\t\t\tcase 'F':\n\t\t\t\treturn FormatFixedPoint(ns, precision, nfi);\n\t\t\tcase 'g':\n\t\t\tcase 'G':\n\t\t\t\tif (ns.IsFloatingSource || ns.IsDecimalSource || precision != -1)\n\t\t\t\t\treturn FormatGeneral(ns, precision, nfi, specifier == 'G', false);\n\t\t\t\treturn FormatDecimal(ns, precision, nfi);\n\t\t\tcase 'n':\n\t\t\tcase 'N':\n\t\t\t\treturn FormatNumber(ns, precision, nfi);\n\t\t\tcase 'p':\n\t\t\tcase 'P':\n\t\t\t\treturn FormatPercent(ns, precision, nfi);\n\t\t\tcase 'r':\n\t\t\tcase 'R':\n\t\t\t\tif (ns.IsFloatingSource) {\n\t\t\t\t\treturn FormatGeneral(ns, ns.DefaultPrecision, nfi, true, true);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new FormatException(\"The specified format cannot be used in this instance\");\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tthrow new FormatException(\"The specified format '\" + format + \"' is invalid\");\n\t\t\t}\n\t\t}\n\t\t#endregion\n\n\t\t#region BasicParser\n\t\tprivate static void ParseBasicFormat(string format, out char specifier, out int precision, out bool custom) {\n\t\t\tif (format == null || format.Length == 0) {\n\t\t\t\tprecision = -1;\n\t\t\t\tspecifier = 'G';\n\t\t\t\tcustom = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tprecision = -1;\n\t\t\tspecifier = format[0];\n\t\t\tcustom = false;\n\n\t\t\tif (Char.IsLetter(specifier)) {\n\t\t\t\tif (format.Length == 1)\n\t\t\t\t\treturn;\n\n\t\t\t\tbool flag = true;\n\t\t\t\tprecision = 0;\n\t\t\t\tfor (int i = 1; i < format.Length; i++) {\n\t\t\t\t\tchar c = format[i];\n\t\t\t\t\tif (char.IsDigit(c)) {\n\t\t\t\t\t\tprecision = precision * 10 + (c - '0');\n\t\t\t\t\t\tif (precision > 99) {\n\t\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tflag = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (flag)\n\t\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcustom = true;\n\t\t\treturn;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Helpers\n\t\tprivate static void ZeroTrimEnd(StringBuilder sb) {\n\t\t\tZeroTrimEnd(sb, false);\n\t\t}\n\t\tprivate static void ZeroTrimEnd(StringBuilder sb, bool canEmpty) {\n\t\t\tint len = 0;\n\t\t\tfor (int i = sb.Length - 1; (canEmpty ? i >= 0 : i > 0); i--) {\n\t\t\t\tif (sb[i] != '0')\n\t\t\t\t\tbreak;\n\t\t\t\tlen++;\n\t\t\t}\n\n\t\t\tif (len > 0)\n\t\t\t\tsb.Remove(sb.Length - len, len);\n\t\t}\n\t\t#endregion\n\n\t\t#region Basic\n\t\tinternal static string FormatCurrency(NumberStore ns, int precision, NumberFormatInfo nfi) {\n\t\t\tprecision = (precision >= 0 ? precision : nfi.CurrencyDecimalDigits);\n\t\t\tns.RoundDecimal(precision);\n\t\t\tStringBuilder sb = new StringBuilder(ns.IntegerDigits * 2 + precision * 2 + 16);\n\t\t\tbool needNegativeSign = !ns.Positive && !ns.ZeroOnly;\n\n\t\t\tif (!needNegativeSign) {\n\t\t\t\tswitch (nfi.CurrencyPositivePattern) {\n\t\t\t\tcase 0:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (nfi.CurrencyNegativePattern) {\n\t\t\t\tcase 0:\n\t\t\t\t\tsb.Append('(');\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tsb.Append('(');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 9:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 12:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 14:\n\t\t\t\t\tsb.Append('(');\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 15:\n\t\t\t\t\tsb.Append('(');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tns.AppendIntegerStringWithGroupSeparator(sb, nfi.CurrencyGroupSizes, nfi.CurrencyGroupSeparator);\n\n\t\t\tif (precision > 0) {\n\t\t\t\tsb.Append(nfi.CurrencyDecimalSeparator);\n\t\t\t\tns.AppendDecimalString(precision, sb);\n\t\t\t}\n\n\t\t\tif (!needNegativeSign) {\n\t\t\t\tswitch (nfi.CurrencyPositivePattern) {\n\t\t\t\tcase 1:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (nfi.CurrencyNegativePattern) {\n\t\t\t\tcase 0:\n\t\t\t\t\tsb.Append(')');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(')');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 13:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 14:\n\t\t\t\t\tsb.Append(')');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 15:\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tsb.Append(nfi.CurrencySymbol);\n\t\t\t\t\tsb.Append(')');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tinternal static string FormatDecimal(NumberStore ns, int precision, NumberFormatInfo nfi) {\n\t\t\tif (ns.IsFloatingSource || ns.IsDecimalSource)\n\t\t\t\tthrow new FormatException();\n\n\t\t\tprecision = precision > 0 ? precision : 1;\n\t\t\tprecision = ns.IntegerDigits > precision ? ns.IntegerDigits : precision;\n\n\t\t\tStringBuilder sb = new StringBuilder(precision + nfi.NegativeSign.Length);\n\n\t\t\tif (!ns.Positive && !ns.CheckZeroOnlyInteger()) {\n\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t}\n\n\t\t\tns.AppendIntegerString(precision, sb);\n\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tinternal static string FormatFixedPoint(NumberStore ns, int precision, NumberFormatInfo nfi) {\n\t\t\tprecision = precision >= 0 ? precision : nfi.NumberDecimalDigits;\n\t\t\tns.RoundDecimal(precision);\n\n\t\t\tStringBuilder cb = new StringBuilder(ns.IntegerDigits + precision + nfi.NumberDecimalSeparator.Length);\n\n\t\t\tif (!ns.Positive && !ns.ZeroOnly)\n\t\t\t\tcb.Append(nfi.NegativeSign);\n\n\t\t\tns.AppendIntegerString(ns.IntegerDigits > 0 ? ns.IntegerDigits : 1, cb);\n\n\t\t\tif (precision > 0) {\n\t\t\t\tcb.Append(nfi.NumberDecimalSeparator);\n\t\t\t\tns.AppendDecimalString(precision, cb);\n\t\t\t}\n\n\t\t\treturn cb.ToString();\n\t\t}\n\n\t\tinternal static string FormatGeneral(NumberStore ns) {\n\t\t\treturn FormatGeneral(ns, -1, NumberFormatInfo.CurrentInfo, true, false);\n\t\t}\n\t\tinternal static string FormatGeneral(NumberStore ns, IFormatProvider provider) {\n\t\t\treturn FormatGeneral(ns, -1, NumberFormatInfo.GetInstance(provider), true, false);\n\t\t}\n\t\tprivate static string FormatGeneral(NumberStore ns, int precision, NumberFormatInfo nfi, bool upper, bool roundtrip) {\n\t\t\tif (ns.ZeroOnly)\n\t\t\t\treturn \"0\";\n\n\t\t\tprecision = precision > 0 ? precision : ns.DefaultPrecision;\n\n\t\t\tint exponent = 0;\n\t\t\tbool expMode = (ns.IsDecimalSource && precision == ns.DefaultPrecision ? false : (ns.IntegerDigits > precision || ns.DecimalPointPosition <= -4));\n\t\t\tif (expMode) {\n\t\t\t\twhile (!(ns.DecimalPointPosition == 1 && ns.GetChar(0) != '0')) {\n\t\t\t\t\tif (ns.DecimalPointPosition > 1) {\n\t\t\t\t\t\tns.Divide10(1);\n\t\t\t\t\t\texponent++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tns.Multiply10(1);\n\t\t\t\t\t\texponent--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprecision = precision < ns.DefaultPrecision + 2 ? (precision < ns.DefaultMaxPrecision ? precision : ns.DefaultMaxPrecision) : ns.DefaultPrecision + 2;\n\t\t\tStringBuilder cb = new StringBuilder(ns.IntegerDigits + precision + 16);\n\t\t\tif (expMode) {\n\t\t\t\tif (ns.RoundDecimal(precision - 1)) {\n\t\t\t\t\tns.Divide10(1);\n\t\t\t\t\texponent++;\n\t\t\t\t}\n\t\t\t} else if (!roundtrip) {\n\t\t\t\tif (ns.IsDecimalSource)\n\t\t\t\t\tns.RoundPos(precision);\n\t\t\t\telse\n\t\t\t\t\tns.RoundDecimal(precision, true, false);\n\t\t\t}\n\n\t\t\tif (!ns.Positive) {\n\t\t\t\tcb.Append(nfi.NegativeSign);\n\t\t\t}\n\n\t\t\tns.AppendIntegerString(ns.IntegerDigits > 0 ? ns.IntegerDigits : 1, cb);\n\n\t\t\tif (ns.DecimalDigits > 0) {\n\t\t\t\tcb.Append(nfi.NumberDecimalSeparator);\n\t\t\t\tns.AppendDecimalString(ns.DecimalDigits, cb);\n\t\t\t}\n\n\t\t\tif (expMode) {\n\t\t\t\tif (upper)\n\t\t\t\t\tcb.Append('E');\n\t\t\t\telse\n\t\t\t\t\tcb.Append('e');\n\n\t\t\t\tif (exponent >= 0)\n\t\t\t\t\tcb.Append(nfi.PositiveSign);\n\t\t\t\telse {\n\t\t\t\t\tcb.Append(nfi.NegativeSign);\n\t\t\t\t\texponent = -exponent;\n\t\t\t\t}\n\n\t\t\t\tif (exponent == 0) {\n\t\t\t\t\tcb.Append('0', 2);\n\t\t\t\t} else if (exponent < 10) {\n\t\t\t\t\tcb.Append('0');\n\t\t\t\t\tcb.Append(digitLowerTable[exponent]);\n\t\t\t\t} else if (exponent < 100) {\n\t\t\t\t\tcb.Append(digitLowerTable[exponent / 10 % 10]);\n\t\t\t\t\tcb.Append(digitLowerTable[exponent % 10]);\n\t\t\t\t} else if (exponent < 1000) {\n\t\t\t\t\tcb.Append(digitLowerTable[exponent / 100 % 10]);\n\t\t\t\t\tcb.Append(digitLowerTable[exponent / 10 % 10]);\n\t\t\t\t\tcb.Append(digitLowerTable[exponent % 10]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn cb.ToString();\n\t\t}\n\t\tinternal static string FormatNumber(NumberStore ns, int precision, NumberFormatInfo nfi) {\n\t\t\tprecision = (precision >= 0 ? precision : nfi.NumberDecimalDigits);\n\t\t\tStringBuilder sb = new StringBuilder(ns.IntegerDigits * 3 + precision);\n\n\t\t\tns.RoundDecimal(precision);\n\t\t\tbool needNegativeSign = (!ns.Positive && !ns.ZeroOnly);\n\n\t\t\tif (needNegativeSign) {\n\t\t\t\tswitch (nfi.NumberNegativePattern) {\n\t\t\t\tcase 0:\n\t\t\t\t\tsb.Append('(');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tns.AppendIntegerStringWithGroupSeparator(sb, nfi.NumberGroupSizes, nfi.NumberGroupSeparator);\n\n\t\t\tif (precision > 0) {\n\t\t\t\tsb.Append(nfi.NumberDecimalSeparator);\n\t\t\t\tns.AppendDecimalString(precision, sb);\n\t\t\t}\n\n\t\t\tif (needNegativeSign) {\n\t\t\t\tswitch (nfi.NumberNegativePattern) {\n\t\t\t\tcase 0:\n\t\t\t\t\tsb.Append(')');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tinternal static string FormatPercent(NumberStore ns, int precision, NumberFormatInfo nfi) {\n\t\t\tprecision = (precision >= 0 ? precision : nfi.PercentDecimalDigits);\n\t\t\tns.Multiply10(2);\n\t\t\tns.RoundDecimal(precision);\n\t\t\tbool needNegativeSign = (!ns.Positive && !ns.ZeroOnly);\n\n\t\t\tStringBuilder sb = new StringBuilder(ns.IntegerDigits * 2 + precision + 16);\n\n\t\t\tif (!needNegativeSign) {\n\t\t\t\tif (nfi.PercentPositivePattern == 2) {\n\t\t\t\t\tsb.Append(nfi.PercentSymbol);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (nfi.PercentNegativePattern) {\n\t\t\t\tcase 0:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tsb.Append(nfi.NegativeSign);\n\t\t\t\t\tsb.Append(nfi.PercentSymbol);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tns.AppendIntegerStringWithGroupSeparator(sb, nfi.PercentGroupSizes, nfi.PercentGroupSeparator);\n\n\t\t\tif (precision > 0) {\n\t\t\t\tsb.Append(nfi.PercentDecimalSeparator);\n\t\t\t\tns.AppendDecimalString(precision, sb);\n\t\t\t}\n\n\t\t\tif (!needNegativeSign) {\n\t\t\t\tswitch (nfi.PercentPositivePattern) {\n\t\t\t\tcase 0:\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tsb.Append(nfi.PercentSymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tsb.Append(nfi.PercentSymbol);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (nfi.PercentNegativePattern) {\n\t\t\t\tcase 0:\n\t\t\t\t\tsb.Append(' ');\n\t\t\t\t\tsb.Append(nfi.PercentSymbol);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tsb.Append(nfi.PercentSymbol);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn sb.ToString();\n\t\t}\n\t\tstatic string FormatHexadecimal(ulong value, bool positive, int byteSize, int precision, bool upper) {\n\t\t\tif (!positive) {\n\t\t\t\tswitch (byteSize) {\n\t\t\t\tcase 1:\n\t\t\t\t\tvalue = (ulong)(256UL - value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tvalue = (ulong)(65536UL - value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\tvalue = (ulong)(4294967296UL - value);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tvalue = 0 - value;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tchar[] digits = (upper ? digitUpperTable : digitLowerTable);\n\t\t\tint size = precision > 16 ? precision : 16;\n\t\t\t/*char* buffer = stackalloc char[size];\n\t\t\tchar* last = buffer + size;\n\t\t\tchar* ptr = last;\n\n\t\t\twhile (value > 0) {\n\t\t\t\t*--ptr = digits[value & 0xF];\n\t\t\t\tvalue >>= 4;\n\t\t\t}\n\n\t\t\twhile (ptr == last || last - ptr < precision)\n\t\t\t\t*--ptr = '0';\n\n\t\t\treturn new string(ptr, 0, (int)(last - ptr));*/\n\t\t\tchar[] buffer = new char[size];\n\t\t\tint idx = size;\n\t\t\twhile (value > 0) {\n\t\t\t\tuint valTemp = (uint)value;\n\t\t\t\tvalTemp &= 0xf;\n\t\t\t\tbuffer[--idx] = digits[valTemp];\n\t\t\t\tvalue >>= 4;\n\t\t\t}\n\t\t\twhile (idx == size || size - idx < precision) {\n\t\t\t\tbuffer[--idx] = '0';\n\t\t\t}\n\t\t\treturn new string(buffer, idx, size - idx);\n\t\t}\n\t\tinternal static string FormatExponential(NumberStore ns, int precision, NumberFormatInfo nfi, bool upper) {\n\t\t\tif (precision < 0)\n\t\t\t\tprecision = 6;\n\n\t\t\tif (ns.ZeroOnly) {\n\t\t\t\tStringBuilder sb = new StringBuilder(precision + nfi.PositiveSign.Length + 6);\n\t\t\t\tsb.Append('0');\n\t\t\t\tif (precision > 0) {\n\t\t\t\t\tsb.Append('.');\n\t\t\t\t\tsb.Append('0', precision);\n\t\t\t\t}\n\n\t\t\t\tif (upper)\n\t\t\t\t\tsb.Append('E');\n\t\t\t\telse\n\t\t\t\t\tsb.Append('e');\n\n\t\t\t\tsb.Append(nfi.PositiveSign);\n\t\t\t\tsb.Append('0', 3);\n\n\t\t\t\treturn sb.ToString();\n\t\t\t}\n\n\t\t\tint exponent = 0;\n\t\t\twhile (!(ns.DecimalPointPosition == 1 && ns.GetChar(0) != '0')) {\n\t\t\t\tif (ns.DecimalPointPosition > 1) {\n\t\t\t\t\tns.Divide10(1);\n\t\t\t\t\texponent++;\n\t\t\t\t} else {\n\t\t\t\t\tns.Multiply10(1);\n\t\t\t\t\texponent--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (ns.RoundDecimal(precision)) {\n\t\t\t\tns.Divide10(1);\n\t\t\t\texponent++;\n\t\t\t}\n\n\t\t\tStringBuilder cb = new StringBuilder(ns.DecimalDigits + 1 + 8);\n\n\t\t\tif (!ns.Positive) {\n\t\t\t\tcb.Append(nfi.NegativeSign);\n\t\t\t}\n\n\t\t\tns.AppendIntegerString(ns.IntegerDigits > 0 ? ns.IntegerDigits : 1, cb);\n\n\t\t\tif (precision > 0) {\n\t\t\t\tcb.Append(nfi.NumberDecimalSeparator);\n\t\t\t\tns.AppendDecimalString(precision, cb);\n\t\t\t}\n\n\t\t\tif (upper)\n\t\t\t\tcb.Append('E');\n\t\t\telse\n\t\t\t\tcb.Append('e');\n\n\t\t\tif (exponent >= 0)\n\t\t\t\tcb.Append(nfi.PositiveSign);\n\t\t\telse {\n\t\t\t\tcb.Append(nfi.NegativeSign);\n\t\t\t\texponent = -exponent;\n\t\t\t}\n\n\t\t\tif (exponent == 0) {\n\t\t\t\tcb.Append('0', 3);\n\t\t\t} else if (exponent < 10) {\n\t\t\t\tcb.Append('0', 2);\n\t\t\t\tcb.Append(digitLowerTable[exponent]);\n\t\t\t} else if (exponent < 100) {\n\t\t\t\tcb.Append('0', 1);\n\t\t\t\tcb.Append(digitLowerTable[exponent / 10 % 10]);\n\t\t\t\tcb.Append(digitLowerTable[exponent % 10]);\n\t\t\t} else if (exponent < 1000) {\n\t\t\t\tcb.Append(digitLowerTable[exponent / 100 % 10]);\n\t\t\t\tcb.Append(digitLowerTable[exponent / 10 % 10]);\n\t\t\t\tcb.Append(digitLowerTable[exponent % 10]);\n\t\t\t\t/*} else { // exponent range is 0...+-324\n\t\t\t\t\tint pos = cb.Length;\n\t\t\t\t\tint count = 3;\n\t\t\t\t\twhile (exponent > 0 || --count > 0) {\n\t\t\t\t\t\tcb.Insert (pos, digitLowerTable [exponent % 10]);\n\t\t\t\t\t\texponent /= 10;\n\t\t\t\t\t}*/\n\t\t\t}\n\n\t\t\treturn cb.ToString();\n\t\t}\n\t\t#endregion\n\n\t\t#region Custom\n\t\tinternal static string FormatCustom(string format, NumberStore ns, NumberFormatInfo nfi) {\n\t\t\tbool p = ns.Positive;\n\t\t\tint offset = 0;\n\t\t\tint length = 0;\n\t\t\tCustomInfo.GetActiveSection(format, ref p, ns.ZeroOnly, ref offset, ref length);\n\t\t\tif (length == 0) {\n\t\t\t\treturn ns.Positive ? String.Empty : nfi.NegativeSign;\n\t\t\t}\n\t\t\tns.Positive = p;\n\n\t\t\tCustomInfo info = CustomInfo.Parse(format, offset, length, nfi);\n#if false\n\t\t\tConsole.WriteLine(\"Format : {0}\",format);\n\t\t\tConsole.WriteLine(\"DecimalDigits : {0}\",info.DecimalDigits);\n\t\t\tConsole.WriteLine(\"DecimalPointPos : {0}\",info.DecimalPointPos);\n\t\t\tConsole.WriteLine(\"DecimalTailSharpDigits : {0}\",info.DecimalTailSharpDigits);\n\t\t\tConsole.WriteLine(\"IntegerDigits : {0}\",info.IntegerDigits);\n\t\t\tConsole.WriteLine(\"IntegerHeadSharpDigits : {0}\",info.IntegerHeadSharpDigits);\n\t\t\tConsole.WriteLine(\"IntegerHeadPos : {0}\",info.IntegerHeadPos);\n\t\t\tConsole.WriteLine(\"UseExponent : {0}\",info.UseExponent);\n\t\t\tConsole.WriteLine(\"ExponentDigits : {0}\",info.ExponentDigits);\n\t\t\tConsole.WriteLine(\"ExponentTailSharpDigits : {0}\",info.ExponentTailSharpDigits);\n\t\t\tConsole.WriteLine(\"ExponentNegativeSignOnly : {0}\",info.ExponentNegativeSignOnly);\n\t\t\tConsole.WriteLine(\"DividePlaces : {0}\",info.DividePlaces);\n\t\t\tConsole.WriteLine(\"Percents : {0}\",info.Percents);\n\t\t\tConsole.WriteLine(\"Permilles : {0}\",info.Permilles);\n#endif\n\t\t\tStringBuilder sb_int = new StringBuilder(info.IntegerDigits * 2);\n\t\t\tStringBuilder sb_dec = new StringBuilder(info.DecimalDigits * 2);\n\t\t\tStringBuilder sb_exp = (info.UseExponent ? new StringBuilder(info.ExponentDigits * 2) : null);\n\n\t\t\tint diff = 0;\n\t\t\tif (info.Percents > 0) {\n\t\t\t\tns.Multiply10(2 * info.Percents);\n\t\t\t}\n\t\t\tif (info.Permilles > 0) {\n\t\t\t\tns.Multiply10(3 * info.Permilles);\n\t\t\t}\n\t\t\tif (info.DividePlaces > 0) {\n\t\t\t\tns.Divide10(info.DividePlaces);\n\t\t\t}\n\n\t\t\tbool expPositive = true;\n\t\t\tif (info.UseExponent && (info.DecimalDigits > 0 || info.IntegerDigits > 0)) {\n\t\t\t\tif (!ns.ZeroOnly) {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\twhile (ns.IntegerDigits > info.IntegerDigits) {\n\t\t\t\t\t\t\tns.Divide10(1);\n\t\t\t\t\t\t\tdiff--;\n\t\t\t\t\t\t\tif (ns.IntegerDigits == 1 && ns.GetChar(0) == '0')\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\twhile (ns.IntegerDigits < info.IntegerDigits || (ns.IntegerDigits == info.IntegerDigits && ns.GetChar(0) == '0')) {\n\t\t\t\t\t\t\tns.Multiply10(1);\n\t\t\t\t\t\t\tdiff++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!ns.RoundDecimal(info.DecimalDigits))\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\texpPositive = diff <= 0;\n\t\t\t\tNumberStore.AppendIntegerStringFromUInt32(sb_exp, (uint)(diff >= 0 ? diff : -diff));\n\t\t\t} else {\n\t\t\t\tns.RoundDecimal(info.DecimalDigits);\n\t\t\t\tif (ns.ZeroOnly)\n\t\t\t\t\tns.Positive = true;\n\t\t\t}\n\n\t\t\tif (info.IntegerDigits != 0 || !ns.CheckZeroOnlyInteger()) {\n\t\t\t\tns.AppendIntegerString(ns.IntegerDigits, sb_int);\n\t\t\t}\n\t\t\t/* if (sb_int.Length > info.IntegerDigits) {\n\t\t\t\tint len = 0;\n\t\t\t\twhile (sb_int.Length > info.IntegerDigits && len < sb_int.Length) {\n\t\t\t\t\tif (sb_int [len] == '0')\n\t\t\t\t\t\tlen ++;\n\t\t\t\t\telse\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tsb_int.Remove (0, len);\n\t\t\t} */\n\n\t\t\tns.AppendDecimalString(ns.DecimalDigits, sb_dec);\n\n\t\t\tif (info.UseExponent) {\n\t\t\t\tif (info.DecimalDigits <= 0 && info.IntegerDigits <= 0)\n\t\t\t\t\tns.Positive = true;\n\n\t\t\t\tif (sb_int.Length < info.IntegerDigits)\n\t\t\t\t\tsb_int.Insert(0, \"0\", info.IntegerDigits - sb_int.Length);\n\n\t\t\t\twhile (sb_exp.Length < info.ExponentDigits - info.ExponentTailSharpDigits)\n\t\t\t\t\tsb_exp.Insert(0, '0');\n\n\t\t\t\tif (expPositive && !info.ExponentNegativeSignOnly)\n\t\t\t\t\tsb_exp.Insert(0, nfi.PositiveSign);\n\t\t\t\telse if (!expPositive)\n\t\t\t\t\tsb_exp.Insert(0, nfi.NegativeSign);\n\t\t\t} else {\n\t\t\t\tif (sb_int.Length < info.IntegerDigits - info.IntegerHeadSharpDigits)\n\t\t\t\t\tsb_int.Insert(0, \"0\", info.IntegerDigits - info.IntegerHeadSharpDigits - sb_int.Length);\n\t\t\t\tif (info.IntegerDigits == info.IntegerHeadSharpDigits && NumberStore.IsZeroOnly(sb_int))\n\t\t\t\t\tsb_int.Remove(0, sb_int.Length);\n\t\t\t}\n\n\t\t\tZeroTrimEnd(sb_dec, true);\n\t\t\twhile (sb_dec.Length < info.DecimalDigits - info.DecimalTailSharpDigits)\n\t\t\t\tsb_dec.Append('0');\n\t\t\tif (sb_dec.Length > info.DecimalDigits)\n\t\t\t\tsb_dec.Remove(info.DecimalDigits, sb_dec.Length - info.DecimalDigits);\n\n\t\t\treturn info.Format(format, offset, length, nfi, ns.Positive, sb_int, sb_dec, sb_exp);\n\t\t}\n\n\t\tprivate class CustomInfo {\n\t\t\tpublic bool UseGroup = false;\n\t\t\tpublic int DecimalDigits = 0;\n\t\t\tpublic int DecimalPointPos = -1;\n\t\t\tpublic int DecimalTailSharpDigits = 0;\n\t\t\tpublic int IntegerDigits = 0;\n\t\t\tpublic int IntegerHeadSharpDigits = 0;\n\t\t\tpublic int IntegerHeadPos = 0;\n\t\t\tpublic bool UseExponent = false;\n\t\t\tpublic int ExponentDigits = 0;\n\t\t\tpublic int ExponentTailSharpDigits = 0;\n\t\t\tpublic bool ExponentNegativeSignOnly = true;\n\t\t\tpublic int DividePlaces = 0;\n\t\t\tpublic int Percents = 0;\n\t\t\tpublic int Permilles = 0;\n\n\t\t\tpublic static void GetActiveSection(string format, ref bool positive, bool zero, ref int offset, ref int length) {\n\t\t\t\tint[] lens = new int[3];\n\t\t\t\tint index = 0;\n\t\t\t\tint lastPos = 0;\n\t\t\t\tchar literal = '\\0';\n\t\t\t\tfor (int i = 0; i < format.Length; i++) {\n\t\t\t\t\tchar c = format[i];\n\n\t\t\t\t\tif (c == literal || (literal == '\\0' && (c == '\\\"' || c == '\\''))) {\n\t\t\t\t\t\tif (literal == '\\0')\n\t\t\t\t\t\t\tliteral = c;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tliteral = '\\0';\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (literal == '\\0' && format[i] == ';' && (i == 0 || format[i - 1] != '\\\\')) {\n\t\t\t\t\t\tlens[index++] = i - lastPos;\n\t\t\t\t\t\tlastPos = i + 1;\n\t\t\t\t\t\tif (index == 3)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (index == 0) {\n\t\t\t\t\toffset = 0;\n\t\t\t\t\tlength = format.Length;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (index == 1) {\n\t\t\t\t\tif (positive || zero) {\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tlength = lens[0];\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (lens[0] + 1 < format.Length) {\n\t\t\t\t\t\tpositive = true;\n\t\t\t\t\t\toffset = lens[0] + 1;\n\t\t\t\t\t\tlength = format.Length - offset;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tlength = lens[0];\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (index == 2) {\n\t\t\t\t\tif (zero) {\n\t\t\t\t\t\toffset = lens[0] + lens[1] + 2;\n\t\t\t\t\t\tlength = format.Length - offset;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (positive) {\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tlength = lens[0];\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (lens[1] > 0) {\n\t\t\t\t\t\tpositive = true;\n\t\t\t\t\t\toffset = lens[0] + 1;\n\t\t\t\t\t\tlength = lens[1];\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tlength = lens[0];\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (index == 3) {\n\t\t\t\t\tif (zero) {\n\t\t\t\t\t\toffset = lens[0] + lens[1] + 2;\n\t\t\t\t\t\tlength = lens[2];\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (positive) {\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tlength = lens[0];\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (lens[1] > 0) {\n\t\t\t\t\t\tpositive = true;\n\t\t\t\t\t\toffset = lens[0] + 1;\n\t\t\t\t\t\tlength = lens[1];\n\t\t\t\t\t\treturn;\n\t\t\t\t\t} else {\n\t\t\t\t\t\toffset = 0;\n\t\t\t\t\t\tlength = lens[0];\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\n\t\t\tpublic static CustomInfo Parse(string format, int offset, int length, NumberFormatInfo nfi) {\n\t\t\t\tchar literal = '\\0';\n\t\t\t\tbool integerArea = true;\n\t\t\t\tbool decimalArea = false;\n\t\t\t\tbool exponentArea = false;\n\t\t\t\tbool sharpContinues = true;\n\n\t\t\t\tCustomInfo info = new CustomInfo();\n\t\t\t\tint groupSeparatorCounter = 0;\n\n\t\t\t\tfor (int i = offset; i - offset < length; i++) {\n\t\t\t\t\tchar c = format[i];\n\n\t\t\t\t\tif (c == literal && c != '\\0') {\n\t\t\t\t\t\tliteral = '\\0';\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (literal != '\\0')\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\tif (exponentArea && (c != '\\0' && c != '0' && c != '#')) {\n\t\t\t\t\t\texponentArea = false;\n\t\t\t\t\t\tintegerArea = (info.DecimalPointPos < 0);\n\t\t\t\t\t\tdecimalArea = !integerArea;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (c) {\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase '\\'':\n\t\t\t\t\tcase '\\\"':\n\t\t\t\t\t\tif (c == '\\\"' || c == '\\'') {\n\t\t\t\t\t\t\tliteral = c;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase '#':\n\t\t\t\t\t\tif (sharpContinues && integerArea)\n\t\t\t\t\t\t\tinfo.IntegerHeadSharpDigits++;\n\t\t\t\t\t\telse if (decimalArea)\n\t\t\t\t\t\t\tinfo.DecimalTailSharpDigits++;\n\t\t\t\t\t\telse if (exponentArea)\n\t\t\t\t\t\t\tinfo.ExponentTailSharpDigits++;\n\n\t\t\t\t\t\tgoto case '0';\n\t\t\t\t\tcase '0':\n\t\t\t\t\t\tif (c != '#') {\n\t\t\t\t\t\t\tsharpContinues = false;\n\t\t\t\t\t\t\tif (decimalArea)\n\t\t\t\t\t\t\t\tinfo.DecimalTailSharpDigits = 0;\n\t\t\t\t\t\t\telse if (exponentArea)\n\t\t\t\t\t\t\t\tinfo.ExponentTailSharpDigits = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (info.IntegerHeadPos == -1)\n\t\t\t\t\t\t\tinfo.IntegerHeadPos = i;\n\n\t\t\t\t\t\tif (integerArea) {\n\t\t\t\t\t\t\tinfo.IntegerDigits++;\n\t\t\t\t\t\t\tif (groupSeparatorCounter > 0)\n\t\t\t\t\t\t\t\tinfo.UseGroup = true;\n\t\t\t\t\t\t\tgroupSeparatorCounter = 0;\n\t\t\t\t\t\t} else if (decimalArea) {\n\t\t\t\t\t\t\tinfo.DecimalDigits++;\n\t\t\t\t\t\t} else if (exponentArea) {\n\t\t\t\t\t\t\tinfo.ExponentDigits++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'e':\n\t\t\t\t\tcase 'E':\n\t\t\t\t\t\tif (info.UseExponent)\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tinfo.UseExponent = true;\n\t\t\t\t\t\tintegerArea = false;\n\t\t\t\t\t\tdecimalArea = false;\n\t\t\t\t\t\texponentArea = true;\n\t\t\t\t\t\tif (i + 1 - offset < length) {\n\t\t\t\t\t\t\tchar nc = format[i + 1];\n\t\t\t\t\t\t\tif (nc == '+')\n\t\t\t\t\t\t\t\tinfo.ExponentNegativeSignOnly = false;\n\t\t\t\t\t\t\tif (nc == '+' || nc == '-') {\n\t\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\t} else if (nc != '0' && nc != '#') {\n\t\t\t\t\t\t\t\tinfo.UseExponent = false;\n\t\t\t\t\t\t\t\tif (info.DecimalPointPos < 0)\n\t\t\t\t\t\t\t\t\tintegerArea = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tc = '\\0';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '.':\n\t\t\t\t\t\tintegerArea = false;\n\t\t\t\t\t\tdecimalArea = true;\n\t\t\t\t\t\texponentArea = false;\n\t\t\t\t\t\tif (info.DecimalPointPos == -1)\n\t\t\t\t\t\t\tinfo.DecimalPointPos = i;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '%':\n\t\t\t\t\t\tinfo.Percents++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\\u2030':\n\t\t\t\t\t\tinfo.Permilles++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ',':\n\t\t\t\t\t\tif (integerArea && info.IntegerDigits > 0)\n\t\t\t\t\t\t\tgroupSeparatorCounter++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (info.ExponentDigits == 0)\n\t\t\t\t\tinfo.UseExponent = false;\n\t\t\t\telse\n\t\t\t\t\tinfo.IntegerHeadSharpDigits = 0;\n\n\t\t\t\tif (info.DecimalDigits == 0)\n\t\t\t\t\tinfo.DecimalPointPos = -1;\n\n\t\t\t\tinfo.DividePlaces += groupSeparatorCounter * 3;\n\n\t\t\t\treturn info;\n\t\t\t}\n\n\t\t\tpublic string Format(string format, int offset, int length, NumberFormatInfo nfi, bool positive, StringBuilder sb_int, StringBuilder sb_dec, StringBuilder sb_exp) {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tchar literal = '\\0';\n\t\t\t\tbool integerArea = true;\n\t\t\t\tbool decimalArea = false;\n\t\t\t\tint intSharpCounter = 0;\n\t\t\t\tint sb_int_index = 0;\n\t\t\t\tint sb_dec_index = 0;\n\n\t\t\t\tint[] groups = nfi.NumberGroupSizes;\n\t\t\t\tstring groupSeparator = nfi.NumberGroupSeparator;\n\t\t\t\tint intLen = 0, total = 0, groupIndex = 0, counter = 0, groupSize = 0, fraction = 0;\n\t\t\t\tif (UseGroup && groups.Length > 0) {\n\t\t\t\t\tintLen = sb_int.Length;\n\t\t\t\t\tfor (int i = 0; i < groups.Length; i++) {\n\t\t\t\t\t\ttotal += groups[i];\n\t\t\t\t\t\tif (total <= intLen)\n\t\t\t\t\t\t\tgroupIndex = i;\n\t\t\t\t\t}\n\t\t\t\t\tgroupSize = groups[groupIndex];\n\t\t\t\t\tfraction = intLen > total ? intLen - total : 0;\n\t\t\t\t\tif (groupSize == 0) {\n\t\t\t\t\t\twhile (groupIndex >= 0 && groups[groupIndex] == 0)\n\t\t\t\t\t\t\tgroupIndex--;\n\n\t\t\t\t\t\tgroupSize = fraction > 0 ? fraction : groups[groupIndex];\n\t\t\t\t\t}\n\t\t\t\t\tif (fraction == 0) {\n\t\t\t\t\t\tcounter = groupSize;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgroupIndex += fraction / groupSize;\n\t\t\t\t\t\tcounter = fraction % groupSize;\n\t\t\t\t\t\tif (counter == 0)\n\t\t\t\t\t\t\tcounter = groupSize;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tgroupIndex++;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tUseGroup = false;\n\t\t\t\t}\n\n\t\t\t\tfor (int i = offset; i - offset < length; i++) {\n\t\t\t\t\tchar c = format[i];\n\n\t\t\t\t\tif (c == literal && c != '\\0') {\n\t\t\t\t\t\tliteral = '\\0';\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif (literal != '\\0') {\n\t\t\t\t\t\tsb.Append(c);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tswitch (c) {\n\t\t\t\t\tcase '\\\\':\n\t\t\t\t\t\ti++;\n\t\t\t\t\t\tif (i - offset < length)\n\t\t\t\t\t\t\tsb.Append(format[i]);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase '\\'':\n\t\t\t\t\tcase '\\\"':\n\t\t\t\t\t\tif (c == '\\\"' || c == '\\'') {\n\t\t\t\t\t\t\tliteral = c;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tcase '#':\n\t\t\t\t\t\tgoto case '0';\n\t\t\t\t\tcase '0':\n\t\t\t\t\t\tif (integerArea) {\n\t\t\t\t\t\t\tintSharpCounter++;\n\t\t\t\t\t\t\tif (IntegerDigits - intSharpCounter < sb_int.Length + sb_int_index || c == '0')\n\t\t\t\t\t\t\t\twhile (IntegerDigits - intSharpCounter + sb_int_index < sb_int.Length) {\n\t\t\t\t\t\t\t\t\tsb.Append(sb_int[sb_int_index++]);\n\t\t\t\t\t\t\t\t\tif (UseGroup && --intLen > 0 && --counter == 0) {\n\t\t\t\t\t\t\t\t\t\tsb.Append(groupSeparator);\n\t\t\t\t\t\t\t\t\t\tif (--groupIndex < groups.Length && groupIndex >= 0)\n\t\t\t\t\t\t\t\t\t\t\tgroupSize = groups[groupIndex];\n\t\t\t\t\t\t\t\t\t\tcounter = groupSize;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else if (decimalArea) {\n\t\t\t\t\t\t\tif (sb_dec_index < sb_dec.Length)\n\t\t\t\t\t\t\t\tsb.Append(sb_dec[sb_dec_index++]);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsb.Append(c);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'e':\n\t\t\t\t\tcase 'E':\n\t\t\t\t\t\tif (sb_exp == null || !UseExponent) {\n\t\t\t\t\t\t\tsb.Append(c);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbool flag1 = true;\n\t\t\t\t\t\tbool flag2 = false;\n\n\t\t\t\t\t\tint q;\n\t\t\t\t\t\tfor (q = i + 1; q - offset < length; q++) {\n\t\t\t\t\t\t\tif (format[q] == '0') {\n\t\t\t\t\t\t\t\tflag2 = true;\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (q == i + 1 && (format[q] == '+' || format[q] == '-')) {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!flag2)\n\t\t\t\t\t\t\t\tflag1 = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (flag1) {\n\t\t\t\t\t\t\ti = q - 1;\n\t\t\t\t\t\t\tintegerArea = (DecimalPointPos < 0);\n\t\t\t\t\t\t\tdecimalArea = !integerArea;\n\n\t\t\t\t\t\t\tsb.Append(c);\n\t\t\t\t\t\t\tsb.Append(sb_exp);\n\t\t\t\t\t\t\tsb_exp = null;\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\tsb.Append(c);\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '.':\n\t\t\t\t\t\tif (DecimalPointPos == i) {\n\t\t\t\t\t\t\tif (DecimalDigits > 0) {\n\t\t\t\t\t\t\t\twhile (sb_int_index < sb_int.Length)\n\t\t\t\t\t\t\t\t\tsb.Append(sb_int[sb_int_index++]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (sb_dec.Length > 0)\n\t\t\t\t\t\t\t\tsb.Append(nfi.NumberDecimalSeparator);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tintegerArea = false;\n\t\t\t\t\t\tdecimalArea = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase ',':\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '%':\n\t\t\t\t\t\tsb.Append(nfi.PercentSymbol);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '\\u2030':\n\t\t\t\t\t\tsb.Append(nfi.PerMilleSymbol);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tsb.Append(c);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!positive)\n\t\t\t\t\tsb.Insert(0, nfi.NegativeSign);\n\n\t\t\t\treturn sb.ToString();\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Internal structures\n\t\tinternal struct NumberStore {\n\t\t\tbool _NaN;\n\t\t\tbool _infinity;\n\t\t\tbool _positive;\n\t\t\tint _decPointPos;\n\t\t\tint _defPrecision;\n\t\t\tint _defMaxPrecision;\n\t\t\tint _defByteSize;\n\n\t\t\tbyte[] _digits;\n\n\t\t\tstatic uint[] IntList = new uint[] {\n\t\t\t\t1,\n\t\t\t\t10,\n\t\t\t\t100,\n\t\t\t\t1000,\n\t\t\t\t10000,\n\t\t\t\t100000,\n\t\t\t\t1000000,\n\t\t\t\t10000000,\n\t\t\t\t100000000,\n\t\t\t\t1000000000,\n\t\t\t};\n\n\t\t\tstatic ulong[] ULongList = new ulong[] {\n\t\t\t\t1,\n\t\t\t\t10,\n\t\t\t\t100,\n\t\t\t\t1000,\n\t\t\t\t10000,\n\t\t\t\t100000,\n\t\t\t\t1000000,\n\t\t\t\t10000000,\n\t\t\t\t100000000,\n\t\t\t\t1000000000,\n\t\t\t\t10000000000,\n\t\t\t\t100000000000,\n\t\t\t\t1000000000000,\n\t\t\t\t10000000000000,\n\t\t\t\t100000000000000,\n\t\t\t\t1000000000000000,\n\t\t\t\t10000000000000000,\n\t\t\t\t100000000000000000,\n\t\t\t\t1000000000000000000,\n\t\t\t\t10000000000000000000,\n\t\t\t};\n\n\t\t\t#region Constructors\n\t\t\tpublic NumberStore(long value) {\n\t\t\t\t_infinity = _NaN = false;\n\t\t\t\t_defByteSize = 8;\n\t\t\t\t_defMaxPrecision = _defPrecision = 19;\n\t\t\t\t_positive = value >= 0;\n\n\t\t\t\tif (value == 0) {\n\t\t\t\t\t_digits = new byte[] { 0 };\n\t\t\t\t\t_decPointPos = 1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tulong v = (ulong)(_positive ? value : -value);\n\n\t\t\t\tint i = 18, j = 0;\n\n\t\t\t\tif (v < 10)\n\t\t\t\t\ti = 0;\n\t\t\t\telse if (v < 100)\n\t\t\t\t\ti = 1;\n\t\t\t\telse if (v < 1000)\n\t\t\t\t\ti = 2;\n\t\t\t\telse if (v < 10000)\n\t\t\t\t\ti = 3;\n\t\t\t\telse if (v < 100000)\n\t\t\t\t\ti = 4;\n\t\t\t\telse if (v < 1000000)\n\t\t\t\t\ti = 5;\n\t\t\t\telse if (v < 10000000)\n\t\t\t\t\ti = 6;\n\t\t\t\telse if (v < 100000000)\n\t\t\t\t\ti = 7;\n\t\t\t\telse if (v < 1000000000)\n\t\t\t\t\ti = 8;\n\t\t\t\telse if (v < 10000000000)\n\t\t\t\t\ti = 9;\n\t\t\t\telse if (v < 100000000000)\n\t\t\t\t\ti = 10;\n\t\t\t\telse if (v < 1000000000000)\n\t\t\t\t\ti = 11;\n\t\t\t\telse if (v < 10000000000000)\n\t\t\t\t\ti = 12;\n\t\t\t\telse if (v < 100000000000000)\n\t\t\t\t\ti = 13;\n\t\t\t\telse if (v < 1000000000000000)\n\t\t\t\t\ti = 14;\n\t\t\t\telse if (v < 10000000000000000)\n\t\t\t\t\ti = 15;\n\t\t\t\telse if (v < 100000000000000000)\n\t\t\t\t\ti = 16;\n\t\t\t\telse if (v < 1000000000000000000)\n\t\t\t\t\ti = 17;\n\t\t\t\telse\n\t\t\t\t\ti = 18;\n\n\t\t\t\t_digits = new byte[i + 1];\n\t\t\t\tdo {\n\t\t\t\t\tulong n = v / ULongList[i];\n\t\t\t\t\t_digits[j++] = (byte)n;\n\t\t\t\t\tv -= ULongList[i--] * n;\n\t\t\t\t} while (i >= 0);\n\n\t\t\t\t_decPointPos = _digits.Length;\n\t\t\t}\n\t\t\tpublic NumberStore(int value) {\n\t\t\t\t_infinity = _NaN = false;\n\t\t\t\t_defByteSize = 4;\n\t\t\t\t_defMaxPrecision = _defPrecision = 10;\n\t\t\t\t_positive = value >= 0;\n\n\t\t\t\tif (value == 0) {\n\t\t\t\t\t_digits = new byte[] { 0 };\n\t\t\t\t\t_decPointPos = 1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tuint v = (uint)(_positive ? value : -value);\n\n\t\t\t\tint i = 9, j = 0;\n\n\t\t\t\tif (v < 10)\n\t\t\t\t\ti = 0;\n\t\t\t\telse if (v < 100)\n\t\t\t\t\ti = 1;\n\t\t\t\telse if (v < 1000)\n\t\t\t\t\ti = 2;\n\t\t\t\telse if (v < 10000)\n\t\t\t\t\ti = 3;\n\t\t\t\telse if (v < 100000)\n\t\t\t\t\ti = 4;\n\t\t\t\telse if (v < 1000000)\n\t\t\t\t\ti = 5;\n\t\t\t\telse if (v < 10000000)\n\t\t\t\t\ti = 6;\n\t\t\t\telse if (v < 100000000)\n\t\t\t\t\ti = 7;\n\t\t\t\telse if (v < 1000000000)\n\t\t\t\t\ti = 8;\n\t\t\t\telse\n\t\t\t\t\ti = 9;\n\n\t\t\t\t_digits = new byte[i + 1];\n\t\t\t\tdo {\n\t\t\t\t\tuint n = v / IntList[i];\n\t\t\t\t\t_digits[j++] = (byte)n;\n\t\t\t\t\tv -= IntList[i--] * n;\n\t\t\t\t} while (i >= 0);\n\n\t\t\t\t_decPointPos = _digits.Length;\n\t\t\t}\n\t\t\tpublic NumberStore(short value)\n\t\t\t\t: this((int)value) {\n\t\t\t\t_defByteSize = 2;\n\t\t\t\t_defMaxPrecision = _defPrecision = 5;\n\t\t\t}\n\t\t\tpublic NumberStore(sbyte value)\n\t\t\t\t: this((int)value) {\n\t\t\t\t_defByteSize = 1;\n\t\t\t\t_defMaxPrecision = _defPrecision = 3;\n\t\t\t}\n\n\t\t\tpublic NumberStore(ulong value) {\n\t\t\t\t_infinity = _NaN = false;\n\t\t\t\t_defByteSize = 8;\n\t\t\t\t_defMaxPrecision = _defPrecision = 20;\n\t\t\t\t_positive = true;\n\n\t\t\t\tif (value == 0) {\n\t\t\t\t\t_digits = new byte[] { 0 };\n\t\t\t\t\t_decPointPos = 1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tint i = 19, j = 0;\n\n\t\t\t\tif (value < 10)\n\t\t\t\t\ti = 0;\n\t\t\t\telse if (value < 100)\n\t\t\t\t\ti = 1;\n\t\t\t\telse if (value < 1000)\n\t\t\t\t\ti = 2;\n\t\t\t\telse if (value < 10000)\n\t\t\t\t\ti = 3;\n\t\t\t\telse if (value < 100000)\n\t\t\t\t\ti = 4;\n\t\t\t\telse if (value < 1000000)\n\t\t\t\t\ti = 5;\n\t\t\t\telse if (value < 10000000)\n\t\t\t\t\ti = 6;\n\t\t\t\telse if (value < 100000000)\n\t\t\t\t\ti = 7;\n\t\t\t\telse if (value < 1000000000)\n\t\t\t\t\ti = 8;\n\t\t\t\telse if (value < 10000000000)\n\t\t\t\t\ti = 9;\n\t\t\t\telse if (value < 100000000000)\n\t\t\t\t\ti = 10;\n\t\t\t\telse if (value < 1000000000000)\n\t\t\t\t\ti = 11;\n\t\t\t\telse if (value < 10000000000000)\n\t\t\t\t\ti = 12;\n\t\t\t\telse if (value < 100000000000000)\n\t\t\t\t\ti = 13;\n\t\t\t\telse if (value < 1000000000000000)\n\t\t\t\t\ti = 14;\n\t\t\t\telse if (value < 10000000000000000)\n\t\t\t\t\ti = 15;\n\t\t\t\telse if (value < 100000000000000000)\n\t\t\t\t\ti = 16;\n\t\t\t\telse if (value < 1000000000000000000)\n\t\t\t\t\ti = 17;\n\t\t\t\telse if (value < 10000000000000000000)\n\t\t\t\t\ti = 18;\n\t\t\t\telse\n\t\t\t\t\ti = 19;\n\n\t\t\t\t_digits = new byte[i + 1];\n\t\t\t\tdo {\n\t\t\t\t\tulong n = value / ULongList[i];\n\t\t\t\t\t_digits[j++] = (byte)n;\n\t\t\t\t\tvalue -= ULongList[i--] * n;\n\t\t\t\t} while (i >= 0);\n\n\t\t\t\t_decPointPos = _digits.Length;\n\t\t\t}\n\t\t\tpublic NumberStore(uint value) {\n\t\t\t\t_infinity = _NaN = false;\n\t\t\t\t_positive = true;\n\t\t\t\t_defByteSize = 4;\n\t\t\t\t_defMaxPrecision = _defPrecision = 10;\n\n\t\t\t\tif (value == 0) {\n\t\t\t\t\t_digits = new byte[] { 0 };\n\t\t\t\t\t_decPointPos = 1;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tint i = 9, j = 0;\n\n\t\t\t\tif (value < 10)\n\t\t\t\t\ti = 0;\n\t\t\t\telse if (value < 100)\n\t\t\t\t\ti = 1;\n\t\t\t\telse if (value < 1000)\n\t\t\t\t\ti = 2;\n\t\t\t\telse if (value < 10000)\n\t\t\t\t\ti = 3;\n\t\t\t\telse if (value < 100000)\n\t\t\t\t\ti = 4;\n\t\t\t\telse if (value < 1000000)\n\t\t\t\t\ti = 5;\n\t\t\t\telse if (value < 10000000)\n\t\t\t\t\ti = 6;\n\t\t\t\telse if (value < 100000000)\n\t\t\t\t\ti = 7;\n\t\t\t\telse if (value < 1000000000)\n\t\t\t\t\ti = 8;\n\t\t\t\telse\n\t\t\t\t\ti = 9;\n\n\t\t\t\t_digits = new byte[i + 1];\n\t\t\t\tdo {\n\t\t\t\t\tuint n = value / IntList[i];\n\t\t\t\t\t_digits[j++] = (byte)n;\n\t\t\t\t\tvalue -= IntList[i--] * n;\n\t\t\t\t} while (i >= 0);\n\n\t\t\t\t_decPointPos = _digits.Length;\n\t\t\t}\n\t\t\tpublic NumberStore(ushort value)\n\t\t\t\t: this((uint)value) {\n\t\t\t\t_defByteSize = 2;\n\t\t\t\t_defMaxPrecision = _defPrecision = 5;\n\t\t\t}\n\t\t\tpublic NumberStore(byte value)\n\t\t\t\t: this((uint)value) {\n\t\t\t\t_defByteSize = 1;\n\t\t\t\t_defMaxPrecision = _defPrecision = 3;\n\t\t\t}\n\n\t\t\tpublic NumberStore(double value) {\n\t\t\t\t_digits = null;\n\t\t\t\t_defByteSize = 64;\n\t\t\t\t_defPrecision = 15;\n\t\t\t\t_defMaxPrecision = _defPrecision + 2;\n\n\t\t\t\tif (double.IsNaN(value) || double.IsInfinity(value)) {\n\t\t\t\t\t_NaN = double.IsNaN(value);\n\t\t\t\t\t_infinity = double.IsInfinity(value);\n\t\t\t\t\t_positive = value > 0;\n\t\t\t\t\t_decPointPos = 0;\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t_NaN = _infinity = false;\n\t\t\t\t}\n\n\t\t\t\tlong bits = BitConverter.DoubleToInt64Bits(value);\n\t\t\t\t_positive = (bits >= 0);\n\t\t\t\tint e = (int)((bits >> 52) & 0x7ffL);\n\t\t\t\tlong m = bits & 0xfffffffffffffL;\n\n\t\t\t\tif (e == 0 && m == 0) {\n\t\t\t\t\t_decPointPos = 1;\n\t\t\t\t\t_digits = new byte[] { 0 };\n\t\t\t\t\t_positive = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (e == 0) {\n\t\t\t\t\te++;\n\t\t\t\t} else if (e != 0) {\n\t\t\t\t\tm |= (1L << 52);\n\t\t\t\t}\n\n\t\t\t\te -= 1075;\n\n\t\t\t\tint nsize = 0;\n\t\t\t\twhile ((m & 1) == 0) {\n\t\t\t\t\tm >>= 1;\n\t\t\t\t\te++;\n\t\t\t\t\tnsize++;\n\t\t\t\t}\n\n\t\t\t\tlong mt = m;\n\t\t\t\tint length = 1;\n\t\t\t\tbyte[] temp = new byte[56];\n\t\t\t\tfor (int i = temp.Length - 1; i >= 0; i--, length++) {\n\t\t\t\t\ttemp[i] = (byte)(mt % 10);\n\t\t\t\t\tmt /= 10;\n\t\t\t\t\tif (mt == 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t_decPointPos = temp.Length - 1;\n\n\t\t\t\tif (e >= 0) {\n\t\t\t\t\tfor (int i = 0; i < e; i++) {\n\t\t\t\t\t\tif (MultiplyBy(ref temp, ref length, 2)) {\n\t\t\t\t\t\t\t_decPointPos++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (int i = 0; i < -e; i++) {\n\t\t\t\t\t\tif (MultiplyBy(ref temp, ref length, 5)) {\n\t\t\t\t\t\t\t_decPointPos++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t_decPointPos += e;\n\t\t\t\t}\n\n\t\t\t\tint ulvc = 1;\n\t\t\t\tulong ulv = 0;\n\t\t\t\tfor (int i = 0; i < temp.Length; i++)\n\t\t\t\t\tif (temp[i] != 0) {\n\t\t\t\t\t\t_decPointPos -= i - 1;\n\t\t\t\t\t\t_digits = new byte[temp.Length - i];\n\t\t\t\t\t\tfor (int q = i; q < temp.Length; q++) {\n\t\t\t\t\t\t\t_digits[q - i] = temp[q];\n\t\t\t\t\t\t\tif (ulvc < 20) {\n\t\t\t\t\t\t\t\tulv = ulv * 10 + temp[q];\n\t\t\t\t\t\t\t\tulvc++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\tRoundEffectiveDigits(17, true, true);\n\t\t\t}\n\t\t\tpublic NumberStore(float value) {\n\t\t\t\t_digits = null;\n\t\t\t\t_defByteSize = 32;\n\t\t\t\t_defPrecision = 7;\n\t\t\t\t_defMaxPrecision = _defPrecision + 2;\n\n\t\t\t\tif (float.IsNaN(value) || float.IsInfinity(value)) {\n\t\t\t\t\t_NaN = float.IsNaN(value);\n\t\t\t\t\t_infinity = float.IsInfinity(value);\n\t\t\t\t\t_positive = value > 0;\n\t\t\t\t\t_decPointPos = 0;\n\t\t\t\t\treturn;\n\t\t\t\t} else\n\t\t\t\t\t_infinity = _NaN = false;\n\n\t\t\t\tlong bits = BitConverter.DoubleToInt64Bits(value);\n\t\t\t\t_positive = (bits >= 0);\n\t\t\t\tint e = (int)((bits >> 52) & 0x7ffL);\n\t\t\t\tlong m = bits & 0xfffffffffffffL;\n\n\t\t\t\tif (e == 0 && m == 0) {\n\t\t\t\t\t_decPointPos = 1;\n\t\t\t\t\t_digits = new byte[] { 0 };\n\t\t\t\t\t_positive = true;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (e == 0) {\n\t\t\t\t\te++;\n\t\t\t\t} else if (e != 0) {\n\t\t\t\t\tm |= (1L << 52);\n\t\t\t\t}\n\n\t\t\t\te -= 1075;\n\n\t\t\t\tint nsize = 0;\n\t\t\t\twhile ((m & 1) == 0) {\n\t\t\t\t\tm >>= 1;\n\t\t\t\t\te++;\n\t\t\t\t\tnsize++;\n\t\t\t\t}\n\n\t\t\t\tlong mt = m;\n\t\t\t\tint length = 1;\n\t\t\t\tbyte[] temp = new byte[26];\n\t\t\t\tfor (int i = temp.Length - 1; i >= 0; i--, length++) {\n\t\t\t\t\ttemp[i] = (byte)(mt % 10);\n\t\t\t\t\tmt /= 10;\n\t\t\t\t\tif (mt == 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t_decPointPos = temp.Length - 1;\n\n\t\t\t\tif (e >= 0) {\n\t\t\t\t\tfor (int i = 0; i < e; i++) {\n\t\t\t\t\t\tif (MultiplyBy(ref temp, ref length, 2)) {\n\t\t\t\t\t\t\t_decPointPos++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (int i = 0; i < -e; i++) {\n\t\t\t\t\t\tif (MultiplyBy(ref temp, ref length, 5)) {\n\t\t\t\t\t\t\t_decPointPos++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t_decPointPos += e;\n\t\t\t\t}\n\n\t\t\t\tint ulvc = 1;\n\t\t\t\tulong ulv = 0;\n\t\t\t\tfor (int i = 0; i < temp.Length; i++)\n\t\t\t\t\tif (temp[i] != 0) {\n\t\t\t\t\t\t_decPointPos -= i - 1;\n\t\t\t\t\t\t_digits = new byte[temp.Length - i];\n\t\t\t\t\t\tfor (int q = i; q < temp.Length; q++) {\n\t\t\t\t\t\t\t_digits[q - i] = temp[q];\n\t\t\t\t\t\t\tif (ulvc < 20) {\n\t\t\t\t\t\t\t\tulv = ulv * 10 + temp[q];\n\t\t\t\t\t\t\t\tulvc++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\tRoundEffectiveDigits(9, true, true);\n\t\t\t}\n\n\t\t\tinternal bool MultiplyBy(ref byte[] buffer, ref int length, int amount) {\n\t\t\t\tint mod = 0;\n\t\t\t\tint ret;\n\t\t\t\tint start = buffer.Length - length - 1;\n\t\t\t\tif (start < 0) start = 0;\n\n\t\t\t\tfor (int i = buffer.Length - 1; i > start; i--) {\n\t\t\t\t\tret = buffer[i] * amount + mod;\n\t\t\t\t\tmod = ret / 10;\n\t\t\t\t\tbuffer[i] = (byte)(ret % 10);\n\t\t\t\t}\n\n\t\t\t\tif (mod != 0) {\n\t\t\t\t\tlength = buffer.Length - start;\n\n\t\t\t\t\tif (start == 0) {\n\t\t\t\t\t\tbuffer[0] = (byte)mod;\n\t\t\t\t\t\tArray.Copy(buffer, 0, buffer, 1, buffer.Length - 1);\n\t\t\t\t\t\tbuffer[0] = 0;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbuffer[start] = (byte)mod;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t\tpublic NumberStore(decimal value) {\n\t\t\t\tint[] bits = decimal.GetBits(value);\n\t\t\t\t_positive = (bits[3] & 0x80000000) == 0;\n\t\t\t\tbits[3] = bits[3] & 0x7FFFFFFF;\n\t\t\t\tint ss = (bits[3] & 0x1F0000) >> 16;\n\t\t\t\tulong lo = (ulong)((((ulong)bits[1]) << 32) | (uint)bits[0]);\n\t\t\t\tulong hi = (uint)bits[2];\n\t\t\t\tuint rest = 0;\n\n\t\t\t\tint digits = 0;\n\t\t\t\twhile (hi > 0 || lo > 0) {\n\t\t\t\t\tdigits++;\n\t\t\t\t\tDivideDecimal(ref lo, ref hi, 10, ref rest);\n\t\t\t\t}\n\n\t\t\t\tlo = (ulong)((((ulong)bits[1]) << 32) | (uint)bits[0]);\n\t\t\t\thi = (uint)bits[2];\n\n\t\t\t\t_digits = new byte[digits];\n\t\t\t\tint i = digits;\n\t\t\t\twhile (hi > 0 || lo > 0) {\n\t\t\t\t\tDivideDecimal(ref lo, ref hi, 10, ref rest);\n\t\t\t\t\t_digits[--i] = (byte)rest;\n\t\t\t\t}\n\n\t\t\t\t_infinity = _NaN = false;\n\t\t\t\t_decPointPos = _digits.Length - ss;\n\t\t\t\t_defPrecision = _defMaxPrecision = 100;\n\t\t\t\t_defByteSize = 16;\n\t\t\t}\n\t\t\tstatic int DivideDecimal(ref ulong lo, ref ulong hi, uint factor, ref uint rest) {\n\t\t\t\tulong a, b, c, h;\n\n\t\t\t\th = hi;\n\t\t\t\ta = (uint)(h >> 32);\n\t\t\t\tb = a / factor;\n\t\t\t\ta -= b * factor;\n\t\t\t\ta <<= 32;\n\t\t\t\ta |= (uint)h;\n\t\t\t\tc = a / factor;\n\t\t\t\ta -= c * factor;\n\t\t\t\ta <<= 32;\n\t\t\t\thi = b << 32 | (uint)c;\n\n\t\t\t\th = lo;\n\t\t\t\ta |= (uint)(h >> 32);\n\t\t\t\tb = a / factor;\n\t\t\t\ta -= b * factor;\n\t\t\t\ta <<= 32;\n\t\t\t\ta |= (uint)h;\n\t\t\t\tc = a / factor;\n\t\t\t\ta -= c * factor;\n\t\t\t\tlo = b << 32 | (uint)c;\n\n\t\t\t\trest = (uint)a;\n\n\t\t\t\ta <<= 1;\n\t\t\t\treturn (a >= factor || (a == factor && (c & 1) == 1)) ? 1 : 0;\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region Public Property\n\t\t\tpublic bool IsNaN {\n\t\t\t\tget { return _NaN; }\n\t\t\t}\n\t\t\tpublic bool IsInfinity {\n\t\t\t\tget { return _infinity; }\n\t\t\t}\n\t\t\tpublic int DecimalPointPosition {\n\t\t\t\tget { return _decPointPos; }\n\t\t\t}\n\t\t\tpublic bool Positive {\n\t\t\t\tget { return _positive; }\n\t\t\t\tset { _positive = value; }\n\t\t\t}\n\t\t\tpublic int DefaultPrecision {\n\t\t\t\tget { return _defPrecision; }\n\t\t\t}\n\t\t\tpublic int DefaultMaxPrecision {\n\t\t\t\tget { return _defMaxPrecision; }\n\t\t\t}\n\t\t\tpublic int DefaultByteSize {\n\t\t\t\tget { return _defByteSize; }\n\t\t\t}\n\t\t\tpublic bool HasDecimal {\n\t\t\t\tget { return _digits.Length > _decPointPos; }\n\t\t\t}\n\t\t\tpublic int IntegerDigits {\n\t\t\t\tget { return _decPointPos > 0 ? _decPointPos : 1; }\n\t\t\t}\n\t\t\tpublic int DecimalDigits {\n\t\t\t\tget { return HasDecimal ? _digits.Length - _decPointPos : 0; }\n\t\t\t}\n\t\t\tpublic bool IsFloatingSource {\n\t\t\t\tget { return _defPrecision == 15 || _defPrecision == 7; }\n\t\t\t}\n\t\t\tpublic bool IsDecimalSource {\n\t\t\t\tget { return _defPrecision > 30; }\n\t\t\t}\n\t\t\tpublic bool IsBankerApplicable {\n\t\t\t\tget {\n\t\t\t\t\tif ((_digits == null) || (_digits.Length < 2))\n\t\t\t\t\t\treturn false;\n\t\t\t\t\treturn ((_digits[_digits.Length - 2] & 1) == 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic bool ZeroOnly {\n\t\t\t\tget {\n\t\t\t\t\tfor (int i = 0; i < _digits.Length; i++)\n\t\t\t\t\t\tif (_digits[i] != 0)\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region Public Method\n\n\t\t\t#region Round\n\t\t\tpublic bool RoundPos(int pos) {\n\t\t\t\treturn RoundPos(pos, true);\n\t\t\t}\n\t\t\tpublic bool RoundPos(int pos, bool carryFive) {\n\t\t\t\tbool carry = false;\n\n\t\t\t\tif (_decPointPos <= 0)\n\t\t\t\t\tpos = pos - _decPointPos - 1;\n\n\t\t\t\tif (pos >= _digits.Length)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (pos < 0) {\n\t\t\t\t\t_digits = new byte[1];\n\t\t\t\t\t_digits[0] = 0;\n\t\t\t\t\t_decPointPos = 1;\n\t\t\t\t\t_positive = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tfor (int i = pos; i >= 0; i--) {\n\t\t\t\t\tRoundHelper(i, carryFive, ref carry);\n\t\t\t\t\tif (!carry)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (carry) {\n\t\t\t\t\tbyte[] temp = new byte[_digits.Length + 1];\n\t\t\t\t\t_digits.CopyTo(temp, 1);\n\t\t\t\t\ttemp[0] = 1;\n\t\t\t\t\t_digits = temp;\n\t\t\t\t\t_decPointPos++;\n\t\t\t\t\tpos++;\n\t\t\t\t}\n\n\t\t\t\tfor (int i = pos; i < _digits.Length; i++)\n\t\t\t\t\t_digits[i] = 0;\n\t\t\t\tTrimDecimalEndZeros();\n\n\t\t\t\treturn carry;\n\t\t\t}\n\t\t\tpublic bool RoundDecimal(int decimals) {\n\t\t\t\treturn RoundDecimal(decimals, true, true);\n\t\t\t}\n\t\t\tpublic bool RoundDecimal(int decimals, bool carryFive, bool countZero) {\n\t\t\t\tbool carry = false;\n\n\t\t\t\tif (countZero || (_decPointPos > 0))\n\t\t\t\t\tdecimals += _decPointPos;\n\n\t\t\t\tif (!HasDecimal || decimals >= _digits.Length)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (decimals < 0) {\n\t\t\t\t\t_digits = new byte[1];\n\t\t\t\t\t_digits[0] = 0;\n\t\t\t\t\t_decPointPos = 1;\n\t\t\t\t\t_positive = true;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tfor (int i = decimals; i >= 0; i--) {\n\t\t\t\t\tRoundHelper(i, carryFive, ref carry);\n\t\t\t\t\tif (!carry)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (carry) {\n\t\t\t\t\tbyte[] temp = new byte[_digits.Length + 1];\n\t\t\t\t\t_digits.CopyTo(temp, 1);\n\t\t\t\t\ttemp[0] = 1;\n\t\t\t\t\t_digits = temp;\n\t\t\t\t\t_decPointPos++;\n\t\t\t\t\tdecimals++;\n\t\t\t\t}\n\n\t\t\t\tfor (int i = decimals; i < _digits.Length; i++)\n\t\t\t\t\t_digits[i] = 0;\n\t\t\t\tTrimDecimalEndZeros();\n\n\t\t\t\treturn carry;\n\t\t\t}\n\t\t\tvoid RoundHelper(int index, bool carryFive, ref bool carry) {\n\t\t\t\tif (carry) {\n\t\t\t\t\tif (_digits[index] == 9) {\n\t\t\t\t\t\tcarry = true;\n\t\t\t\t\t\t_digits[index] = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcarry = false;\n\t\t\t\t\t\t_digits[index]++;\n\t\t\t\t\t}\n\t\t\t\t} else if (_digits[index] >= (carryFive ? 5 : 6)) {\n\t\t\t\t\tcarry = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic bool RoundEffectiveDigits(int digits) {\n\t\t\t\treturn RoundEffectiveDigits(digits, true, true);\n\t\t\t}\n\t\t\tpublic bool RoundEffectiveDigits(int digits, bool carryFive, bool carryEven) {\n\t\t\t\tbool carry = false;\n\n\t\t\t\tif (digits >= _digits.Length || digits < 0)\n\t\t\t\t\treturn false;\n\n\t\t\t\tif (digits + 1 < _digits.Length && _digits[digits + 1] == 5 && _digits[digits] % 2 == (carryEven ? 0 : 1))\n\t\t\t\t\tcarryFive = false;\n\n\t\t\t\t/// are we cutting from the maximum precision ?\n\t\t\t\tif (_digits.Length == _defMaxPrecision) {\n\t\t\t\t\t// special case if we *aren't* cutting inside the extra precision (e.g. 16 on 17)\n\t\t\t\t\tif (digits != _defMaxPrecision - 1) {\n\t\t\t\t\t\t// ok, here we look at the *two* extra numbers we're keeping\n\t\t\t\t\t\t// (we keep 17 digits while the true precision is 15 digits).\n\t\t\t\t\t\tint extra = _digits[_defMaxPrecision - 2] * 10 + _digits[_defMaxPrecision - 1];\n\t\t\t\t\t\tcarry = (extra >= 50);\n\t\t\t\t\t\tif (carry) {\n\t\t\t\t\t\t\t_digits[_defMaxPrecision - 2] = 0;\n\t\t\t\t\t\t\t_digits[_defMaxPrecision - 1] = 0;\n\t\t\t\t\t\t\tint d = _digits.Length - 3;\n\t\t\t\t\t\t\tCarryPropagation(ref d, carryFive, ref carry);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tCarryPropagation(ref digits, carryFive, ref carry);\n\n\t\t\t\tfor (int i = digits; i < _digits.Length; i++)\n\t\t\t\t\t_digits[i] = 0;\n\t\t\t\tTrimDecimalEndZeros();\n\n\t\t\t\treturn carry;\n\t\t\t}\n\n\t\t\tprivate void CarryPropagation(ref int digits, bool carryFive, ref bool carry) {\n\t\t\t\tfor (int i = digits; i >= 0; i--) {\n\t\t\t\t\tRoundHelper(i, carryFive, ref carry);\n\t\t\t\t\tif (!carry)\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (carry) {\n\t\t\t\t\tbyte[] temp = new byte[_digits.Length + 1];\n\t\t\t\t\t_digits.CopyTo(temp, 1);\n\t\t\t\t\ttemp[0] = 1;\n\t\t\t\t\t_digits = temp;\n\t\t\t\t\t_decPointPos++;\n\t\t\t\t\tdigits++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Trim\n\t\t\tpublic void TrimDecimalEndZeros() {\n\t\t\t\tint len = 0;\n\t\t\t\tfor (int i = _digits.Length - 1; i >= 0; i--) {\n\t\t\t\t\tif (_digits[i] != 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tlen++;\n\t\t\t\t}\n\n\t\t\t\tif (len > 0) {\n\t\t\t\t\tbyte[] temp = new byte[_digits.Length - len];\n\t\t\t\t\tArray.Copy(_digits, 0, temp, 0, temp.Length);\n\t\t\t\t\t_digits = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic void TrimIntegerStartZeros() {\n\t\t\t\tif (_decPointPos < 0 && _decPointPos >= _digits.Length)\n\t\t\t\t\treturn;\n\n\t\t\t\tint len = 0;\n\t\t\t\tfor (int i = 0; i < _decPointPos && i < _digits.Length; i++) {\n\t\t\t\t\tif (_digits[i] != 0)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tlen++;\n\t\t\t\t}\n\n\t\t\t\tif (len == _decPointPos)\n\t\t\t\t\tlen--;\n\n\t\t\t\tif (len == _digits.Length) {\n\t\t\t\t\t_digits = new byte[1];\n\t\t\t\t\t_digits[0] = 0;\n\t\t\t\t\t_decPointPos = 1;\n\t\t\t\t\t_positive = true;\n\t\t\t\t} else if (len > 0) {\n\t\t\t\t\tbyte[] temp = new byte[_digits.Length - len];\n\t\t\t\t\tArray.Copy(_digits, len, temp, 0, temp.Length);\n\t\t\t\t\t_digits = temp;\n\t\t\t\t\t_decPointPos -= len;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t#endregion\n\n\t\t\t#region Integer\n\t\t\tpublic void AppendIntegerString(int minLength, StringBuilder cb) {\n\t\t\t\tif (IntegerDigits == 0) {\n\t\t\t\t\tcb.Append('0', minLength);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (_decPointPos <= 0) {\n\t\t\t\t\tcb.Append('0', minLength);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (_decPointPos < minLength)\n\t\t\t\t\tcb.Append('0', minLength - _decPointPos);\n\n\t\t\t\tfor (int i = 0; i < _decPointPos; i++) {\n\t\t\t\t\tif (i < _digits.Length)\n\t\t\t\t\t\tcb.Append((char)('0' + _digits[i]));\n\t\t\t\t\telse\n\t\t\t\t\t\tcb.Append('0');\n\t\t\t\t}\n\t\t\t}\n\t\t\tpublic void AppendIntegerStringWithGroupSeparator(StringBuilder sb, int[] groups, string groupSeparator) {\n\t\t\t\tif (_decPointPos <= 0) {\n\t\t\t\t\tsb.Append('0');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tint intLen = IntegerDigits;\n\t\t\t\tint total = 0;\n\t\t\t\tint groupIndex = 0;\n\t\t\t\tfor (int i = 0; i < groups.Length; i++) {\n\t\t\t\t\ttotal += groups[i];\n\t\t\t\t\tif (total <= intLen)\n\t\t\t\t\t\tgroupIndex = i;\n\t\t\t\t}\n\n\t\t\t\tif (groups.Length > 0 && total > 0) {\n\t\t\t\t\tint counter;\n\t\t\t\t\tint groupSize = groups[groupIndex];\n\t\t\t\t\tint fraction = intLen > total ? intLen - total : 0;\n\t\t\t\t\tif (groupSize == 0) {\n\t\t\t\t\t\twhile (groupIndex >= 0 && groups[groupIndex] == 0)\n\t\t\t\t\t\t\tgroupIndex--;\n\n\t\t\t\t\t\tgroupSize = fraction > 0 ? fraction : groups[groupIndex];\n\t\t\t\t\t}\n\t\t\t\t\tif (fraction == 0) {\n\t\t\t\t\t\tcounter = groupSize;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgroupIndex += fraction / groupSize;\n\t\t\t\t\t\tcounter = fraction % groupSize;\n\t\t\t\t\t\tif (counter == 0)\n\t\t\t\t\t\t\tcounter = groupSize;\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tgroupIndex++;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (int i = 0; i < _decPointPos; i++) {\n\t\t\t\t\t\tif (i < _digits.Length) {\n\t\t\t\t\t\t\tsb.Append((char)('0' + _digits[i]));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsb.Append('0');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (i < intLen - 1 && --counter == 0) {\n\t\t\t\t\t\t\tsb.Append(groupSeparator);\n\t\t\t\t\t\t\tif (--groupIndex < groups.Length && groupIndex >= 0)\n\t\t\t\t\t\t\t\tgroupSize = groups[groupIndex];\n\t\t\t\t\t\t\tcounter = groupSize;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfor (int i = 0; i < _decPointPos; i++) {\n\t\t\t\t\t\tif (i < _digits.Length) {\n\t\t\t\t\t\t\tsb.Append((char)('0' + _digits[i]));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsb.Append('0');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region Decimal\n\t\t\tpublic string GetDecimalString(int precision) {\n\t\t\t\tif (!HasDecimal)\n\t\t\t\t\treturn new string('0', precision);\n\n\t\t\t\tStringBuilder sb = new StringBuilder(precision);\n\t\t\t\tfor (int i = _decPointPos; i < _digits.Length && i < precision + _decPointPos; i++) {\n\t\t\t\t\tif (i >= 0)\n\t\t\t\t\t\tsb.Append((char)('0' + _digits[i]));\n\t\t\t\t\telse\n\t\t\t\t\t\tsb.Append('0');\n\t\t\t\t}\n\t\t\t\tif (sb.Length < precision)\n\t\t\t\t\tsb.Append('0', precision - sb.Length);\n\t\t\t\telse if (sb.Length > precision)\n\t\t\t\t\tsb.Remove(0, precision);\n\t\t\t\treturn sb.ToString();\n\t\t\t}\n\n\t\t\tpublic void AppendDecimalString(int precision, StringBuilder cb) {\n\t\t\t\tif (!HasDecimal) {\n\t\t\t\t\tcb.Append('0', precision);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tint i = _decPointPos;\n\t\t\t\tfor (; i < _digits.Length && i < precision + _decPointPos; i++) {\n\t\t\t\t\tif (i >= 0)\n\t\t\t\t\t\tcb.Append((char)('0' + _digits[i]));\n\t\t\t\t\telse\n\t\t\t\t\t\tcb.Append('0');\n\t\t\t\t}\n\n\t\t\t\ti -= _decPointPos;\n\t\t\t\tif (i < precision)\n\t\t\t\t\tcb.Append('0', precision - i);\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#region others\n\t\t\tpublic bool CheckZeroOnlyInteger() {\n\t\t\t\tfor (int i = 0; i < _decPointPos && i < _digits.Length; i++) {\n\t\t\t\t\tif (_digits[i] != 0)\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tpublic void Multiply10(int count) {\n\t\t\t\tif (count <= 0)\n\t\t\t\t\treturn;\n\n\t\t\t\t_decPointPos += count;\n\n\t\t\t\tTrimIntegerStartZeros();\n\t\t\t}\n\t\t\tpublic void Divide10(int count) {\n\t\t\t\tif (count <= 0)\n\t\t\t\t\treturn;\n\n\t\t\t\t_decPointPos -= count;\n\t\t\t}\n\t\t\tpublic override string ToString() {\n\t\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\t\tAppendIntegerString(IntegerDigits, sb);\n\t\t\t\tif (HasDecimal) {\n\t\t\t\t\tsb.Append('.');\n\t\t\t\t\tAppendDecimalString(DecimalDigits, sb);\n\t\t\t\t}\n\t\t\t\treturn sb.ToString();\n\t\t\t}\n\t\t\tpublic char GetChar(int pos) {\n\t\t\t\tif (_decPointPos <= 0)\n\t\t\t\t\tpos += _decPointPos - 1;\n\n\t\t\t\tif (pos < 0 || pos >= _digits.Length)\n\t\t\t\t\treturn '0';\n\t\t\t\telse\n\t\t\t\t\treturn (char)('0' + _digits[pos]);\n\t\t\t}\n\t\t\tpublic byte GetDigitByte(int pos) {\n\t\t\t\tif (_decPointPos <= 0)\n\t\t\t\t\tpos += _decPointPos - 1;\n\n\t\t\t\tif (pos < 0 || pos >= _digits.Length)\n\t\t\t\t\treturn 0;\n\t\t\t\telse\n\t\t\t\t\treturn _digits[pos];\n\t\t\t}\n\t\t\tpublic NumberStore GetClone() {\n\t\t\t\tNumberStore ns = new NumberStore();\n\n\t\t\t\tns._decPointPos = this._decPointPos;\n\t\t\t\tns._defMaxPrecision = this._defMaxPrecision;\n\t\t\t\tns._defPrecision = this._defPrecision;\n\t\t\t\tns._digits = (byte[])this._digits.Clone();\n\t\t\t\tns._infinity = this._infinity;\n\t\t\t\tns._NaN = this._NaN;\n\t\t\t\tns._positive = this._positive;\n\n\t\t\t\treturn ns;\n\t\t\t}\n\t\t\tpublic int GetDecimalPointPos() {\n\t\t\t\treturn _decPointPos;\n\t\t\t}\n\t\t\tpublic void SetDecimalPointPos(int dp) {\n\t\t\t\t_decPointPos = dp;\n\t\t\t}\n\t\t\t#endregion\n\n\t\t\t#endregion\n\n\t\t\t#region Public Static Method\n\t\t\tpublic static bool IsZeroOnly(StringBuilder sb) {\n\t\t\t\tfor (int i = 0; i < sb.Length; i++)\n\t\t\t\t\tif (char.IsDigit(sb[i]) && sb[i] != '0')\n\t\t\t\t\t\treturn false;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tpublic static void AppendIntegerStringFromUInt32(StringBuilder sb, uint v) {\n\t\t\t\tif (v < 0)\n\t\t\t\t\tthrow new ArgumentException();\n\n\t\t\t\tint i = 9;\n\n\t\t\t\tif (v >= 1000000000)\n\t\t\t\t\ti = 9;\n\t\t\t\telse if (v >= 100000000)\n\t\t\t\t\ti = 8;\n\t\t\t\telse if (v >= 10000000)\n\t\t\t\t\ti = 7;\n\t\t\t\telse if (v >= 1000000)\n\t\t\t\t\ti = 6;\n\t\t\t\telse if (v >= 100000)\n\t\t\t\t\ti = 5;\n\t\t\t\telse if (v >= 10000)\n\t\t\t\t\ti = 4;\n\t\t\t\telse if (v >= 1000)\n\t\t\t\t\ti = 3;\n\t\t\t\telse if (v >= 100)\n\t\t\t\t\ti = 2;\n\t\t\t\telse if (v >= 10)\n\t\t\t\t\ti = 1;\n\t\t\t\telse\n\t\t\t\t\ti = 0;\n\t\t\t\tdo {\n\t\t\t\t\tuint n = v / IntList[i];\n\t\t\t\t\tsb.Append(NumberFormatter.digitLowerTable[n]);\n\t\t\t\t\tv -= IntList[i--] * n;\n\t\t\t\t} while (i >= 0);\n\t\t\t}\n\t\t\t#endregion\n\t\t}\n\t\t#endregion\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Object.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\n\nnamespace System {\n\tpublic class Object {\n\n\t\tpublic Object() {\n\t\t}\n\n\t\t~Object() {\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public Type GetType();\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public virtual bool Equals(object obj);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public virtual int GetHashCode();\n\n\t\tpublic virtual string ToString() {\n\t\t\treturn this.GetType().FullName;\n\t\t}\n\n\t\tpublic static bool Equals(object a, object b) {\n\t\t\tif (a == b) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (a == null || b == null) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn a.Equals(b);\n\t\t}\n\n\t\tpublic static bool ReferenceEquals(object a, object b) {\n\t\t\treturn (a == b);\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern internal static object Clone(object obj);\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System/ObjectDisposedException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class ObjectDisposedException : InvalidOperationException {\n\n\t\tprivate string objectName;\n\n\t\tpublic ObjectDisposedException(string objectName)\n\t\t\t: base(\"The object was used after being disposed\") {\n\t\t\tthis.objectName = objectName;\n\t\t}\n\n\t\tpublic ObjectDisposedException(string objectName, string msg)\n\t\t\t: base(msg) {\n\t\t\tthis.objectName = objectName;\n\t\t}\n\n\t\tpublic string ObjectName {\n\t\t\tget {\n\t\t\t\treturn this.objectName;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/OperatingSystem.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic sealed class OperatingSystem : ICloneable {\n\n\t\tprivate PlatformID platformID;\n\t\tprivate Version version;\n\n\t\tpublic OperatingSystem(PlatformID platformID, Version version) {\n\t\t\tif (version == null) {\n\t\t\t\tthrow new ArgumentNullException(\"version\");\n\t\t\t}\n\t\t\tthis.platformID = platformID;\n\t\t\tthis.version = version;\n\t\t}\n\n\t\tpublic PlatformID Platform {\n\t\t\tget {\n\t\t\t\treturn this.platformID;\n\t\t\t}\n\t\t}\n\n\t\tpublic Version Version {\n\t\t\tget {\n\t\t\t\treturn this.version;\n\t\t\t}\n\t\t}\n\n\t\tpublic string ServicePack {\n\t\t\tget {\n\t\t\t\treturn String.Empty;\n\t\t\t}\n\t\t}\n\n\t\tpublic string VersionString {\n\t\t\tget {\n\t\t\t\treturn ToString();\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\tstring str;\n\n\t\t\tswitch (this.platformID) {\n\t\t\t\tcase PlatformID.Win32NT:\n\t\t\t\t\tstr = \"Microsoft Windows NT\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase PlatformID.Win32S:\n\t\t\t\t\tstr = \"Microsoft Win32S\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase PlatformID.Win32Windows:\n\t\t\t\t\tstr = \"Microsoft Windows 98\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase PlatformID.WinCE:\n\t\t\t\t\tstr = \"Microsoft Windows CE\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase PlatformID.Unix:\n\t\t\t\t\tstr = \"Unix\";\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tstr = \"<unknown>\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\treturn str + \" \" + this.version.ToString() + \" (DNA)\";\n\t\t}\n\n\t\t#region ICloneable Members\n\n\t\tpublic object Clone() {\n\t\t\treturn (OperatingSystem)object.Clone(this);\n\t\t}\n\n\t\t#endregion\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/OverflowException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class OverflowException : ArithmeticException {\n\n\t\tpublic OverflowException() : base(\"Number overflow.\") { }\n\t\tpublic OverflowException(string msg) : base(msg) { }\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/ParamArrayAttribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System {\n\tpublic sealed class ParamArrayAttribute : Attribute {\n\n\t\tpublic ParamArrayAttribute() {\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/ParseHelper.cs",
    "content": "#if !LOCALTEST\n\nusing System.Globalization;\nusing System.Threading;\nnamespace System {\n\tinternal static class ParseHelper {\n\n\t\tprivate static bool CheckStyle(NumberStyles style, bool tryParse, ref Exception exc) {\n\t\t\tif ((style & NumberStyles.AllowHexSpecifier) != 0) {\n\t\t\t\tNumberStyles ne = style ^ NumberStyles.AllowHexSpecifier;\n\t\t\t\tif ((ne & NumberStyles.AllowLeadingWhite) != 0) {\n\t\t\t\t\tne ^= NumberStyles.AllowLeadingWhite;\n\t\t\t\t}\n\t\t\t\tif ((ne & NumberStyles.AllowTrailingWhite) != 0) {\n\t\t\t\t\tne ^= NumberStyles.AllowTrailingWhite;\n\t\t\t\t}\n\t\t\t\tif (ne != 0) {\n\t\t\t\t\tif (!tryParse) {\n\t\t\t\t\t\texc = new ArgumentException(\n\t\t\t\t\t\t\t\"With AllowHexSpecifier only \" +\n\t\t\t\t\t\t\t\"AllowLeadingWhite and AllowTrailingWhite \" +\n\t\t\t\t\t\t\t\"are permitted.\");\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate static bool JumpOverWhite(ref int pos, string s, bool reportError, bool tryParse, ref Exception exc) {\n\t\t\twhile (pos < s.Length && Char.IsWhiteSpace(s[pos])) {\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\tif (reportError && pos >= s.Length) {\n\t\t\t\tif (!tryParse) {\n\t\t\t\t\texc = GetFormatException();\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate static void FindSign(ref int pos, string s, NumberFormatInfo nfi,\n\t\t\tref bool foundSign, ref bool negative) {\n\t\t\tif ((pos + nfi.NegativeSign.Length) <= s.Length &&\n\t\t\t\ts.IndexOf(nfi.NegativeSign, pos, nfi.NegativeSign.Length) == pos) {\n\t\t\t\tnegative = true;\n\t\t\t\tfoundSign = true;\n\t\t\t\tpos += nfi.NegativeSign.Length;\n\t\t\t} else if ((pos + nfi.PositiveSign.Length) < s.Length &&\n\t\t\t\ts.IndexOf(nfi.PositiveSign, pos, nfi.PositiveSign.Length) == pos) {\n\t\t\t\tnegative = false;\n\t\t\t\tpos += nfi.PositiveSign.Length;\n\t\t\t\tfoundSign = true;\n\t\t\t}\n\t\t}\n\n\t\tprivate static void FindCurrency(ref int pos, string s, NumberFormatInfo nfi, ref bool foundCurrency) {\n\t\t\tif ((pos + nfi.CurrencySymbol.Length) <= s.Length &&\n\t\t\t\t s.Substring(pos, nfi.CurrencySymbol.Length) == nfi.CurrencySymbol) {\n\t\t\t\tfoundCurrency = true;\n\t\t\t\tpos += nfi.CurrencySymbol.Length;\n\t\t\t}\n\t\t}\n\n\t\tprivate static bool FindExponent(ref int pos, string s) {\n\t\t\tint i = s.IndexOfAny(new char[] { 'e', 'E' }, pos);\n\t\t\tif (i < 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (++i == s.Length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (s[i] == '+' || s[i] == '-') {\n\t\t\t\tif (++i == s.Length) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!Char.IsDigit(s[i])) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tfor (; i < s.Length; ++i) {\n\t\t\t\tif (!Char.IsDigit(s[i])) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpos = i;\n\t\t\treturn true;\n\t\t}\n\n\t\tprivate static bool FindOther(ref int pos, string s, string other) {\n\t\t\tif ((pos + other.Length) <= s.Length && s.Substring(pos, other.Length) == other) {\n\t\t\t\tpos += other.Length;\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tprivate static bool ValidDigit(char e, bool allowHex) {\n\t\t\tif (allowHex) {\n\t\t\t\treturn Char.IsDigit(e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');\n\t\t\t}\n\t\t\treturn Char.IsDigit(e);\n\t\t}\n\n\t\tprivate static Exception GetFormatException() {\n\t\t\treturn new FormatException(\"Input string was not in the correct format\");\n\t\t}\n\n\t\tinternal static bool Parse(string s, NumberStyles style, IFormatProvider fp, bool tryParse, out int result, out Exception exc) {\n\t\t\tresult = 0;\n\t\t\texc = null;\n\n\t\t\tif (s == null) {\n\t\t\t\tif (!tryParse) {\n\t\t\t\t\texc = GetFormatException();\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (s == null) {\n\t\t\t\tif (!tryParse) {\n\t\t\t\t\texc = new ArgumentNullException();\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (s.Length == 0) {\n\t\t\t\tif (!tryParse) {\n\t\t\t\t\texc = GetFormatException();\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tNumberFormatInfo nfi;\n\t\t\tif (fp != null) {\n\t\t\t\tType typeNFI = typeof(System.Globalization.NumberFormatInfo);\n\t\t\t\tnfi = (NumberFormatInfo)fp.GetFormat(typeNFI);\n\t\t\t} else {\n\t\t\t\tnfi = Thread.CurrentThread.CurrentCulture.NumberFormat;\n\t\t\t}\n\t\t\tif (!CheckStyle(style, tryParse, ref exc)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tbool AllowCurrencySymbol = (style & NumberStyles.AllowCurrencySymbol) != 0;\n\t\t\tbool AllowHexSpecifier = (style & NumberStyles.AllowHexSpecifier) != 0;\n\t\t\tbool AllowThousands = (style & NumberStyles.AllowThousands) != 0;\n\t\t\tbool AllowDecimalPoint = (style & NumberStyles.AllowDecimalPoint) != 0;\n\t\t\tbool AllowParentheses = (style & NumberStyles.AllowParentheses) != 0;\n\t\t\tbool AllowTrailingSign = (style & NumberStyles.AllowTrailingSign) != 0;\n\t\t\tbool AllowLeadingSign = (style & NumberStyles.AllowLeadingSign) != 0;\n\t\t\tbool AllowTrailingWhite = (style & NumberStyles.AllowTrailingWhite) != 0;\n\t\t\tbool AllowLeadingWhite = (style & NumberStyles.AllowLeadingWhite) != 0;\n\t\t\tbool AllowExponent = (style & NumberStyles.AllowExponent) != 0;\n\n\t\t\tint pos = 0;\n\n\t\t\tif (AllowLeadingWhite && !JumpOverWhite(ref pos, s, true, tryParse, ref exc)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tbool foundOpenParentheses = false;\n\t\t\tbool negative = false;\n\t\t\tbool foundSign = false;\n\t\t\tbool foundCurrency = false;\n\n\t\t\t// Pre-number stuff\n\t\t\tif (AllowParentheses && s[pos] == '(') {\n\t\t\t\tfoundOpenParentheses = true;\n\t\t\t\tfoundSign = true;\n\t\t\t\tnegative = true; // MS always make the number negative when there parentheses\n\t\t\t\t// even when NumberFormatInfo.NumberNegativePattern != 0!!!\n\t\t\t\tpos++;\n\t\t\t\tif (AllowLeadingWhite && !!JumpOverWhite(ref pos, s, true, tryParse, ref exc)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (s.Substring(pos, nfi.NegativeSign.Length) == nfi.NegativeSign) {\n\t\t\t\t\tif (!tryParse) {\n\t\t\t\t\t\texc = GetFormatException();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (s.Substring(pos, nfi.PositiveSign.Length) == nfi.PositiveSign) {\n\t\t\t\t\tif (!tryParse) {\n\t\t\t\t\t\texc = GetFormatException();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (AllowLeadingSign && !foundSign) {\n\t\t\t\t// Sign + Currency\n\t\t\t\tFindSign(ref pos, s, nfi, ref foundSign, ref negative);\n\t\t\t\tif (foundSign) {\n\t\t\t\t\tif (AllowLeadingWhite && !JumpOverWhite(ref pos, s, true, tryParse, ref exc)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (AllowCurrencySymbol) {\n\t\t\t\t\t\tFindCurrency(ref pos, s, nfi, ref foundCurrency);\n\t\t\t\t\t\tif (foundCurrency && AllowLeadingWhite && !JumpOverWhite(ref pos, s, true, tryParse, ref exc)) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (AllowCurrencySymbol && !foundCurrency) {\n\t\t\t\t// Currency + sign\n\t\t\t\tFindCurrency(ref pos, s, nfi, ref foundCurrency);\n\t\t\t\tif (foundCurrency) {\n\t\t\t\t\tif (AllowLeadingWhite && !JumpOverWhite(ref pos, s, true, tryParse, ref exc)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (foundCurrency) {\n\t\t\t\t\t\tif (!foundSign && AllowLeadingSign) {\n\t\t\t\t\t\t\tFindSign(ref pos, s, nfi, ref foundSign, ref negative);\n\t\t\t\t\t\t\tif (foundSign && AllowLeadingWhite && !JumpOverWhite(ref pos, s, true, tryParse, ref exc)) {\n\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tint number = 0;\n\t\t\tint nDigits = 0;\n\t\t\tbool decimalPointFound = false;\n\t\t\tint digitValue;\n\t\t\tchar hexDigit;\n\n\t\t\t// Number stuff\n\t\t\tdo {\n\t\t\t\tif (!ValidDigit(s[pos], AllowHexSpecifier)) {\n\t\t\t\t\tif (AllowThousands && FindOther(ref pos, s, nfi.NumberGroupSeparator)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!decimalPointFound && AllowDecimalPoint && FindOther(ref pos, s, nfi.NumberDecimalSeparator)) {\n\t\t\t\t\t\t\tdecimalPointFound = true;\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t} else if (AllowHexSpecifier) {\n\t\t\t\t\tnDigits++;\n\t\t\t\t\thexDigit = s[pos++];\n\t\t\t\t\tif (Char.IsDigit(hexDigit)) {\n\t\t\t\t\t\tdigitValue = (int)(hexDigit - '0');\n\t\t\t\t\t} else if (Char.IsLower(hexDigit)) {\n\t\t\t\t\t\tdigitValue = (int)(hexDigit - 'a' + 10);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdigitValue = (int)(hexDigit - 'A' + 10);\n\t\t\t\t\t}\n\t\t\t\t\tuint unumber = (uint)number;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnumber = (int)checked(unumber * 16u + (uint)digitValue);\n\t\t\t\t\t} catch (OverflowException e) {\n\t\t\t\t\t\texc = e;\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else if (decimalPointFound) {\n\t\t\t\t\tnDigits++;\n\t\t\t\t\t// Allows decimal point as long as it's only \n\t\t\t\t\t// followed by zeroes.\n\t\t\t\t\tif (s[pos++] != '0') {\n\t\t\t\t\t\tif (!tryParse) {\n\t\t\t\t\t\t\texc = new OverflowException(\"Value too large or too small.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tnDigits++;\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// Calculations done as negative\n\t\t\t\t\t\t// (abs (MinValue) > abs (MaxValue))\n\t\t\t\t\t\tnumber = checked(\n\t\t\t\t\t\t\tnumber * 10 -\n\t\t\t\t\t\t\t(int)(s[pos++] - '0')\n\t\t\t\t\t\t\t);\n\t\t\t\t\t} catch (OverflowException) {\n\t\t\t\t\t\tif (!tryParse) {\n\t\t\t\t\t\t\texc = new OverflowException(\"Value too large or too small.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} while (pos < s.Length);\n\n\t\t\t// Post number stuff\n\t\t\tif (nDigits == 0) {\n\t\t\t\tif (!tryParse) {\n\t\t\t\t\texc = GetFormatException();\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (AllowExponent) {\n\t\t\t\tFindExponent(ref pos, s);\n\t\t\t}\n\t\t\tif (AllowTrailingSign && !foundSign) {\n\t\t\t\t// Sign + Currency\n\t\t\t\tFindSign(ref pos, s, nfi, ref foundSign, ref negative);\n\t\t\t\tif (foundSign) {\n\t\t\t\t\tif (AllowTrailingWhite && !JumpOverWhite(ref pos, s, true, tryParse, ref exc)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (AllowCurrencySymbol) {\n\t\t\t\t\t\tFindCurrency(ref pos, s, nfi, ref foundCurrency);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (AllowCurrencySymbol && !foundCurrency) {\n\t\t\t\t// Currency + sign\n\t\t\t\tFindCurrency(ref pos, s, nfi, ref foundCurrency);\n\t\t\t\tif (foundCurrency) {\n\t\t\t\t\tif (AllowTrailingWhite && !JumpOverWhite(ref pos, s, true, tryParse, ref exc)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (!foundSign && AllowTrailingSign) {\n\t\t\t\t\t\tFindSign(ref pos, s, nfi, ref foundSign, ref negative);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (AllowTrailingWhite && pos < s.Length && !JumpOverWhite(ref pos, s, false, tryParse, ref exc)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (foundOpenParentheses) {\n\t\t\t\tif (pos >= s.Length || s[pos++] != ')') {\n\t\t\t\t\tif (!tryParse) {\n\t\t\t\t\t\texc = GetFormatException();\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (AllowTrailingWhite && pos < s.Length && !JumpOverWhite(ref pos, s, false, tryParse, ref exc)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (pos < s.Length && s[pos] != '\\u0000') {\n\t\t\t\tif (!tryParse) {\n\t\t\t\t\texc = GetFormatException();\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!negative && !AllowHexSpecifier) {\n\t\t\t\tnumber = checked(-number);\n\t\t\t}\n\n\t\t\tresult = number;\n\n\t\t\treturn true;\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/PlatformID.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic enum PlatformID {\n\t\tWin32S = 0,\n\t\tWin32Windows = 1,\n\t\tWin32NT = 2,\n\t\tWinCE = 3,\n\t\tUnix = 4\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Predicate.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic delegate bool Predicate<T>(T obj);\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Random.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if LOCALTEST\nusing System;\nnamespace System_ {\n#else\nnamespace System {\n#endif\n\tpublic class Random {\n\n\t\tprivate const int MBIG = int.MaxValue;\n\t\tprivate const int MSEED = 161803398;\n\t\tprivate const int MZ = 0;\n\n\t\tprivate int inext, inextp;\n\t\tprivate int[] SeedArray = new int[56];\n\n\t\tpublic Random() : this(Environment.TickCount) { }\n\n\t\tpublic Random(int seed) {\n\t\t\tint ii;\n\t\t\tint mj, mk;\n\n\t\t\t// Numerical Recipes in C online @ http://www.library.cornell.edu/nr/bookcpdf/c7-1.pdf\n\t\t\tmj = MSEED - Math.Abs(seed);\n\t\t\tSeedArray[55] = mj;\n\t\t\tmk = 1;\n\t\t\tfor (int i = 1; i < 55; i++) {  //  [1, 55] is special (Knuth)\n\t\t\t\tii = (21 * i) % 55;\n\t\t\t\tSeedArray[ii] = mk;\n\t\t\t\tmk = mj - mk;\n\t\t\t\tif (mk < 0)\n\t\t\t\t\tmk += MBIG;\n\t\t\t\tmj = SeedArray[ii];\n\t\t\t}\n\t\t\tfor (int k = 1; k < 5; k++) {\n\t\t\t\tfor (int i = 1; i < 56; i++) {\n\t\t\t\t\tSeedArray[i] -= SeedArray[1 + (i + 30) % 55];\n\t\t\t\t\tif (SeedArray[i] < 0)\n\t\t\t\t\t\tSeedArray[i] += MBIG;\n\t\t\t\t}\n\t\t\t}\n\t\t\tinext = 0;\n\t\t\tinextp = 31;\n\t\t}\n\n\t\tpublic int Next() {\n\t\t\treturn Next(0, int.MaxValue);\n\t\t}\n\n\t\tpublic int Next(int maxValue) {\n\t\t\tif (maxValue < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"maxValue\");\n\t\t\t}\n\t\t\treturn Next(0, maxValue);\n\t\t}\n\n\t\tpublic int Next(int minValue, int maxValue) {\n\t\t\tif (minValue > maxValue) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\n\t\t\tif (++inext >= 56) {\n\t\t\t\tinext = 1;\n\t\t\t}\n\t\t\tif (++inextp >= 56) {\n\t\t\t\tinextp = 1;\n\t\t\t}\n\n\t\t\tint retVal = SeedArray[inext] - SeedArray[inextp];\n\t\t\tif (retVal < 0) {\n\t\t\t\tretVal += MBIG;\n\t\t\t}\n\t\t\tSeedArray[inext] = retVal;\n\n\t\t\tif (minValue == maxValue) {\n\t\t\t\treturn minValue;\n\t\t\t}\n\t\t\treturn (retVal % (maxValue - minValue)) + minValue;\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "corlib/System/RuntimeFieldHandle.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic struct RuntimeFieldHandle {\n\n\t\tprivate IntPtr value;\n\n\t\tinternal RuntimeFieldHandle(IntPtr v) {\n\t\t\tvalue = v;\n\t\t}\n\n\t\tpublic IntPtr Value {\n\t\t\tget {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/RuntimeMethodHandle.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic struct RuntimeMethodHandle {\n\n\t\tIntPtr value;\n\n\t\tinternal RuntimeMethodHandle(IntPtr v) {\n\t\t\tvalue = v;\n\t\t}\n\n\t\tpublic IntPtr Value {\n\t\t\tget {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/RuntimeType.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Collections.Generic;\n\nnamespace System {\n\n\tclass RuntimeType : Type {\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private RuntimeType GetNestingParentType();\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private RuntimeType Internal_GetGenericTypeDefinition();\n\n\t\textern public override Type BaseType {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\tpublic extern override bool IsEnum {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\textern public override string Namespace {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\textern public override string Name {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\tpublic override string FullName {\n\t\t\tget {\n\t\t\t\tStringBuilder ret = new StringBuilder(32);\n\t\t\t\tret.Append(this.Namespace);\n\t\t\t\tret.Append('.');\n\t\t\t\tRuntimeType nestingParentType = this.GetNestingParentType();\n\t\t\t\tif (nestingParentType != null) {\n\t\t\t\t\tList<Type> nestingParents = new List<Type>();\n\t\t\t\t\tnestingParents.Add(nestingParentType);\n\t\t\t\t\tnestingParentType = nestingParentType.GetNestingParentType();\n\t\t\t\t\twhile (nestingParentType != null) {\n\t\t\t\t\t\tnestingParents.Add(nestingParentType);\n\t\t\t\t\t\tnestingParentType = nestingParentType.GetNestingParentType();\n\t\t\t\t\t}\n\t\t\t\t\tfor (int ofs = nestingParents.Count - 1; ofs >= 0; ofs--) {\n\t\t\t\t\t\tret.Append(nestingParents[ofs].Name);\n\t\t\t\t\t\tret.Append('+');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tret.Append(this.Name);\n\t\t\t\treturn ret.ToString();\n\t\t\t}\n\t\t}\n\n\t\textern public override bool IsGenericType {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\tpublic override Type GetGenericTypeDefinition() {\n\t\t\tif (!this.IsGenericType) {\n\t\t\t\tthrow new InvalidOperationException(\"This is not a generic type\");\n\t\t\t}\n\t\t\treturn this.Internal_GetGenericTypeDefinition();\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public override Type[] GetGenericArguments();\n\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/RuntimeTypeHandle.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic struct RuntimeTypeHandle {\n\n\t\tprivate IntPtr value;\n\n\t\tinternal RuntimeTypeHandle(IntPtr v) {\n\t\t\tvalue = v;\n\t\t}\n\n\t\tpublic IntPtr Value {\n\t\t\tget {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/SByte.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Globalization;\nnamespace System {\n\tpublic struct SByte : IFormattable, IComparable, IComparable<sbyte>, IEquatable<sbyte> {\n\t\tpublic const sbyte MinValue = -128;\n\t\tpublic const sbyte MaxValue = 127;\n\n#pragma warning disable 0169, 0649\n        internal sbyte m_value;\n#pragma warning restore 0169, 0649\n\n        public override bool Equals(object obj) {\n\t\t\treturn (obj is sbyte) && ((sbyte)obj).m_value == this.m_value;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.m_value;\n\t\t}\n\n\t\t#region ToString methods\n\n\t\tpublic override string ToString() {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value));\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider formatProvider) {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value), formatProvider);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn this.ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider formatProvider) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(formatProvider);\n\t\t\treturn NumberFormatter.NumberToString(format, this.m_value, nfi);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is int)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((sbyte)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<sbyte> Members\n\n\t\tpublic int CompareTo(sbyte x) {\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<sbyte> Members\n\n\t\tpublic bool Equals(sbyte x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System/Single.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Globalization;\nnamespace System {\n\tpublic struct Single : IFormattable, IComparable, IComparable<float>, IEquatable<float> {\n\n\t\tpublic const float Epsilon = 1.4e-45f;\n\t\tpublic const float MaxValue = 3.40282346638528859e38f;\n\t\tpublic const float MinValue = -3.40282346638528859e38f;\n\t\tpublic const float NaN = 0.0f / 0.0f;\n\t\tpublic const float PositiveInfinity = 1.0f / 0.0f;\n\t\tpublic const float NegativeInfinity = -1.0f / 0.0f;\n\n\t\tprivate float m_value;\n\n\t\tpublic static bool IsNaN(float f) {\n#pragma warning disable 1718\n\t\t\treturn (f != f);\n#pragma warning restore\n\t\t}\n\n\t\tpublic static bool IsNegativeInfinity(float f) {\n\t\t\treturn (f < 0.0f && (f == NegativeInfinity || f == PositiveInfinity));\n\t\t}\n\n\t\tpublic static bool IsPositiveInfinity(float f) {\n\t\t\treturn (f > 0.0f && (f == NegativeInfinity || f == PositiveInfinity));\n\t\t}\n\n\t\tpublic static bool IsInfinity(float f) {\n\t\t\treturn (f == PositiveInfinity || f == NegativeInfinity);\n\t\t}\n\n\t\tpublic override bool Equals(object o) {\n\t\t\tif (!(o is Single)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (IsNaN((float)o)) {\n\t\t\t\treturn IsNaN(this);\n\t\t\t}\n\t\t\treturn ((float)o).m_value == this.m_value;\n\t\t}\n\n\t\tpublic unsafe override int GetHashCode() {\n\t\t\tfloat f = this.m_value;\n\t\t\treturn (*((int*)&f)).GetHashCode();\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn ToString(null, null);\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider provider) {\n\t\t\treturn ToString(null, provider);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider provider) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(provider);\n\t\t\treturn NumberFormatter.NumberToString(format, this.m_value, nfi);\n\t\t}\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is float)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((float)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<float> Members\n\n\t\tpublic int CompareTo(float x) {\n\t\t\tif (float.IsNaN(this.m_value)) {\n\t\t\t\treturn float.IsNaN(x) ? 0 : -1;\n\t\t\t}\n\t\t\tif (float.IsNaN(x)) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<float> Members\n\n\t\tpublic bool Equals(float x) {\n\t\t\tif (float.IsNaN(this.m_value)) {\n\t\t\t\treturn float.IsNaN(x);\n\t\t\t}\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/String.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.Text;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Globalization;\n\nnamespace System {\n\tpublic class String : ICloneable, IEnumerable, IEnumerable<char>,\n\t\tIComparable, IComparable<string>, IEquatable<string> {\n\n\t\tpublic static readonly string Empty = \"\";\n\n\t\tpublic static bool IsNullOrEmpty(string value) {\n\t\t\treturn (value == null) || (value.length == 0);\n\t\t}\n\n\t\t// This field must be the only field, to tie up with C code\n\t\tprivate int length;\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public String(char c, int count);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public String(char[] chars);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public String(char[] chars, int startIndex, int length);\n\t\t\n\t\t#region Private Internal Calls\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private String(string str, int startIndex, int length);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static string InternalConcat(string str0, string str1);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private string InternalReplace(string oldValue, string newValue);\n\n\t\t// trimType: bit 0 = start; bit 1 = end\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private string InternalTrim(char[] trimChars, int trimType);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private int InternalIndexOf(char value, int startIndex, int count, bool forwards);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private int InternalIndexOfAny(char[] anyOf, int startIndex, int count, bool forward);\n\n\t\t#endregion\n\n\t\tpublic virtual int Length {\n\t\t\tget {\n\t\t\t\treturn this.length;\n\t\t\t}\n\t\t}\n\n\t\t[IndexerName(\"Chars\")]\n\t\textern virtual public char this[int index] {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\t#region Misc Methods\n\n\t\tpublic static string Join(string separator, string[] value) {\n\t\t\treturn Join(separator, value, 0, value.Length);\n\t\t}\n\n\t\tpublic static string Join(string separator, string[] value, int startIndex, int count) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int i = startIndex; i < count; i++) {\n\t\t\t\tsb.Append(value[i]);\n\t\t\t\tsb.Append(separator);\n\t\t\t}\n\t\t\treturn sb.ToString(0, sb.Length - separator.Length);\n\t\t}\n\n\t\tpublic string[] Split(params char[] separator) {\n\t\t\treturn this.Split(separator, int.MaxValue);\n\t\t}\n\n\t\tpublic string[] Split(char[] separator, int count) {\n\t\t\tif (count < 0) {\n\t\t\t\tthrow new ArgumentException(\"count\");\n\t\t\t}\n\t\t\tif (count == 0) {\n\t\t\t\treturn new string[0];\n\t\t\t}\n\t\t\tif (separator == null || separator.Length == 0) {\n\t\t\t\tseparator = char.WhiteChars;\n\t\t\t}\n\n\t\t\tList<string> ret = new List<string>();\n\n\t\t\tint pos = 0;\n\t\t\tfor (; count > 0; count--) {\n\t\t\t\tint sepPos = this.IndexOfAny(separator, pos);\n\t\t\t\tif (sepPos < 0) {\n\t\t\t\t\tret.Add(new string(this, pos, this.length - pos));\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tret.Add(new string(this, pos, sepPos - pos));\n\t\t\t\tpos = sepPos + 1;\n\t\t\t}\n\n\t\t\treturn ret.ToArray();\n\t\t}\n\n\t\tpublic bool StartsWith(string str) {\n\t\t\treturn this.Substring(0, str.length) == str;\n\t\t}\n\n\t\tpublic bool EndsWith(string str) {\n\t\t\treturn this.Substring(this.length - str.length, str.length) == str;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Concat Methods\n\n\t\tpublic static string Concat(string str0, string str1) {\n\t\t\tif (str0 == null) {\n\t\t\t\treturn str1 ?? string.Empty;\n\t\t\t}\n\t\t\tif (str1 == null) {\n\t\t\t\treturn str0;\n\t\t\t}\n\t\t\treturn InternalConcat(str0, str1);\n\t\t}\n\n\t\tpublic static string Concat(string str0, string str1, string str2) {\n\t\t\treturn Concat(Concat(str0, str1), str2);\n\t\t}\n\n\t\tpublic static string Concat(string str0, string str1, string str2, string str3) {\n\t\t\treturn Concat(Concat(str0, str1), Concat(str2, str3));\n\t\t}\n\n\t\tpublic static string Concat(params string[] values) {\n\t\t\tif (values == null) {\n\t\t\t\tthrow new ArgumentNullException(\"args\");\n\t\t\t}\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int i = 0; i < values.Length; i++) {\n\t\t\t\tsb.Append(values[i]);\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tpublic static string Concat(object obj0) {\n\t\t\treturn obj0.ToString();\n\t\t}\n\n\t\tpublic static string Concat(object obj0, object obj1) {\n\t\t\tstring str0 = (obj0 == null) ? null : obj0.ToString();\n\t\t\tstring str1 = (obj1 == null) ? null : obj1.ToString();\n\t\t\tif (str0 == null) {\n\t\t\t\treturn str1 ?? string.Empty;\n\t\t\t}\n\t\t\tif (str1 == null) {\n\t\t\t\treturn str0;\n\t\t\t}\n\t\t\treturn InternalConcat(str0, str1);\n\t\t}\n\n\t\tpublic static string Concat(object obj0, object obj1, object obj2) {\n\t\t\treturn Concat(new object[] { obj0, obj1, obj2 });\n\t\t}\n\n\t\tpublic static string Concat(object obj0, object obj1, object obj2, object obj3) {\n\t\t\treturn Concat(new object[] { obj0, obj1, obj2, obj3 });\n\t\t}\n\n\t\tpublic static string Concat(params object[] objs) {\n\t\t\tif (objs == null) {\n\t\t\t\tthrow new ArgumentNullException(\"args\");\n\t\t\t}\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tfor (int i = 0; i < objs.Length; i++) {\n\t\t\t\tsb.Append(objs[i]);\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Trim Methods\n\n\t\tpublic string Trim(params char[] trimChars) {\n\t\t\tif (trimChars == null || trimChars.Length == 0) {\n\t\t\t\ttrimChars = char.WhiteChars;\n\t\t\t}\n\t\t\treturn InternalTrim(trimChars, 3);\n\t\t}\n\n\t\tpublic string Trim() {\n\t\t\treturn InternalTrim(char.WhiteChars, 3);\n\t\t}\n\n\t\tpublic string TrimStart(params char[] trimChars) {\n\t\t\tif (trimChars == null || trimChars.Length == 0) {\n\t\t\t\ttrimChars = char.WhiteChars;\n\t\t\t}\n\t\t\treturn InternalTrim(trimChars, 1);\n\t\t}\n\n\t\tpublic string TrimEnd(params char[] trimChars) {\n\t\t\tif (trimChars == null || trimChars.Length == 0) {\n\t\t\t\ttrimChars = char.WhiteChars;\n\t\t\t}\n\t\t\treturn InternalTrim(trimChars, 2);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Substring Methods\n\n\t\tpublic string Substring(int startIndex) {\n\t\t\tif (startIndex < 0 || startIndex > this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\n\t\t\treturn new string(this, startIndex, this.length - startIndex);\n\t\t}\n\n\t\tpublic string Substring(int startIndex, int length) {\n\t\t\tif (startIndex < 0 || length < 0 || startIndex + length > this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\n\t\t\treturn new string(this, startIndex, length);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Format Methods\n\n\t\tpublic static string Format(string format, object obj0) {\n\t\t\treturn Format(null, format, new object[] { obj0 });\n\t\t}\n\n\t\tpublic static string Format(string format, object obj0, object obj1) {\n\t\t\treturn Format(null, format, new object[] { obj0, obj1 });\n\t\t}\n\n\t\tpublic static string Format(string format, object obj0, object obj1, object obj2) {\n\t\t\treturn Format(null, format, new object[] { obj0, obj1, obj2 });\n\t\t}\n\n\t\tpublic static string Format(string format, params object[] args) {\n\t\t\treturn Format(null, format, args);\n\t\t}\n\n\t\tpublic static string Format(IFormatProvider provider, string format, params object[] args) {\n\t\t\tStringBuilder sb = new StringBuilder();\n\t\t\tStringHelper.FormatHelper(sb, provider, format, args);\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Replace & Remove Methods\n\n\t\tpublic string Replace(char oldChar, char newChar) {\n\t\t\tStringBuilder sb = new StringBuilder(this);\n\t\t\treturn sb.Replace(oldChar, newChar).ToString();\n\t\t}\n\n\t\tpublic string Replace(string oldValue, string newValue) {\n\t\t\tif (oldValue == null) {\n\t\t\t\tthrow new ArgumentNullException(\"oldValue\");\n\t\t\t}\n\t\t\tif (oldValue.Length == 0) {\n\t\t\t\tthrow new ArgumentException(\"oldValue is an empty string.\");\n\t\t\t}\n\t\t\tif (this.length == 0) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (newValue == null) {\n\t\t\t\tnewValue = string.Empty;\n\t\t\t}\n\t\t\treturn InternalReplace(oldValue, newValue);\n\t\t}\n\n\t\tpublic string Remove(int startIndex) {\n\t\t\tif (startIndex < 0 || startIndex >= this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"startIndex\");\n\t\t\t}\n\t\t\treturn new string(this, 0, startIndex);\n\t\t}\n\n\t\tpublic string Remove(int startIndex, int count) {\n\t\t\tif (startIndex < 0 || count < 0 || startIndex + count >= this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tint pos2 = startIndex+count;\n\t\t\treturn (new string(this, 0, startIndex)) + (new string(this, pos2, this.length - pos2));\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Compare and CompareOrdinal Methods\n\n\t\tpublic static int Compare(string strA, string strB) {\n\t\t\treturn CompareOrdinal(strA, strB);\n\t\t}\n\n\t\tpublic static int Compare(string strA, int indexA, string strB, int indexB, int length) {\n\t\t\treturn CompareOrdinal(strA.Substring(indexA, length), strB.Substring(indexB, length));\n\t\t}\n\n\t\tpublic static int CompareOrdinal(string strA, string strB) {\n\t\t\tif (strA == null) {\n\t\t\t\tif (strB == null) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (strB == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tint top = Math.Min(strA.Length, strB.Length);\n\t\t\tfor (int i = 0; i < top; i++) {\n\t\t\t\tif (strA[i] != strB[i]) {\n\t\t\t\t\treturn (strA[i] - strB[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn strA.Length - strB.Length;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IndexOf... Methods\n\n\t\tpublic int IndexOf(string value) {\n\t\t\treturn IndexOf(value, 0, this.length);\n\t\t}\n\n\t\tpublic int IndexOf(string value, int startIndex) {\n\t\t\treturn IndexOf(value, startIndex, this.length - startIndex);\n\t\t}\n\n\t\tpublic int IndexOf(string value, int startIndex, int count) {\n\t\t\tif (value == null) {\n\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t}\n\t\t\tif (startIndex < 0 || count < 0 || startIndex + count > this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tif (value.length == 0) {\n\t\t\t\treturn startIndex;\n\t\t\t}\n\t\t\tint valueLen = value.length;\n\t\t\tint finalIndex = startIndex + count - valueLen + 1;\n\t\t\tchar char0 = value[0];\n\t\t\tfor (int i = startIndex; i < finalIndex; i++) {\n\t\t\t\tif (this[i] == char0) {\n\t\t\t\t\tbool ok = true;\n\t\t\t\t\tfor (int j = 1; j < valueLen; j++) {\n\t\t\t\t\t\tif (this[i + j] != value[j]) {\n\t\t\t\t\t\t\tok = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (ok) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic int IndexOf(char value) {\n\t\t\treturn this.IndexOf(value, 0, this.length, true);\n\t\t}\n\n\t\tpublic int IndexOf(char value, int startIndex) {\n\t\t\treturn this.IndexOf(value, startIndex, this.length - startIndex, true);\n\t\t}\n\n\t\tpublic int IndexOf(char value, int startIndex, int count) {\n\t\t\treturn this.IndexOf(value, startIndex, count, true);\n\t\t}\n\n\t\tpublic int LastIndexOf(char value) {\n\t\t\treturn this.IndexOf(value, 0, this.length, false);\n\t\t}\n\n\t\tpublic int LastIndexOf(char value, int startIndex) {\n\t\t\treturn this.IndexOf(value, startIndex, this.length - startIndex, false);\n\t\t}\n\n\t\tpublic int LastIndexOf(char value, int startIndex, int count) {\n\t\t\treturn this.IndexOf(value, startIndex, count, false);\n\t\t}\n\n\t\tprivate int IndexOf(char value, int startIndex, int count, bool forwards) {\n\t\t\tif (startIndex < 0 || count < 0 || startIndex + count > this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\treturn this.InternalIndexOf(value, startIndex, count, forwards);\n\t\t}\n\n\t\tpublic int IndexOfAny(char[] anyOf) {\n\t\t\treturn this.IndexOfAny(anyOf, 0, this.length, true);\n\t\t}\n\n\t\tpublic int IndexOfAny(char[] anyOf, int startIndex) {\n\t\t\treturn this.IndexOfAny(anyOf, startIndex, this.length - startIndex, true);\n\t\t}\n\n\t\tpublic int IndexOfAny(char[] anyOf, int startIndex, int count) {\n\t\t\treturn this.IndexOfAny(anyOf, startIndex, count, true);\n\t\t}\n\n\t\tpublic int LastIndexOfAny(char[] anyOf) {\n\t\t\treturn this.IndexOfAny(anyOf, 0, this.length, false);\n\t\t}\n\n\t\tpublic int LastIndexOfAny(char[] anyOf, int startIndex) {\n\t\t\treturn this.IndexOfAny(anyOf, startIndex, this.length - startIndex, false);\n\t\t}\n\n\t\tpublic int LastIndexOfAny(char[] anyOf, int startIndex, int count) {\n\t\t\treturn this.IndexOfAny(anyOf, startIndex, count, false);\n\t\t}\n\n\t\tprivate int IndexOfAny(char[] anyOf, int startIndex, int count, bool forward) {\n\t\t\tif (startIndex < 0 || count < 0 || startIndex + count > this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\t/*int anyOfLen = anyOf.Length;\n\t\t\tint finIndex = (forward) ? (startIndex + count) : (startIndex - 1);\n\t\t\tint inc = (forward) ? 1 : -1;\n\t\t\tfor (int i = (forward) ? startIndex : (startIndex + count - 1); i != finIndex; i += inc) {\n\t\t\t\tchar c = this[i];\n\t\t\t\tfor (int j = 0; j < anyOfLen; j++) {\n\t\t\t\t\tif (c == anyOf[j]) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;*/\n\t\t\treturn this.InternalIndexOfAny(anyOf, startIndex, count, forward);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Case methods\n\n\t\tpublic string ToLower() {\n\t\t\treturn ToLower(CultureInfo.CurrentCulture);\n\t\t}\n\n\t\tpublic string ToLower(CultureInfo culture) {\n\t\t\tif (culture == null) {\n\t\t\t\tthrow new ArgumentNullException(\"culture\");\n\t\t\t}\n\t\t\tif (culture.LCID == 0x007f) {\n\t\t\t\treturn ToLowerInvariant();\n\t\t\t}\n\t\t\treturn culture.TextInfo.ToLower(this);\n\t\t}\n\n\t\tpublic string ToLowerInvariant() {\n\t\t\tint len = this.length;\n\t\t\tStringBuilder sb = new StringBuilder(len);\n\t\t\tfor (int i = 0; i < len; i++) {\n\t\t\t\tsb.Append(char.ToLowerInvariant(this[i]));\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tpublic string ToUpper() {\n\t\t\treturn ToLower(CultureInfo.CurrentCulture);\n\t\t}\n\n\t\tpublic string ToUpper(CultureInfo culture) {\n\t\t\tif (culture == null) {\n\t\t\t\tthrow new ArgumentNullException(\"culture\");\n\t\t\t}\n\t\t\tif (culture.LCID == 0x007f) {\n\t\t\t\treturn ToUpperInvariant();\n\t\t\t}\n\t\t\treturn culture.TextInfo.ToUpper(this);\n\t\t}\n\n\t\tpublic string ToUpperInvariant() {\n\t\t\tint len = this.length;\n\t\t\tStringBuilder sb = new StringBuilder(len);\n\t\t\tfor (int i = 0; i < len; i++) {\n\t\t\t\tsb.Append(char.ToUpperInvariant(this[i]));\n\t\t\t}\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Overrides and Operators\n\n\t\tpublic override string ToString() {\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\treturn Equals(this, obj as string);\n\t\t}\n\n\t\tpublic static bool operator ==(string a, string b) {\n\t\t\treturn Equals(a, b);\n\t\t}\n\n\t\tpublic static bool operator !=(string a, string b) {\n\t\t\treturn !Equals(a, b);\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static bool Equals(string a, string b);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public override int GetHashCode();\n\n\t\t#endregion\n\n\t\t#region IClonable Members\n\n\t\tpublic object Clone() {\n\t\t\treturn this;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object value) {\n\t\t\tif (value == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(value is string)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn string.Compare(this, (string)value);\n\t\t}\n\n\t\tpublic int CompareTo(string value) {\n\t\t\tif (value == null)\n\t\t\t\treturn 1;\n\n\t\t\treturn string.Compare(this, value);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<string> Members\n\n\t\tpublic bool Equals(string other) {\n\t\t\treturn Equals(this, other);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEnumerable Members\n\n\t\tpublic IEnumerator GetEnumerator() {\n\t\t\treturn new CharEnumerator(this);\n\t\t}\n\n\t\tIEnumerator<char> IEnumerable<char>.GetEnumerator() {\n\t\t\treturn new CharEnumerator(this);\n\t\t}\n\n\t\t#endregion\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System/StringComparison.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic enum StringComparison {\n\t\tCurrentCulture,\n\t\tCurrentCultureIgnoreCase,\n\t\tInvariantCulture,\n\t\tInvariantCultureIgnoreCase,\n\t\tOrdinal,\n\t\tOrdinalIgnoreCase\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/StringHelper.cs",
    "content": "\n#if LOCALTEST\nusing System;\nusing System_.Text;\nnamespace System_ {\n#else\nusing System.Text;\nnamespace System {\n#endif\n\tinternal static class StringHelper {\n\n\t\tprivate static int ParseDecimal(string str, ref int ptr) {\n\t\t\tint p = ptr;\n\t\t\tint n = 0;\n\t\t\twhile (true) {\n\t\t\t\tchar c = str[p];\n\t\t\t\tif (c < '0' || c > '9') {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tn = n * 10 + c - '0';\n\t\t\t\t++p;\n\t\t\t}\n\t\t\tif (p == ptr) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tptr = p;\n\t\t\treturn n;\n\t\t}\n\n\t\tprivate static void ParseFormatSpecifier(string str, ref int ptr, out int n, out int width, out bool leftAlign, out string format) {\n\t\t\t// parses format specifier of form:\n\t\t\t//   N,[\\ +[-]M][:F]}\n\t\t\t//\n\t\t\t// where:\n\t\t\ttry {\n\t\t\t\t// N = argument number (non-negative integer)\n\t\t\t\tn = ParseDecimal(str, ref ptr);\n\t\t\t\tif (n < 0) {\n\t\t\t\t\tthrow new FormatException(\"Input string was not in a correct format.\");\n\t\t\t\t}\n\t\t\t\t// M = width (non-negative integer)\n\t\t\t\tif (str[ptr] == ',') {\n\t\t\t\t\t// White space between ',' and number or sign.\n\t\t\t\t\t++ptr;\n\t\t\t\t\twhile (char.IsWhiteSpace(str[ptr])) {\n\t\t\t\t\t\t++ptr;\n\t\t\t\t\t}\n\t\t\t\t\tint start = ptr;\n\n\t\t\t\t\tformat = str.Substring(start, ptr - start);\n\n\t\t\t\t\tleftAlign = (str[ptr] == '-');\n\t\t\t\t\tif (leftAlign) {\n\t\t\t\t\t\t++ptr;\n\t\t\t\t\t}\n\t\t\t\t\twidth = ParseDecimal(str, ref ptr);\n\t\t\t\t\tif (width < 0) {\n\t\t\t\t\t\tthrow new FormatException(\"Input string was not in a correct format.\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twidth = 0;\n\t\t\t\t\tleftAlign = false;\n\t\t\t\t\tformat = string.Empty;\n\t\t\t\t}\n\n\t\t\t\t// F = argument format (string)\n\n\t\t\t\tif (str[ptr] == ':') {\n\t\t\t\t\tint start = ++ptr;\n\t\t\t\t\twhile (str[ptr] != '}') {\n\t\t\t\t\t\t++ptr;\n\t\t\t\t\t}\n\t\t\t\t\tformat += str.Substring(start, ptr - start);\n\t\t\t\t} else\n\t\t\t\t\tformat = null;\n\n\t\t\t\tif (str[ptr++] != '}') {\n\t\t\t\t\tthrow new FormatException(\"Input string was not in a correct format.\");\n\t\t\t\t}\n\t\t\t} catch (IndexOutOfRangeException) {\n\t\t\t\tthrow new FormatException(\"Input string was not in a correct format.\");\n\t\t\t}\n\t\t}\n\n\t\tinternal static void FormatHelper(StringBuilder result, IFormatProvider provider, string format, params object[] args) {\n\n\t\t\tif (format == null || args == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\n\t\t\tint ptr = 0, start = 0, formatLen = format.Length;\n\t\t\twhile (ptr < formatLen) {\n\t\t\t\tchar c = format[ptr++];\n\t\t\t\tif (c == '{') {\n\t\t\t\t\tresult.Append(format, start, ptr - start - 1);\n\t\t\t\t\tif (format[ptr] == '{') {\n\t\t\t\t\t\t// If a \"{{\" is found then it's not a format specifier, so just continue\n\t\t\t\t\t\tstart = ptr++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Start of format specifier, so parse it\n\t\t\t\t\tint n, width;\n\t\t\t\t\tbool leftAlign;\n\t\t\t\t\tstring argFormat;\n\n\t\t\t\t\tParseFormatSpecifier (format, ref ptr, out n, out width, out leftAlign, out argFormat);\n\t\t\t\t\tif (n >= args.Length) {\n\t\t\t\t\t\tthrow new FormatException(\"Index (zero based) must be greater than or equal to zero and less than the size of the argument list.\");\n\t\t\t\t\t}\n\t\t\t\t\t// Format the argument\n\t\t\t\t\tobject arg = args[n];\n\t\t\t\t\tstring str;\n\t\t\t\t\tICustomFormatter formatter = null;\n\t\t\t\t\tif (provider != null) {\n\t\t\t\t\t\tformatter = provider.GetFormat(typeof(ICustomFormatter)) as ICustomFormatter;\n\t\t\t\t\t}\n\t\t\t\t\tif (arg == null) {\n\t\t\t\t\t\tstr = string.Empty;\n\t\t\t\t\t} else if (formatter != null) {\n\t\t\t\t\t\tstr = formatter.Format(argFormat, arg, provider);\n\t\t\t\t\t} else if (arg is IFormattable) {\n\t\t\t\t\t\tstr = ((IFormattable)arg).ToString(argFormat, provider);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstr = arg.ToString();\n\t\t\t\t\t}\n\t\t\t\t\t// Apply any padding needed and append to result\n\t\t\t\t\tif (width > str.Length) {\n\t\t\t\t\t\tint padLen = width - str.Length;\n\t\t\t\t\t\tif (leftAlign) {\n\t\t\t\t\t\t\tresult.Append(str);\n\t\t\t\t\t\t\tresult.Append(' ', padLen);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult.Append(' ', padLen);\n\t\t\t\t\t\t\tresult.Append(str);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult.Append(str);\n\t\t\t\t\t}\n\t\t\t\t\tstart = ptr;\n\t\t\t\t} else if (c == '}') {\n\t\t\t\t\tif (ptr < formatLen && format[ptr] == '}') {\n\t\t\t\t\t\t// Handle case of \"}}\" appearing in the string\n\t\t\t\t\t\tresult.Append(format, start, ptr - start - 1);\n\t\t\t\t\t\tstart = ptr++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// single \"}\" not allowed without \"{\" beforehand\n\t\t\t\t\t\tthrow new FormatException(\"Input string was not of the correct format.\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (start < formatLen) {\n\t\t\t\tresult.Append(format, start, formatLen - start);\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "corlib/System/SystemException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic class SystemException : Exception {\n\n\t\tpublic SystemException() : base(\"A SystemException has occured.\") { }\n\n\t\tpublic SystemException(string message) : base(message) { }\n\n\t\tpublic SystemException(string message, Exception innerException) : base(message, innerException) { }\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/TimeSpan.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Text;\nnamespace System {\n\tpublic struct TimeSpan : IComparable, IComparable<TimeSpan>, IEquatable<TimeSpan> {\n\n\t\tpublic static readonly TimeSpan MaxValue = new TimeSpan(long.MaxValue);\n\t\tpublic static readonly TimeSpan MinValue = new TimeSpan(long.MinValue);\n\t\tpublic static readonly TimeSpan Zero = new TimeSpan(0L);\n\n\t\tpublic const long TicksPerDay = 864000000000L;\n\t\tpublic const long TicksPerHour = 36000000000L;\n\t\tpublic const long TicksPerMillisecond = 10000L;\n\t\tpublic const long TicksPerMinute = 600000000L;\n\t\tpublic const long TicksPerSecond = 10000000L;\n\n\t\tprivate long ticks;\n\n\t\tpublic TimeSpan(long ticks) {\n\t\t\tthis.ticks = ticks;\n\t\t}\n\n\t\tpublic TimeSpan(int hours, int minutes, int seconds) {\n\t\t\tthis.ticks = CalcTicks(0, hours, minutes, seconds, 0);\n\t\t}\n\n\t\tpublic TimeSpan(int days, int hours, int minutes, int seconds) {\n\t\t\tthis.ticks = CalcTicks(days, hours, minutes, seconds, 0);\n\t\t}\n\n\t\tpublic TimeSpan(int days, int hours, int minutes, int seconds, int milliseconds) {\n\t\t\tthis.ticks = CalcTicks(days, hours, minutes, seconds, milliseconds);\n\t\t}\n\n\t\tprivate static long CalcTicks(int days, int hours, int minutes, int seconds, int millis) {\n\t\t\tlong t;\n\t\t\tt = (long)days * TicksPerDay +\n\t\t\t\t(long)hours * TicksPerHour + (long)minutes * TicksPerMinute +\n\t\t\t\t(long)seconds * TicksPerSecond + (long)millis * TicksPerMillisecond;\n\t\t\treturn t;\n\t\t}\n\n\t\tpublic int Days {\n\t\t\tget {\n\t\t\t\treturn (int)(this.ticks / TicksPerDay);\n\t\t\t}\n\t\t}\n\n\t\tpublic int Hours {\n\t\t\tget {\n\t\t\t\treturn (int)((this.ticks % TicksPerDay) / TicksPerHour);\n\t\t\t}\n\t\t}\n\n\t\tpublic int Minutes {\n\t\t\tget {\n\t\t\t\treturn (int)((this.ticks % TicksPerHour) / TicksPerMinute);\n\t\t\t}\n\t\t}\n\n\t\tpublic int Seconds {\n\t\t\tget {\n\t\t\t\treturn (int)((this.ticks % TicksPerMinute) / TicksPerSecond);\n\t\t\t}\n\t\t}\n\n\t\tpublic int MilliSeconds {\n\t\t\tget {\n\t\t\t\treturn (int)((this.ticks % TicksPerSecond) / TicksPerMillisecond);\n\t\t\t}\n\t\t}\n\n\t\tpublic long Ticks {\n\t\t\tget {\n\t\t\t\treturn this.ticks;\n\t\t\t}\n\t\t}\n\n\t\tpublic double TotalDays {\n\t\t\tget {\n\t\t\t\treturn ((double)this.ticks) / ((double)TicksPerDay);\n\t\t\t}\n\t\t}\n\n\t\tpublic double TotalHours {\n\t\t\tget {\n\t\t\t\treturn ((double)this.ticks) / ((double)TicksPerHour);\n\t\t\t}\n\t\t}\n\n\t\tpublic double TotalMinutes {\n\t\t\tget {\n\t\t\t\treturn ((double)this.ticks) / ((double)TicksPerMinute);\n\t\t\t}\n\t\t}\n\n\t\tpublic double TotalSeconds {\n\t\t\tget {\n\t\t\t\treturn ((double)this.ticks) / ((double)TicksPerSecond);\n\t\t\t}\n\t\t}\n\n\t\tpublic double TotalMilliseconds {\n\t\t\tget {\n\t\t\t\treturn ((double)this.ticks) / ((double)TicksPerMillisecond);\n\t\t\t}\n\t\t}\n\n\t\tpublic TimeSpan Add(TimeSpan ts) {\n\t\t\treturn new TimeSpan(this.ticks + ts.ticks);\n\t\t}\n\n\t\tpublic TimeSpan Subtract(TimeSpan ts) {\n\t\t\treturn new TimeSpan(this.ticks - ts.ticks);\n\t\t}\n\n\t\tpublic TimeSpan Negate(TimeSpan ts) {\n\t\t\treturn new TimeSpan(-this.ticks);\n\t\t}\n\n\t\tpublic TimeSpan Duration() {\n\t\t\treturn new TimeSpan(Math.Abs(this.ticks));\n\t\t}\n\n\t\tpublic static int Compare(TimeSpan t1, TimeSpan t2) {\n\t\t\tif (t1.ticks < t2.ticks) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (t1.ticks > t2.ticks) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is TimeSpan)) {\n\t\t\t\tthrow new ArgumentException(\"Object must be a TimeSpan\");\n\t\t\t}\n\t\t\treturn Compare(this, (TimeSpan)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<TimeSpan> Members\n\n\t\tpublic int CompareTo(TimeSpan x) {\n\t\t\treturn Compare(this, x);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<TimeSpan> Members\n\n\t\tpublic bool Equals(TimeSpan x) {\n\t\t\treturn this.ticks == x.ticks;\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn this.ticks.GetHashCode();\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\tif (!(obj is TimeSpan)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn this.ticks == ((TimeSpan)obj).ticks;\n\t\t}\n\n\t\tpublic static bool Equals(TimeSpan t1, TimeSpan t2) {\n\t\t\treturn t1.ticks == t2.ticks;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\tStringBuilder sb = new StringBuilder(14);\n\n\t\t\tif (this.ticks < 0) {\n\t\t\t\tsb.Append('-');\n\t\t\t}\n\t\t\tif (this.Days != 0) {\n\t\t\t\tsb.Append(Math.Abs(this.Days));\n\t\t\t\tsb.Append('.');\n\t\t\t}\n\t\t\tsb.AppendFormat(\"{0:D2}:{1:D2}:{2:D2}\",\n\t\t\t\tMath.Abs(this.Hours), Math.Abs(this.Minutes), Math.Abs(this.Seconds));\n\t\t\tif (this.MilliSeconds != 0) {\n\t\t\t\tsb.Append('.');\n\t\t\t\tsb.AppendFormat(\"{0:D7}\", Math.Abs(this.MilliSeconds) * (int)TicksPerMillisecond);\n\t\t\t}\n\n\t\t\treturn sb.ToString();\n\t\t}\n\n\t\tpublic static TimeSpan operator +(TimeSpan t1, TimeSpan t2) {\n\t\t\treturn new TimeSpan(t1.ticks + t2.ticks);\n\t\t}\n\n\t\tpublic static TimeSpan operator -(TimeSpan t1, TimeSpan t2) {\n\t\t\treturn new TimeSpan(t1.ticks - t2.ticks);\n\t\t}\n\n\t\tpublic static bool operator ==(TimeSpan t1, TimeSpan t2) {\n\t\t\treturn t1.ticks == t2.ticks;\n\t\t}\n\n\t\tpublic static bool operator !=(TimeSpan t1, TimeSpan t2) {\n\t\t\treturn t1.ticks != t2.ticks;\n\t\t}\n\n\t\tpublic static bool operator >(TimeSpan t1, TimeSpan t2) {\n\t\t\treturn t1.ticks > t2.ticks;\n\t\t}\n\n\t\tpublic static bool operator >=(TimeSpan t1, TimeSpan t2) {\n\t\t\treturn t1.ticks >= t2.ticks;\n\t\t}\n\n\t\tpublic static bool operator <(TimeSpan t1, TimeSpan t2) {\n\t\t\treturn t1.ticks < t2.ticks;\n\t\t}\n\n\t\tpublic static bool operator <=(TimeSpan t1, TimeSpan t2) {\n\t\t\treturn t1.ticks <= t2.ticks;\n\t\t}\n\n\t\tpublic static TimeSpan operator +(TimeSpan ts) {\n\t\t\treturn ts;\n\t\t}\n\n\t\tpublic static TimeSpan operator -(TimeSpan ts) {\n\t\t\treturn new TimeSpan(-ts.ticks);\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Type.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.Reflection;\n\nnamespace System {\n\tpublic abstract class Type : MemberInfo {\n\n\t\tpublic static readonly Type[] EmptyTypes = new Type[0];\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static Type GetTypeFromHandle(RuntimeTypeHandle handle);\n\n\t\tpublic abstract Type BaseType {\n\t\t\tget;\n\t\t}\n\n\t\tpublic abstract bool IsEnum {\n\t\t\tget;\n\t\t}\n\n\t\tpublic abstract string Namespace {\n\t\t\tget;\n\t\t}\n\n\t\tpublic abstract string FullName {\n\t\t\tget;\n\t\t}\n\n\t\tpublic abstract bool IsGenericType {\n\t\t\tget;\n\t\t}\n\n\t\tpublic abstract Type GetGenericTypeDefinition();\n\n\t\tpublic abstract Type[] GetGenericArguments();\n\n\t\textern public bool IsValueType {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn this.FullName;\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/UInt16.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Globalization;\nnamespace System {\n\tpublic struct UInt16:IFormattable,IComparable,IComparable<ushort>,IEquatable<ushort> {\n\t\tpublic const ushort MaxValue = 0xffff;\n\t\tpublic const ushort MinValue = 0;\n\n#pragma warning disable 0169, 0649\n        internal ushort m_value;\n#pragma warning restore 0169, 0649\n\n        public override bool Equals(object obj) {\n\t\t\treturn (obj is ushort) && ((ushort)obj).m_value == this.m_value;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.m_value;\n\t\t}\n\n\t\t#region ToString methods\n\n\t\tpublic override string ToString() {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value));\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider formatProvider) {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value), formatProvider);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn this.ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider formatProvider) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(formatProvider);\n\t\t\treturn NumberFormatter.NumberToString(format, this.m_value, nfi);\n\t\t}\n\n\t\t#endregion\n\n#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is ushort)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((ushort)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<ushort> Members\n\n\t\tpublic int CompareTo(ushort x) {\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<ushort> Members\n\n\t\tpublic bool Equals(ushort x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\t\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/UInt32.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.Globalization;\nnamespace System {\n\tpublic struct UInt32 : IFormattable, IComparable, IComparable<uint>, IEquatable<uint> {\n\t\tpublic const uint MaxValue = 0xffffffff;\n\t\tpublic const uint MinValue = 0;\n\n#pragma warning disable 0169, 0649\n        internal uint m_value;\n#pragma warning restore 0169, 0649\n\n        public override bool Equals(object obj) {\n\t\t\treturn (obj is uint) && ((uint)obj).m_value == this.m_value;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.m_value;\n\t\t}\n\n\t\t#region ToString methods\n\n\t\tpublic override string ToString() {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value));\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider formatProvider) {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value), formatProvider);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider formatProvider) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(formatProvider);\n\t\t\treturn NumberFormatter.NumberToString(format, m_value, nfi);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is uint)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((uint)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<uint> Members\n\n\t\tpublic int CompareTo(uint x) {\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<uint> Members\n\n\t\tpublic bool Equals(uint x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/UInt64.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Globalization;\nnamespace System {\n\tpublic struct UInt64 : IFormattable, IComparable, IComparable<ulong>, IEquatable<ulong> {\n\n\t\tpublic const ulong MinValue = 0;\n\t\tpublic const ulong MaxValue = 0xffffffffffffffffL;\n\n#pragma warning disable 0169, 0649\n        internal ulong m_value;\n#pragma warning restore 0169, 0649\n\n        public override bool Equals(object obj) {\n\t\t\treturn (obj is ulong) && ((ulong)obj).m_value == this.m_value;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)(this.m_value & 0xffffffff) ^ (int)(this.m_value >> 32);\n\t\t}\n\n\t\t#region ToString methods\n\n\t\tpublic override string ToString() {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value));\n\t\t}\n\n\t\tpublic string ToString(IFormatProvider formatProvider) {\n\t\t\treturn NumberFormatter.FormatGeneral(new NumberFormatter.NumberStore(this.m_value), formatProvider);\n\t\t}\n\n\t\tpublic string ToString(string format) {\n\t\t\treturn this.ToString(format, null);\n\t\t}\n\n\t\tpublic string ToString(string format, IFormatProvider formatProvider) {\n\t\t\tNumberFormatInfo nfi = NumberFormatInfo.GetInstance(formatProvider);\n\t\t\treturn NumberFormatter.NumberToString(format, this.m_value, nfi);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable Members\n\n\t\tpublic int CompareTo(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(obj is ulong)) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\treturn this.CompareTo((ulong)obj);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IComparable<ulong> Members\n\n\t\tpublic int CompareTo(ulong x) {\n\t\t\treturn (this.m_value > x) ? 1 : ((this.m_value < x) ? -1 : 0);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region IEquatable<ulong> Members\n\n\t\tpublic bool Equals(ulong x) {\n\t\t\treturn this.m_value == x;\n\t\t}\n\n\t\t#endregion\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/UIntPtr.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic unsafe struct UIntPtr {\n\n\t\tprivate void* value;\n\n\t\tpublic UIntPtr(uint value) {\n\t\t\tthis.value = (void*)value;\n\t\t}\n\n\t\tpublic UIntPtr(ulong value) {\n\t\t\tthis.value = (void*)value;\n\t\t}\n\n\t\tpublic UIntPtr(void* value) {\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tpublic static int Size {\n\t\t\tget {\n\t\t\t\treturn sizeof(void*);\n\t\t\t}\n\t\t}\n\n\t\tpublic uint ToUInt32() {\n\t\t\treturn (uint)this.value;\n\t\t}\n\n\t\tpublic ulong ToUInt64() {\n\t\t\treturn (ulong)this.value;\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\treturn (obj is UIntPtr && ((UIntPtr)obj).value == this.value);\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (int)this.value;\n\t\t}\n\n\t\tpublic static bool operator ==(UIntPtr a, UIntPtr b) {\n\t\t\treturn a.value == b.value;\n\t\t}\n\n\t\tpublic static bool operator !=(UIntPtr a, UIntPtr b) {\n\t\t\treturn a.value != b.value;\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\tif (Size == 4) {\n\t\t\t\treturn string.Format(\"0x{0:x4}\", (int)this.value);\n\t\t\t} else {\n\t\t\t\treturn string.Format(\"0x{0:x8}\", (long)this.value);\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System/ValueType.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\n\nnamespace System {\n\tpublic abstract class ValueType {\n\n\t\tprotected ValueType() {\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static object[] GetFields(object o1, object o2);\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\tif (obj == null || this.GetType() != obj.GetType()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tobject[] fields = GetFields(this, obj);\n\t\t\tint len = fields.Length;\n\t\t\tfor (int i = 0; i < len; i += 2) {\n\t\t\t\tobject meVal = fields[i];\n\t\t\t\tobject youVal = fields[i + 1];\n\t\t\t\tif (!object.Equals(meVal, youVal)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\tobject[] fields = GetFields(this, null);\n\n\t\t\tint hash = 0;\n\t\t\tint len = fields.Length;\n\t\t\tfor (int i = 0; i < len; i++) {\n\t\t\t\thash ^= fields[i].GetHashCode();\n\t\t\t}\n\t\t\treturn hash;\n\t\t}\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System/Version.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\n\tpublic sealed class Version : ICloneable, IComparable, IComparable<Version>, IEquatable<Version> {\n\t\tint _Major, _Minor, _Build, _Revision;\n\n\t\tprivate const int UNDEFINED = -1;\n\n\t\tprivate void CheckedSet(int defined, int major, int minor, int build, int revision) {\n\t\t\t// defined should be 2, 3 or 4\n\n\t\t\tif (major < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"major\");\n\t\t\t}\n\t\t\tthis._Major = major;\n\n\t\t\tif (minor < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"minor\");\n\t\t\t}\n\t\t\tthis._Minor = minor;\n\n\t\t\tif (defined == 2) {\n\t\t\t\tthis._Build = UNDEFINED;\n\t\t\t\tthis._Revision = UNDEFINED;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (build < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"build\");\n\t\t\t}\n\t\t\tthis._Build = build;\n\n\t\t\tif (defined == 3) {\n\t\t\t\tthis._Revision = UNDEFINED;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (revision < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"revision\");\n\t\t\t}\n\t\t\tthis._Revision = revision;\n\t\t}\n\n\t\tpublic Version() {\n\t\t\tCheckedSet(2, 0, 0, -1, -1);\n\t\t}\n\n\t\tpublic Version(string version) {\n\t\t\tint n;\n\t\t\tstring[] vals;\n\t\t\tint major = -1, minor = -1, build = -1, revision = -1;\n\n\t\t\tif (version == null) {\n\t\t\t\tthrow new ArgumentNullException(\"version\");\n\t\t\t}\n\n\t\t\tvals = version.Split('.');\n\t\t\tn = vals.Length;\n\n\t\t\tif (n < 2 || n > 4) {\n\t\t\t\tthrow new ArgumentException(\"There must be 2, 3 or 4 components in the version string.\");\n\t\t\t}\n\n\t\t\tif (n > 0) {\n\t\t\t\tmajor = int.Parse(vals[0]);\n\t\t\t}\n\t\t\tif (n > 1) {\n\t\t\t\tminor = int.Parse(vals[1]);\n\t\t\t}\n\t\t\tif (n > 2) {\n\t\t\t\tbuild = int.Parse(vals[2]);\n\t\t\t}\n\t\t\tif (n > 3) {\n\t\t\t\trevision = int.Parse(vals[3]);\n\t\t\t}\n\n\t\t\tCheckedSet(n, major, minor, build, revision);\n\t\t}\n\n\t\tpublic Version(int major, int minor) {\n\t\t\tCheckedSet(2, major, minor, 0, 0);\n\t\t}\n\n\t\tpublic Version(int major, int minor, int build) {\n\t\t\tCheckedSet(3, major, minor, build, 0);\n\t\t}\n\n\t\tpublic Version(int major, int minor, int build, int revision) {\n\t\t\tCheckedSet(4, major, minor, build, revision);\n\t\t}\n\n\t\tpublic int Build {\n\t\t\tget {\n\t\t\t\treturn _Build;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Major {\n\t\t\tget {\n\t\t\t\treturn _Major;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Minor {\n\t\t\tget {\n\t\t\t\treturn _Minor;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Revision {\n\t\t\tget {\n\t\t\t\treturn _Revision;\n\t\t\t}\n\t\t}\n\n\t\tpublic short MajorRevision {\n\t\t\tget {\n\t\t\t\treturn (short)(_Revision >> 16);\n\t\t\t}\n\t\t}\n\n\t\tpublic short MinorRevision {\n\t\t\tget {\n\t\t\t\treturn (short)_Revision;\n\t\t\t}\n\t\t}\n\n\t\tpublic object Clone() {\n\t\t\tif (_Build == -1) {\n\t\t\t\treturn new Version(_Major, _Minor);\n\t\t\t} else if (_Revision == -1) {\n\t\t\t\treturn new Version(_Major, _Minor, _Build);\n\t\t\t} else {\n\t\t\t\treturn new Version(_Major, _Minor, _Build, _Revision);\n\t\t\t}\n\t\t}\n\n\t\tpublic int CompareTo(object version) {\n\t\t\tif (version == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (!(version is Version)) {\n\t\t\t\tthrow new ArgumentException(\"Argument to Version.CompareTo must be a Version.\");\n\t\t\t}\n\t\t\treturn this.CompareTo((Version)version);\n\t\t}\n\n\t\tpublic override bool Equals(object obj) {\n\t\t\treturn this.Equals(obj as Version);\n\t\t}\n\n\t\tpublic int CompareTo(Version v) {\n\t\t\tif (v == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (this._Major > v._Major) {\n\t\t\t\treturn 1;\n\t\t\t} else if (this._Major < v._Major) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (this._Minor > v._Minor) {\n\t\t\t\treturn 1;\n\t\t\t} else if (this._Minor < v._Minor) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (this._Build > v._Build) {\n\t\t\t\treturn 1;\n\t\t\t} else if (this._Build < v._Build) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif (this._Revision > v._Revision) {\n\t\t\t\treturn 1;\n\t\t\t} else if (this._Revision < v._Revision) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic bool Equals(Version x) {\n\t\t\treturn ((x != null) &&\n\t\t\t\t(x._Major == _Major) &&\n\t\t\t\t(x._Minor == _Minor) &&\n\t\t\t\t(x._Build == _Build) &&\n\t\t\t\t(x._Revision == _Revision));\n\t\t}\n\n\t\tpublic override int GetHashCode() {\n\t\t\treturn (_Revision << 24) | (_Build << 16) | (_Minor << 8) | _Major;\n\t\t}\n\n\t\t// <summary>\n\t\t//   Returns a stringified representation of the version, format:\n\t\t//   major.minor[.build[.revision]]\n\t\t// </summary>\n\t\tpublic override string ToString() {\n\t\t\tstring mm = _Major.ToString() + \".\" + _Minor.ToString();\n\n\t\t\tif (_Build != UNDEFINED) {\n\t\t\t\tmm = mm + \".\" + _Build.ToString();\n\t\t\t}\n\t\t\tif (_Revision != UNDEFINED) {\n\t\t\t\tmm = mm + \".\" + _Revision.ToString();\n\t\t\t}\n\n\t\t\treturn mm;\n\t\t}\n\n\t\t// <summary>\n\t\t//    LAME: This API is lame, since there is no way of knowing\n\t\t//    how many fields a Version object has, it is unfair to throw\n\t\t//    an ArgumentException, but this is what the spec claims.\n\t\t//\n\t\t//    ie, Version a = new Version (1, 2);  a.ToString (3) should\n\t\t//    throw the expcetion.\n\t\t// </summary>\n\t\tpublic string ToString(int fields) {\n\t\t\tif (fields == 0) {\n\t\t\t\treturn String.Empty;\n\t\t\t}\n\t\t\tif (fields == 1) {\n\t\t\t\treturn _Major.ToString();\n\t\t\t}\n\t\t\tif (fields == 2) {\n\t\t\t\treturn _Major.ToString() + \".\" + _Minor.ToString();\n\t\t\t}\n\t\t\tif (fields == 3) {\n\t\t\t\tif (_Build == UNDEFINED) {\n\t\t\t\t\tthrow new ArgumentException\n\t\t\t\t\t\t(\"fields is larger than the number of components defined in this instance.\");\n\t\t\t\t}\n\t\t\t\treturn _Major.ToString() + \".\" + _Minor.ToString() + \".\" + _Build.ToString();\n\t\t\t}\n\t\t\tif (fields == 4) {\n\t\t\t\tif (_Build == UNDEFINED || _Revision == UNDEFINED) {\n\t\t\t\t\tthrow new ArgumentException\n\t\t\t\t\t\t(\"fields is larger than the number of components defined in this instance.\");\n\t\t\t\t}\n\t\t\t\treturn _Major.ToString() + \".\" + _Minor.ToString() + \".\" + _Build.ToString() + \".\" + _Revision.ToString();\n\t\t\t}\n\t\t\tthrow new ArgumentException(\"Invalid fields parameter: \" + fields.ToString());\n\t\t}\n\n\t\tpublic static bool operator ==(Version v1, Version v2) {\n\t\t\treturn Equals(v1, v2);\n\t\t}\n\n\t\tpublic static bool operator !=(Version v1, Version v2) {\n\t\t\treturn !Equals(v1, v2);\n\t\t}\n\n\t\tpublic static bool operator >(Version v1, Version v2) {\n\t\t\treturn v1.CompareTo(v2) > 0;\n\t\t}\n\n\t\tpublic static bool operator >=(Version v1, Version v2) {\n\t\t\treturn v1.CompareTo(v2) >= 0;\n\t\t}\n\n\t\tpublic static bool operator <(Version v1, Version v2) {\n\t\t\treturn v1.CompareTo(v2) < 0;\n\t\t}\n\n\t\tpublic static bool operator <=(Version v1, Version v2) {\n\t\t\treturn v1.CompareTo(v2) <= 0;\n\t\t}\n\n\t\t// a very gentle way to construct a Version object which takes \n\t\t// the first four numbers in a string as the version\n\t\tinternal static Version CreateFromString(string info) {\n\t\t\tint major = 0;\n\t\t\tint minor = 0;\n\t\t\tint build = 0;\n\t\t\tint revision = 0;\n\t\t\tint state = 1;\n\t\t\tint number = UNDEFINED; // string may not begin with a digit\n\n\t\t\tif (info == null) {\n\t\t\t\treturn new Version(0, 0, 0, 0);\n\t\t\t}\n\t\t\tfor (int i = 0; i < info.Length; i++) {\n\t\t\t\tchar c = info[i];\n\t\t\t\tif (char.IsDigit(c)) {\n\t\t\t\t\tif (number < 0) {\n\t\t\t\t\t\tnumber = (c - '0');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnumber = (number * 10) + (c - '0');\n\t\t\t\t\t}\n\t\t\t\t} else if (number >= 0) {\n\t\t\t\t\t// assign\n\t\t\t\t\tswitch (state) {\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tmajor = number;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tminor = number;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tbuild = number;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\trevision = number;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tnumber = -1;\n\t\t\t\t\tstate++;\n\t\t\t\t}\n\t\t\t\t// ignore end of string\n\t\t\t\tif (state == 5)\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Last number\n\t\t\tif (number >= 0) {\n\t\t\t\tswitch (state) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tmajor = number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tminor = number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tbuild = number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\trevision = number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn new Version(major, minor, build, revision);\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/Void.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System {\n\tpublic struct Void {\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System/WeakReference.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nnamespace System {\n\tpublic class WeakReference {\n\n\t\t// These MUST agree with the definition in System.WeakReference.c\n#pragma warning disable 0169, 0649, 0414\n        private object target = null;\n\t\tprivate bool trackResurrection;\n\t\tprivate IntPtr nextWeakRef;\n#pragma warning restore 0169, 0649, 0414\n\n        public WeakReference(object target) : this(target, false) { }\n\n\t\tpublic WeakReference(object target, bool trackResurrection) {\n\t\t\tthis.trackResurrection = trackResurrection;\n\t\t\tthis.Target = target;\n\t\t}\n\n\t\t~WeakReference() {\n\t\t\tthis.Target = null;\n\t\t}\n\n\t\tpublic bool TrackResurrection {\n\t\t\tget {\n\t\t\t\treturn this.trackResurrection;\n\t\t\t}\n\t\t}\n\n\t\textern public object Target {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tset;\n\t\t}\n\n\t\tpublic bool IsAlive {\n\t\t\tget {\n\t\t\t\treturn (this.Target != null);\n\t\t\t}\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Collections/ArrayList.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\n\n#if LOCALTEST\nusing System.Collections;\nnamespace System_.Collections {\n#else\nnamespace System.Collections {\n#endif\n\tpublic class ArrayList : IList, ICollection, IEnumerable, ICloneable {\n\n\t\tprivate List<object> list;\n\n\t\tpublic ArrayList() {\n\t\t\tthis.list = new List<object>();\n\t\t}\n\n\t\tpublic ArrayList(ICollection c) {\n\t\t\tif (c == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tthis.list = new List<object>(c.Count);\n\t\t\tforeach (object o in c) {\n\t\t\t\tthis.list.Add(o);\n\t\t\t}\n\t\t}\n\n\t\tpublic ArrayList(int capacity) {\n\t\t\tthis.list = new List<object>(capacity);\n\t\t}\n\n\t\tpublic virtual int Add(object value) {\n\t\t\treturn this.list.Add(value);\n\t\t}\n\n\t\tpublic virtual void AddRange(ICollection c) {\n\t\t\tif (c == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tforeach (object o in c) {\n\t\t\t\tthis.list.Add(o);\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual void Clear() {\n\t\t\tthis.list.Clear();\n\t\t}\n\n\t\tpublic virtual object Clone() {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual bool Contains(object item) {\n\t\t\treturn this.list.Contains(item);\n\t\t}\n\n\t\tpublic virtual void CopyTo(Array array) {\n\t\t\tthis.list.CopyTo(array, 0);\n\t\t}\n\n\t\tpublic virtual void CopyTo(Array array, int arrayIndex) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual void CopyTo(int index, Array array, int arrayIndex, int count){\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual IEnumerator GetEnumerator() {\n\t\t\treturn this.list.GetEnumerator();\n\t\t}\n\n\t\tpublic virtual IEnumerable GetEnumerator(int index, int count) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual ArrayList GetRange(int index, int count) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual int IndexOf(object value) {\n\t\t\treturn this.list.IndexOf(value);\n\t\t}\n\n\t\tpublic virtual int IndexOf(object value, int startIndex) {\n\t\t\treturn this.list.IndexOf(value, startIndex);\n\t\t}\n\n\t\tpublic virtual int IndexOf(object value, int startIndex, int count) {\n\t\t\treturn this.list.IndexOf(value, startIndex, count);\n\t\t}\n\n\t\tpublic virtual void Insert(int index, object value) {\n\t\t\tthis.list.Insert(index, value);\n\t\t}\n\n\t\tpublic virtual void InsertRange(int index, ICollection c) {\n\t\t\tList<object> insert = new List<object>(c.Count);\n\t\t\tforeach (object o in c) {\n\t\t\t\tinsert.Add(o);\n\t\t\t}\n\t\t\tthis.list.InsertRange(index, insert);\n\t\t}\n\n\t\tpublic virtual int LastIndexOf(object value) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual int LastIndexOf(object value, int startIndex) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual int LastIndexOf(object value, int startIndex, int count) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual void Remove(object obj) {\n\t\t\tthis.list.Remove(obj);\n\t\t}\n\n\t\tpublic virtual void RemoveAt(int index) {\n\t\t\tthis.list.RemoveAt(index);\n\t\t}\n\n\t\tpublic virtual void RemoveRange(int index, int count) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual void Reverse() {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual void Reverse(int index, int count) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual void SetRange(int index, ICollection c) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual void Sort() {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual void Sort(IComparer comparer) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual void Sort(int index, int count, IComparer comparer) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual object[] ToArray() {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual Array ToArray(Type type) {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual void TromToSize() {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\tpublic virtual int Capacity {\n\t\t\tget {\n\t\t\t\treturn this.list.Capacity;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.list.Capacity = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual int Count {\n\t\t\tget {\n\t\t\t\treturn this.list.Count;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool IsFixedSize {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool IsReadOnly {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool IsSynchronized {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual object this[int index] {\n\t\t\tget {\n\t\t\t\treturn this.list[index];\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis.list[index] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual object SyncRoot {\n\t\t\tget {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "corlib/System.Collections/DictionaryEntry.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\nusing System;\n\nnamespace System.Collections {\n\tpublic struct DictionaryEntry {\n\n\t\tprivate object key;\n\t\tprivate object val;\n\n\t\tpublic DictionaryEntry(object key, object value) {\n\t\t\tif (key == null) {\n\t\t\t\tthrow new ArgumentNullException(\"key\");\n\t\t\t}\n\n\t\t\tthis.key = key;\n\t\t\tval = value;\n\t\t}\n\n\t\tpublic object Key {\n\t\t\tget {\n\t\t\t\treturn key;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value == null) {\n\t\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t\t}\n\t\t\t\tkey = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic object Value {\n\t\t\tget {\n\t\t\t\treturn val;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tval = value;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Collections/ICollection.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections {\n\tpublic interface ICollection : IEnumerable {\n\n\t\tint Count { get; }\n\n\t\tbool IsSynchronized { get; }\n\n\t\tobject SyncRoot { get; }\n\n\t\tvoid CopyTo(Array array, int index);\n\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections/IComparer.cs",
    "content": "﻿// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Collections {\n\tpublic interface IComparer {\n\n\t\tint Compare(object x, object y);\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Collections/IDictionary.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections {\n\tpublic interface IDictionary : ICollection {\n\n\t\tbool IsFixedSize { get; }\n\t\tbool IsReadOnly { get; }\n\t\tobject this[object key] { get; set; }\n\t\tICollection Keys { get; }\n\t\tICollection Values { get; }\n\t\tvoid Add(object key, object value);\n\t\tvoid Clear();\n\t\tbool Contains(object key);\n\t\tnew IDictionaryEnumerator GetEnumerator();\n\t\tvoid Remove(object key);\n\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections/IDictionaryEnumerator.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections {\n\tpublic interface IDictionaryEnumerator : IEnumerator {\n\n\t\tDictionaryEntry Entry { get; }\n\t\tobject Key { get; }\n\t\tobject Value { get; }\n\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections/IEnumerable.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\nnamespace System.Collections {\n\n\tpublic interface IEnumerable {\n\n\t\tIEnumerator GetEnumerator();\n\n\t}\n\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections/IEnumerator.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\nnamespace System.Collections {\n\n\tpublic interface IEnumerator {\n\t\tobject Current { get;}\n\t\tbool MoveNext();\n\t\tvoid Reset();\n\t}\n\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections/IEqualityComparer.cs",
    "content": "﻿// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Collections {\n\n\tpublic interface IEqualityComparer {\n\n\t\tbool Equals(object x, object y);\n\t\tint GetHashCode(object obj);\n\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Collections/IList.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections {\n\tpublic interface IList : ICollection, IEnumerable {\n\n\t\tbool IsFixedSize { get; }\n\n\t\tbool IsReadOnly { get; }\n\n\t\tobject this[int index] { get; set; }\n\n\t\tint Add(object value);\n\n\t\tvoid Clear();\n\n\t\tbool Contains(object value);\n\n\t\tint IndexOf(object value);\n\n\t\tvoid Insert(int index, object value);\n\n\t\tvoid Remove(object value);\n\n\t\tvoid RemoveAt(int index);\n\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/Comparer.cs",
    "content": "﻿// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\nusing System.Collections;\n\nnamespace System.Collections.Generic {\n\tpublic abstract class Comparer<T> : IComparer<T>,IComparer {\n\n\t\tprivate sealed class DefaultComparer : Comparer<T> {\n\n\t\t\tpublic override int Compare(T x, T y) {\n\t\t\t\tif (x == null) {\n\t\t\t\t\treturn y == null ? 0 : -1;\n\t\t\t\t}\n\t\t\t\tif (y == null) {\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t\tIComparable<T> iComp = x as IComparable<T>;\n\t\t\t\tif (iComp != null) {\n\t\t\t\t\treturn iComp.CompareTo(y);\n\t\t\t\t}\n\t\t\t\tIComparable iComp2 = x as IComparable;\n\t\t\t\tif (iComp2 != null) {\n\t\t\t\t\treturn iComp2.CompareTo(y);\n\t\t\t\t}\n\t\t\t\tthrow new ArgumentException(\"Does not implement IComparable\");\n\t\t\t}\n\n\t\t}\n\n\t\tprivate sealed class DefaultComparerValueType : Comparer<T> {\n\n\t\t\tpublic override int Compare(T x, T y) {\n\t\t\t\tIComparable<T> iComp = x as IComparable<T>;\n\t\t\t\tif (iComp != null) {\n\t\t\t\t\treturn iComp.CompareTo(y);\n\t\t\t\t}\n\t\t\t\tIComparable iComp2 = x as IComparable;\n\t\t\t\tif (iComp2 != null) {\n\t\t\t\t\treturn iComp2.CompareTo(y);\n\t\t\t\t}\n\t\t\t\tthrow new ArgumentException(\"Does not implement IComparable\");\n\t\t\t}\n\n\t\t}\n\n\t\tstatic Comparer() {\n\t\t\tif (typeof(T).IsValueType) {\n\t\t\t\tDefault = new DefaultComparerValueType();\n\t\t\t} else {\n\t\t\t\tDefault = new DefaultComparer();\n\t\t\t}\n\t\t}\n\n\t\tpublic static Comparer<T> Default { get; private set; }\n\n\t\tpublic abstract int Compare(T x, T y);\n\n\t\tpublic int Compare(object x, object y) {\n\t\t\tif (x == null) {\n\t\t\t\treturn y == null ? 0 : -1;\n\t\t\t}\n\t\t\tif (y == null) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif (x is T && y is T) {\n\t\t\t\treturn this.Compare((T)x, (T)y);\n\t\t\t}\n\t\t\tthrow new ArgumentException();\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/Dictionary.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\n#if LOCALTEST\nusing System.Collections;\nusing System.Collections.Generic;\nnamespace System_.Collections.Generic {\n#else\nnamespace System.Collections.Generic {\n#endif\n\tpublic class Dictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>,\n\t\tIEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable {\n\n\t\tpublic struct Enumerator : IEnumerator<KeyValuePair<TKey, TValue>>,\n\t\t\tIDisposable, IDictionaryEnumerator, IEnumerator {\n\n\t\t\tDictionary<TKey, TValue> dict;\n\t\t\tprivate int curSlot, curItem;\n\n\t\t\tinternal Enumerator(Dictionary<TKey, TValue> dictionary) {\n\t\t\t\tthis.dict = dictionary;\n\t\t\t\tthis.curSlot = -1;\n\t\t\t\tthis.curItem = 0;\n\t\t\t}\n\n\t\t\tpublic bool MoveNext() {\n\t\t\t\tdo {\n\t\t\t\t\tif (this.curSlot >= this.dict.capacity) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.curSlot < 0 || this.dict.keys[this.curSlot] == null ||\n\t\t\t\t\t\tthis.curItem > this.dict.keys[this.curSlot].Count) {\n\t\t\t\t\t\tthis.curSlot++;\n\t\t\t\t\t\tthis.curItem = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.curItem++;\n\t\t\t\t\t}\n\t\t\t\t\tif (this.curSlot >= this.dict.capacity) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} while (this.dict.keys[this.curSlot] == null || this.curItem >= dict.keys[this.curSlot].Count);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic KeyValuePair<TKey, TValue> Current {\n\t\t\t\tget {\n\t\t\t\t\treturn new KeyValuePair<TKey, TValue>(\n\t\t\t\t\t\tthis.dict.keys[this.curSlot][this.curItem],\n\t\t\t\t\t\tthis.dict.values[this.curSlot][this.curItem]\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tobject IEnumerator.Current {\n\t\t\t\tget { return this.Current; }\n\t\t\t}\n\n\t\t\tvoid IEnumerator.Reset() {\n\t\t\t\tthis.curSlot = -1;\n\t\t\t\tthis.curItem = 0;\n\t\t\t}\n\n\t\t\tDictionaryEntry IDictionaryEnumerator.Entry {\n\t\t\t\tget {\n\t\t\t\t\treturn new DictionaryEntry(\n\t\t\t\t\t\tthis.dict.keys[this.curSlot][this.curItem],\n\t\t\t\t\t\tthis.dict.values[this.curSlot][this.curItem]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tobject IDictionaryEnumerator.Key {\n\t\t\t\tget {\n\t\t\t\t\treturn dict.keys[this.curSlot][this.curItem];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tobject IDictionaryEnumerator.Value {\n\t\t\t\tget {\n\t\t\t\t\treturn this.dict.values[this.curSlot][this.curItem];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Dispose() {\n\t\t\t\tthis.dict = null;\n\t\t\t}\n\t\t}\n\n\t\tpublic sealed class KeyCollection : ICollection<TKey>, IEnumerable<TKey>, ICollection, IEnumerable {\n\n\t\t\tpublic struct Enumerator : IEnumerator<TKey>, IDisposable, IEnumerator {\n\n\t\t\t\tprivate Dictionary<TKey, TValue>.Enumerator hostEnumerator;\n\n\t\t\t\tinternal Enumerator(Dictionary<TKey, TValue> host) {\n\t\t\t\t\tthis.hostEnumerator = host.GetEnumerator();\n\t\t\t\t}\n\n\t\t\t\tpublic void Dispose() {\n\t\t\t\t\tthis.hostEnumerator.Dispose();\n\t\t\t\t}\n\n\t\t\t\tpublic bool MoveNext() {\n\t\t\t\t\treturn this.hostEnumerator.MoveNext();\n\t\t\t\t}\n\n\t\t\t\tpublic TKey Current {\n\t\t\t\t\tget { return this.hostEnumerator.Current.Key; }\n\t\t\t\t}\n\n\t\t\t\tobject IEnumerator.Current {\n\t\t\t\t\tget { return this.hostEnumerator.Current.Key; }\n\t\t\t\t}\n\n\t\t\t\tvoid IEnumerator.Reset() {\n\t\t\t\t\t((IEnumerator)this.hostEnumerator).Reset();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate Dictionary<TKey, TValue> dictionary;\n\n\t\t\tpublic KeyCollection(Dictionary<TKey, TValue> dictionary) {\n\t\t\t\tif (dictionary == null) {\n\t\t\t\t\tthrow new ArgumentException(\"dictionary\");\n\t\t\t\t}\n\t\t\t\tthis.dictionary = dictionary;\n\t\t\t}\n\n\t\t\tpublic void CopyTo(TKey[] array, int index) {\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\n\t\t\tpublic Enumerator GetEnumerator() {\n\t\t\t\treturn new Enumerator(this.dictionary);\n\t\t\t}\n\n\t\t\tvoid ICollection<TKey>.Add(TKey item) {\n\t\t\t\tthrow new NotSupportedException(\"this is a read-only collection\");\n\t\t\t}\n\n\t\t\tvoid ICollection<TKey>.Clear() {\n\t\t\t\tthrow new NotSupportedException(\"this is a read-only collection\");\n\t\t\t}\n\n\t\t\tbool ICollection<TKey>.Contains(TKey item) {\n\t\t\t\treturn this.dictionary.ContainsKey(item);\n\t\t\t}\n\n\t\t\tbool ICollection<TKey>.Remove(TKey item) {\n\t\t\t\tthrow new NotSupportedException(\"this is a read-only collection\");\n\t\t\t}\n\n\t\t\tIEnumerator<TKey> IEnumerable<TKey>.GetEnumerator() {\n\t\t\t\treturn this.GetEnumerator();\n\t\t\t}\n\n\t\t\tvoid ICollection.CopyTo(Array array, int index) {\n\t\t\t\tthis.CopyTo((TKey[])array, index);\n\t\t\t}\n\n\t\t\tIEnumerator IEnumerable.GetEnumerator() {\n\t\t\t\treturn this.GetEnumerator();\n\t\t\t}\n\n\t\t\tpublic int Count {\n\t\t\t\tget {\n\t\t\t\t\treturn this.dictionary.Count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool ICollection<TKey>.IsReadOnly {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool ICollection.IsSynchronized {\n\t\t\t\tget {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tobject ICollection.SyncRoot {\n\t\t\t\tget {\n\t\t\t\t\treturn ((ICollection)this.dictionary).SyncRoot;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tpublic sealed class ValueCollection : ICollection<TValue>, IEnumerable<TValue>, ICollection, IEnumerable {\n\n\t\t\tpublic struct Enumerator : IEnumerator<TValue>, IDisposable, IEnumerator {\n\n\t\t\t\tprivate Dictionary<TKey, TValue>.Enumerator hostEnumerator;\n\n\t\t\t\tinternal Enumerator(Dictionary<TKey, TValue> host) {\n\t\t\t\t\tthis.hostEnumerator = host.GetEnumerator();\n\t\t\t\t}\n\n\t\t\t\tpublic void Dispose() {\n\t\t\t\t\tthis.hostEnumerator.Dispose();\n\t\t\t\t}\n\n\t\t\t\tpublic bool MoveNext() {\n\t\t\t\t\treturn this.hostEnumerator.MoveNext();\n\t\t\t\t}\n\n\t\t\t\tpublic TValue Current {\n\t\t\t\t\tget { return this.hostEnumerator.Current.Value; }\n\t\t\t\t}\n\n\t\t\t\tobject IEnumerator.Current {\n\t\t\t\t\tget { return this.hostEnumerator.Current.Value; }\n\t\t\t\t}\n\n\t\t\t\tvoid IEnumerator.Reset() {\n\t\t\t\t\t((IEnumerator)this.hostEnumerator).Reset();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tprivate Dictionary<TKey, TValue> dictionary;\n\n\t\t\tpublic ValueCollection(Dictionary<TKey, TValue> dictionary) {\n\t\t\t\tif (dictionary == null) {\n\t\t\t\t\tthrow new ArgumentException(\"dictionary\");\n\t\t\t\t}\n\t\t\t\tthis.dictionary = dictionary;\n\t\t\t}\n\n\t\t\tpublic void CopyTo(TValue[] array, int index) {\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\n\t\t\tpublic Enumerator GetEnumerator() {\n\t\t\t\treturn new Enumerator(this.dictionary);\n\t\t\t}\n\n\t\t\tvoid ICollection<TValue>.Add(TValue item) {\n\t\t\t\tthrow new NotSupportedException(\"this is a read-only collection\");\n\t\t\t}\n\n\t\t\tvoid ICollection<TValue>.Clear() {\n\t\t\t\tthrow new NotSupportedException(\"this is a read-only collection\");\n\t\t\t}\n\n\t\t\tbool ICollection<TValue>.Contains(TValue item) {\n\t\t\t\treturn this.dictionary.ContainsValue(item);\n\t\t\t}\n\n\t\t\tbool ICollection<TValue>.Remove(TValue item) {\n\t\t\t\tthrow new NotSupportedException(\"this is a read-only collection\");\n\t\t\t}\n\n\t\t\tIEnumerator<TValue> IEnumerable<TValue>.GetEnumerator() {\n\t\t\t\treturn this.GetEnumerator();\n\t\t\t}\n\n\t\t\tvoid ICollection.CopyTo(Array array, int index) {\n\t\t\t\tthis.CopyTo((TValue[])array, index);\n\t\t\t}\n\n\t\t\tIEnumerator IEnumerable.GetEnumerator() {\n\t\t\t\treturn this.GetEnumerator();\n\t\t\t}\n\n\t\t\tpublic int Count {\n\t\t\t\tget {\n\t\t\t\t\treturn this.dictionary.Count;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool ICollection<TValue>.IsReadOnly {\n\t\t\t\tget {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tbool ICollection.IsSynchronized {\n\t\t\t\tget {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tobject ICollection.SyncRoot {\n\t\t\t\tget {\n\t\t\t\t\treturn ((ICollection)this.dictionary).SyncRoot;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\tprivate static int[] capacities = {\n\t\t\t11, 23, 47, 97, 191, 379, 757, 1511, 3023, 6047, 12097, 24179, 48353, 96731\n\t\t};\n\n\t\tprivate List<TKey>[] keys;\n\t\tprivate List<TValue>[] values;\n\t\tprivate int capacity, capacityIndex, count;\n\t\tprivate IEqualityComparer<TKey> comparer;\n\n\t\tpublic Dictionary() {\n\t\t\tthis.Init(0, null);\n\t\t}\n\n\t\tpublic Dictionary(IDictionary<TKey, TValue> dictionary) : this(dictionary, null) { }\n\n\t\tpublic Dictionary(IEqualityComparer<TKey> comparer) {\n\t\t\tthis.Init(0, comparer);\n\t\t}\n\n\t\tpublic Dictionary(int capacity) {\n\t\t\tthis.Init(capacity, null);\n\t\t}\n\n\t\tpublic Dictionary(IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer) {\n\t\t\tthis.Init(dictionary.Count, comparer);\n\t\t\tforeach (var item in dictionary) {\n\t\t\t\tthis.Add(item.Key, item.Value);\n\t\t\t}\n\t\t}\n\n\t\tpublic Dictionary(int capacity, IEqualityComparer<TKey> comparer) {\n\t\t\tthis.Init(capacity, comparer);\n\t\t}\n\n\t\tprivate void Init(int initialCapacity, IEqualityComparer<TKey> comparer) {\n\t\t\t// Initialise the comparer\n\t\t\tthis.comparer = comparer ?? EqualityComparer<TKey>.Default;\n\t\t\t// Initialise the capacity of the dictionary\n\t\t\tthis.capacityIndex = -1;\n\t\t\tfor (int i = 0; i < capacities.Length; i++) {\n\t\t\t\tif (initialCapacity <= capacities[i]) {\n\t\t\t\t\tthis.capacityIndex = i;\n\t\t\t\t\tthis.capacity = capacities[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.capacityIndex == -1){\n\t\t\t\t// If the capacity is off the end of the scale, then just use the capacity given\n\t\t\t\tthis.capacity = initialCapacity;\n\t\t\t\tthis.capacityIndex = capacities.Length;\n\t\t\t}\n\t\t\tthis.Clear();\n\t\t}\n\n\t\tprivate int GetSlot(TKey key) {\n\t\t\tuint hash = (uint)key.GetHashCode();\n\t\t\treturn (int)(hash % (uint)this.capacity);\n\t\t}\n\n\t\tpublic void Add(TKey key, TValue value) {\n\t\t\tAdd(key, value, false);\n\t\t}\n\n\t\tprivate void Add(TKey key, TValue value, bool replace) {\n\t\t\tif (key == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tint slot = this.GetSlot(key);\n\t\t\tList<TKey> keySlot = this.keys[slot];\n\t\t\tif (keySlot != null) {\n\t\t\t\t// There are element(s) at this index, so see if this key is already in this dictionary\n\t\t\t\t// Can't use keySlot.IndexOf() because it doesn't honour the comparer\n\t\t\t\tfor (int i = keySlot.Count - 1; i >= 0; i--) {\n\t\t\t\t\tif (this.comparer.Equals(keySlot[i], key)) {\n\t\t\t\t\t\t// The key is already in this dictionary\n\t\t\t\t\t\tif (replace) {\n\t\t\t\t\t\t\tthis.values[slot][i] = value;\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new ArgumentException(\"Key already exists in dictionary\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Key not already in dictionary, so carry on\n\t\t\t}\n\t\t\tthis.count++;\n\t\t\tif (this.count > this.capacity) {\n\t\t\t\t// Increase capacity\n\t\t\t\tList<TKey>[] currentKeys = this.keys;\n\t\t\t\tList<TValue>[] currentValues = this.values;\n\t\t\t\tthis.capacityIndex++;\n\t\t\t\tthis.capacity = (this.capacityIndex >= capacities.Length) ?\n\t\t\t\t\tthis.capacity * 2 + 1 : capacities[this.capacityIndex];\n\t\t\t\tthis.Clear();\n\t\t\t\t// Add all the items in this dictionary to the enlarged dictionary lists.\n\t\t\t\tfor (int slotIdx = currentKeys.Length - 1; slotIdx >= 0; slotIdx--) {\n\t\t\t\t\tList<TKey> currentKeySlot = currentKeys[slotIdx];\n\t\t\t\t\tif (currentKeySlot != null) {\n\t\t\t\t\t\tList<TValue> currentValueSlot = currentValues[slotIdx];\n\t\t\t\t\t\tfor (int listIdx = currentKeySlot.Count - 1; listIdx >= 0; listIdx--) {\n\t\t\t\t\t\t\tthis.Add(currentKeySlot[listIdx], currentValueSlot[listIdx], false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Reload these values, as they will have changed due to dictionary capacity resizing\n\t\t\t\tslot = key.GetHashCode() % this.capacity;\n\t\t\t\tkeySlot = this.keys[slot];\n\t\t\t}\n\t\t\tList<TValue> valueSlot;\n\t\t\tif (keySlot == null) {\n\t\t\t\t// There are no elements at this index, so create a new list for the element being added\n\t\t\t\tthis.keys[slot] = keySlot = new List<TKey>(1);\n\t\t\t\tthis.values[slot] = valueSlot = new List<TValue>(1);\n\t\t\t} else {\n\t\t\t\tvalueSlot = this.values[slot];\n\t\t\t}\n\t\t\tkeySlot.Add(key);\n\t\t\tvalueSlot.Add(value);\n\t\t}\n\n\t\tpublic TValue this[TKey key] {\n\t\t\tget {\n\t\t\t\tTValue value;\n\t\t\t\tif (this.TryGetValue(key, out value)) {\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t\tthrow new KeyNotFoundException(key.ToString());\n\t\t\t}\n\t\t\tset {\n\t\t\t\tAdd(key, value, true);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool TryGetValue(TKey key, out TValue value) {\n\t\t\tif (key == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tint slot = this.GetSlot(key);\n\t\t\tList<TKey> keySlot = this.keys[slot];\n\t\t\tif (keySlot != null) {\n\t\t\t\t// Can't use keySlot.IndexOf() because it doesn't honour the comparer\n\t\t\t\tfor (int i = keySlot.Count - 1; i >= 0; i--) {\n\t\t\t\t\tif (this.comparer.Equals(keySlot[i], key)) {\n\t\t\t\t\t\tvalue = this.values[slot][i];\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvalue = default(TValue);\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic bool ContainsKey(TKey key) {\n\t\t\tTValue dummy;\n\t\t\treturn (TryGetValue(key, out dummy));\n\t\t}\n\n\t\tpublic bool ContainsValue(TValue value) {\n\t\t\tEnumerator e = new Enumerator(this);\n\t\t\twhile (e.MoveNext()) {\n\t\t\t\tif (e.Current.Value.Equals(value)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic bool Remove(TKey key) {\n\t\t\tint slot = this.GetSlot(key);\n\t\t\tList<TKey> keySlot = this.keys[slot];\n\t\t\tif (keySlot != null) {\n\t\t\t\t// Can't use keySlot.IndexOf() because it doesn't honour the comparer\n\t\t\t\tfor (int i = keySlot.Count - 1; i >= 0; i--) {\n\t\t\t\t\tif (this.comparer.Equals(keySlot[i], key)) {\n\t\t\t\t\t\tkeySlot.RemoveAt(i);\n\t\t\t\t\t\tthis.values[slot].RemoveAt(i);\n\t\t\t\t\t\tthis.count--;\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tpublic IEqualityComparer<TKey> Comparer {\n\t\t\tget {\n\t\t\t\treturn this.comparer;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn this.count;\n\t\t\t}\n\t\t}\n\n\t\tpublic KeyCollection Keys {\n\t\t\tget {\n\t\t\t\treturn new KeyCollection(this);\n\t\t\t}\n\t\t}\n\n\t\tpublic ValueCollection Values {\n\t\t\tget {\n\t\t\t\treturn new ValueCollection(this);\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsReadOnly {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Clear() {\n\t\t\tthis.keys = new List<TKey>[this.capacity];\n\t\t\tthis.values = new List<TValue>[this.capacity];\n\t\t\tthis.count = 0;\n\t\t}\n\n\t\tpublic Enumerator GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tICollection<TKey> IDictionary<TKey, TValue>.Keys {\n\t\t\tget {\n\t\t\t\treturn new KeyCollection(this);\n\t\t\t}\n\t\t}\n\n\t\tICollection<TValue> IDictionary<TKey, TValue>.Values {\n\t\t\tget {\n\t\t\t\treturn new ValueCollection(this);\n\t\t\t}\n\t\t}\n\n\t\tvoid ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> item) {\n\t\t\tthis.Add(item.Key, item.Value);\n\t\t}\n\n\t\tbool ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue> item) {\n\t\t\treturn this.ContainsKey(item.Key);\n\t\t}\n\n\t\tvoid ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex) {\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\tbool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> item) {\n\t\t\treturn this.Remove(item.Key);\n\t\t}\n\n\t\tIEnumerator<KeyValuePair<TKey, TValue>> IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tpublic bool IsFixedSize {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tobject IDictionary.this[object key] {\n\t\t\tget {\n\t\t\t\treturn this[(TKey)key];\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis[(TKey)key] = (TValue)value;\n\t\t\t}\n\t\t}\n\n\t\tICollection IDictionary.Keys {\n\t\t\tget {\n\t\t\t\treturn Keys;\n\t\t\t}\n\t\t}\n\n\t\tICollection IDictionary.Values {\n\t\t\tget {\n\t\t\t\treturn Values;\n\t\t\t}\n\t\t}\n\n\t\tvoid IDictionary.Add(object key, object value) {\n\t\t\tAdd((TKey)key, (TValue)value);\n\t\t}\n\t\t\n\t\tbool IDictionary.Contains(object key) {\n\t\t\treturn ContainsKey((TKey)key);\n\t\t}\n\n\t\tIDictionaryEnumerator IDictionary.GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tvoid IDictionary.Remove(object key) {\n\t\t\tRemove((TKey)key);\n\t\t}\n\n\t\tpublic bool IsSynchronized {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic object SyncRoot {\n\t\t\tget {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tpublic void CopyTo(Array array, int index) {\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "corlib/System.Collections.Generic/EqualityComparer.cs",
    "content": "﻿// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Collections.Generic {\n\n\tpublic abstract class EqualityComparer<T> : IEqualityComparer, IEqualityComparer<T> {\n\n\t\tprivate class DefaultComparer : EqualityComparer<T> {\n\n\t\t\tpublic override bool Equals(T x, T y) {\n\t\t\t\tif (x == null) {\n\t\t\t\t\treturn y == null;\n\t\t\t\t}\n\t\t\t\treturn x.Equals(y);\n\t\t\t}\n\n\t\t\tpublic override int GetHashCode(T obj) {\n\t\t\t\tif (obj == null) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t\treturn obj.GetHashCode();\n\t\t\t}\n\n\t\t}\n\n\t\tstatic EqualityComparer() {\n\t\t\t// Need to use the GenericEqualityComparer, but can't because\n\t\t\t// cannot instantiate the type yet, because T needs to implement IEquatable<T>\n\t\t\tDefault = new DefaultComparer();\n\t\t}\n\n\t\tpublic static EqualityComparer<T> Default { get; private set; }\n\n\t\tpublic abstract bool Equals(T x, T y);\n\n\t\tpublic abstract int GetHashCode(T obj);\n\n\t\tbool IEqualityComparer.Equals(object x, object y) {\n\t\t\treturn this.Equals((T)x, (T)y);\n\t\t}\n\n\t\tint IEqualityComparer.GetHashCode(object obj) {\n\t\t\treturn this.GetHashCode((T)obj);\n\t\t}\n\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/GenericEqualityComparer.cs",
    "content": "﻿// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Collections.Generic {\n\tclass GenericEqualityComparer<T> : EqualityComparer<T> where T : IEquatable<T> {\n\n\t\tpublic override bool Equals(T x, T y) {\n\t\t\tif (x == null) {\n\t\t\t\treturn y == null;\n\t\t\t}\n\t\t\treturn x.Equals(y);\n\t\t}\n\n\t\tpublic override int GetHashCode(T obj) {\n\t\t\tif (obj == null) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t\treturn obj.GetHashCode();\n\t\t}\n\n\t}\n}\n"
  },
  {
    "path": "corlib/System.Collections.Generic/ICollection.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections.Generic {\n\n\tpublic interface ICollection<T> : IEnumerable<T> {\n\n\t\t// DO NOT change the order of these method definitions.\n\t\t// The auto-generated ICollection<T> interface on Array relies on the order.\n\n\t\tint Count {\n\t\t\tget;\n\t\t}\n\n\t\tbool IsReadOnly {\n\t\t\tget;\n\t\t}\n\n\t\tvoid Add(T item);\n\n\t\tvoid Clear();\n\n\t\tbool Contains(T item);\n\n\t\tvoid CopyTo(T[] array, int arrayIndex);\n\n\t\tbool Remove(T item);\n\n\t}\n\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/IComparer.cs",
    "content": "﻿// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Collections.Generic {\n\n\tpublic interface IComparer<T> {\n\n\t\tint Compare(T x, T y);\n\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/IDictionary.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections.Generic {\n\tpublic interface IDictionary<TKey, TValue> : ICollection<KeyValuePair<TKey, TValue>> {\n\n\t\tvoid Add(TKey key, TValue value);\n\t\tbool ContainsKey(TKey key);\n\t\tbool Remove(TKey key);\n\t\tbool TryGetValue(TKey key, out TValue value);\n\t\tTValue this[TKey key] { get; set; }\n\t\tICollection<TKey> Keys { get; }\n\t\tICollection<TValue> Values { get; }\n\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/IEnumerable.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\nusing System.Collections;\n\nnamespace System.Collections.Generic {\n\n\tpublic interface IEnumerable<T> : IEnumerable {\n\n\t\tnew IEnumerator<T> GetEnumerator();\n\n\t}\n\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/IEnumerator.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections.Generic {\n\n\tpublic interface IEnumerator<T> : IDisposable, IEnumerator {\n\n\t\tnew T Current {\n\t\t\tget;\n\t\t}\n\n\t}\n\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/IEqualityComparer.cs",
    "content": "﻿// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Collections.Generic {\n\n\tpublic interface IEqualityComparer<T> {\n\n\t\tbool Equals(T x, T y);\n\t\tint GetHashCode(T obj);\n\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/IList.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections.Generic {\n\n\tpublic interface IList<T> : ICollection<T> {\n\n\t\t// DO NOT change the order of these method definitions.\n\t\t// The auto-generated IList<T> interface on Array relies on the order.\n\n\t\tint IndexOf(T item);\n\n\t\tvoid Insert(int index, T item);\n\n\t\tvoid RemoveAt(int index);\n\n\t\tT this[int index] {\n\t\t\tget;\n\t\t\tset;\n\t\t}\n\n\t}\n\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/KeyNotFoundException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections.Generic {\n\tpublic class KeyNotFoundException : SystemException {\n\n\t\tpublic KeyNotFoundException() : base(\"The given key was not present in the dictionary.\") { }\n\n\t\tpublic KeyNotFoundException(string message) : base(message) { }\n\n\t\tpublic KeyNotFoundException(string message, Exception inner) : base(message, inner) { }\n\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/KeyValuePair.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Collections.Generic {\n\tpublic struct KeyValuePair<TKey, TValue> {\n\n\t\tprivate TKey key;\n\t\tprivate TValue value;\n\n\t\tpublic KeyValuePair(TKey Key, TValue Value) {\n\t\t\tthis.key = Key;\n\t\t\tthis.value = Value;\n\t\t}\n\n\t\tpublic TKey Key {\n\t\t\tget {\n\t\t\t\treturn key;\n\t\t\t}\n\t\t}\n\n\t\tpublic TValue Value {\n\t\t\tget {\n\t\t\t\treturn value;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn \"[\" + (Key != null ? Key.ToString() : string.Empty) +\n\t\t\t\t\", \" + (Value != null ? Value.ToString() : string.Empty) + \"]\";\n\t\t}\n\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Collections.Generic/List.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\n\n#if LOCALTEST\nusing System.Collections;\nusing System.Collections.Generic;\nnamespace System_.Collections.Generic {\n#else\nnamespace System.Collections.Generic {\n#endif\n\tpublic class List<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable {\n\n\t\tpublic struct Enumerator : IEnumerator<T>, IDisposable {\n\n\t\t\tprivate List<T> list;\n\t\t\tprivate int index;\n\n\t\t\tinternal Enumerator(List<T> list) {\n\t\t\t\tthis.list = list;\n\t\t\t\tthis.index = -1;\n\t\t\t}\n\n\t\t\tpublic T Current {\n\t\t\t\tget {\n\t\t\t\t\treturn this.list[this.index];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic void Dispose() {\n\t\t\t}\n\n\t\t\tobject IEnumerator.Current {\n\t\t\t\tget {\n\t\t\t\t\treturn this.list[this.index];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic bool MoveNext() {\n\t\t\t\tthis.index++;\n\t\t\t\treturn (this.index < this.list.Count);\n\t\t\t}\n\n\t\t\tpublic void Reset() {\n\t\t\t\tthis.index = -1;\n\t\t\t}\n\n\t\t}\n\n\t\tprivate const int defaultCapacity = 4;\n\n\t\tprivate T[] items;\n\t\tprivate int size;\n\n\t\tpublic List() : this(defaultCapacity) { }\n\n\t\tpublic List(int capacity) {\n\t\t\tif (capacity < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"capacity\");\n\t\t\t}\n\t\t\tthis.items = new T[capacity];\n\t\t\tthis.size = 0;\n\t\t}\n\n\t\tpublic List(IEnumerable<T> collection) {\n\t\t\tICollection<T> iCol = collection as ICollection<T>;\n\t\t\tif (iCol != null) {\n\t\t\t\tthis.size = iCol.Count;\n\t\t\t\tthis.items = new T[this.size];\n\t\t\t\tiCol.CopyTo(this.items, 0);\n\t\t\t} else {\n\t\t\t\tthis.items = new T[defaultCapacity];\n\t\t\t\tthis.size = 0;\n\t\t\t\tforeach (T item in collection) {\n\t\t\t\t\tthis.Add(item);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tprivate void EnsureSpace(int space) {\n\t\t\tif (this.size + space > this.items.Length) {\n\t\t\t\tArray.Resize<T>(ref this.items, Math.Max(this.items.Length << 1, 4));\n\t\t\t}\n\t\t}\n\n\t\tprivate void Shift(int index, int count) {\n\t\t\tif (count > 0) {\n\t\t\t\tthis.EnsureSpace(count);\n\t\t\t\tfor (int i = this.size - 1; i >= index; i--) {\n\t\t\t\t\tthis.items[i + count] = this.items[i];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (int i = index; i < this.size + count; i++) {\n\t\t\t\t\tthis.items[i] = this.items[i - count];\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.size += count;\n\t\t}\n\n\t\tpublic void Add(T item) {\n\t\t\tthis.EnsureSpace(1);\n\t\t\tthis.items[this.size++] = item;\n\t\t}\n\n\t\tpublic int Count {\n\t\t\tget {\n\t\t\t\treturn this.size;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Capacity {\n\t\t\tget {\n\t\t\t\treturn this.items.Length;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthrow new NotImplementedException();\n\t\t\t}\n\t\t}\n\n\t\tpublic T this[int index] {\n\t\t\tget {\n\t\t\t\tif (index >= this.size || index < 0) {\n\t\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t\t}\n\t\t\t\treturn this.items[index];\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (index >= this.size || index < 0) {\n\t\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t\t}\n\t\t\t\tthis.items[index] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic Enumerator GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tpublic int IndexOf(T item, int start, int count) {\n\t\t\treturn Array.IndexOf<T>(this.items, item, start, count);\n\t\t}\n\n\t\tpublic int IndexOf(T item, int start) {\n\t\t\treturn this.IndexOf(item, start, this.size - start);\n\t\t}\n\n\t\tpublic void InsertRange(int index, IEnumerable<T> collection) {\n\t\t\tif (collection == null) {\n\t\t\t\tthrow new ArgumentNullException(\"collection\");\n\t\t\t}\n\t\t\tif (index < 0 || index > this.size) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\tList<T> toInsert = new List<T>(collection);\n\t\t\tthis.Shift(index, toInsert.Count);\n\t\t\tfor (int i = 0; i < toInsert.Count; i++) {\n\t\t\t\tthis.items[index + i] = toInsert[i];\n\t\t\t}\n\t\t}\n\n\t\tpublic T[] ToArray() {\n\t\t\tT[] array = new T[this.size];\n\t\t\tArray.Copy(this.items, array, this.size);\n\t\t\treturn array;\n\t\t}\n\n\t\t#region Interface Members\n\n\t\tpublic int IndexOf(T item) {\n\t\t\treturn this.IndexOf(item, 0, size);\n\t\t}\n\n\t\tpublic void Insert(int index, T item) {\n\t\t\tif (index < 0 || index > this.size) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\");\n\t\t\t}\n\t\t\tthis.Shift(index, 1);\n\t\t\tthis.items[index] = item;\n\t\t}\n\n\t\tpublic void RemoveAt(int index) {\n\t\t\tthis.Shift(index, -1);\n\t\t}\n\n\t\tpublic bool IsReadOnly {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Clear() {\n\t\t\tArray.Clear(this.items, 0, this.items.Length);\n\t\t\tthis.size = 0;\n\t\t}\n\n\t\tpublic bool Contains(T item) {\n\t\t\treturn Array.IndexOf(this.items, item) >= 0;\n\t\t}\n\n\t\tpublic void CopyTo(T[] array, int arrayIndex) {\n\t\t\tArray.Copy(this.items, 0, (Array)array, arrayIndex, this.size);\n\t\t}\n\n\t\tpublic bool Remove(T item) {\n\t\t\tint idx = Array.IndexOf(this.items, item);\n\t\t\tif (idx >= 0) {\n\t\t\t\tthis.RemoveAt(idx);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tIEnumerator<T> IEnumerable<T>.GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tIEnumerator IEnumerable.GetEnumerator() {\n\t\t\treturn new Enumerator(this);\n\t\t}\n\n\t\tpublic bool IsFixedSize {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tobject IList.this[int index] {\n\t\t\tget {\n\t\t\t\treturn this[index];\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthis[index] = (T)value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Add(object value) {\n\t\t\tthis.Add((T)value);\n\t\t\treturn this.items.Length - 1;\n\t\t}\n\n\t\tpublic bool Contains(object value) {\n\t\t\treturn this.Contains((T)value);\n\t\t}\n\n\t\tpublic int IndexOf(object value) {\n\t\t\treturn this.IndexOf((T)value);\n\t\t}\n\n\t\tpublic void Insert(int index, object value) {\n\t\t\tthis.Insert(index, (T)value);\n\t\t}\n\n\t\tpublic void Remove(object value) {\n\t\t\tthis.Remove((T)value);\n\t\t}\n\n\t\tpublic bool IsSynchronized {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic object SyncRoot {\n\t\t\tget {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\tpublic void CopyTo(Array array, int index) {\n\t\t\tArray.Copy(this.items, 0, array, index, this.size);\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "corlib/System.Diagnostics/Debugger.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nnamespace System.Diagnostics {\n\tpublic sealed class Debugger {\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static void Break();\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/Calendar.cs",
    "content": "#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Globalization {\n\tpublic abstract class Calendar {\n\n\t\tinternal static Calendar CreateByName(string name) {\n\t\t\tswitch (name) {\n\t\t\tcase \"GregorianCalendar:Localized\":\n\t\t\t\treturn new GregorianCalendar();\n\t\t\tdefault:\n\t\t\t\tConsole.WriteLine(\"Calendar: {0}\", name);\n\t\t\t\treturn null;\n\t\t\t\t//throw new NotSupportedException(string.Format(\"Calendar name '{0}' not known\", name));\n\t\t\t}\n\t\t}\n\n\t\tpublic const int CurrentEra = 0;\n\n\t\tpublic abstract int[] Eras { get;}\n\t\tpublic abstract int GetEra(DateTime dt);\n\t\tpublic abstract int GetDayOfMonth(DateTime time);\n\t\tpublic abstract DayOfWeek GetDayOfWeek(DateTime time);\n\t\tpublic abstract int GetMonth(DateTime time);\n\t\tpublic abstract int GetYear(DateTime time);\n\n\t\tinternal string[] eraNames;\n\t\tinternal string[] eraAbbrNames;\n\n\t\tpublic bool IsReadOnly {\n\t\t\tget {\n\t\t\t\t// Only support read-only calendars for now.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual DateTime MaxSupportedDateTime {\n\t\t\tget {\n\t\t\t\treturn DateTime.MaxValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual DateTime MinSupportedDateTime {\n\t\t\tget {\n\t\t\t\treturn DateTime.MinValue;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual int TwoDigitYearMax {\n\t\t\tget {\n\t\t\t\treturn 2029;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/CalendarWeekRule.cs",
    "content": "#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Globalization {\n\tpublic enum CalendarWeekRule {\n\t\tFirstDay = 0,\n\t\tFirstFullWeek = 1,\n\t\tFirstFourDayWeek = 2\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/CalendricalCalculations.cs",
    "content": "// CalendricalCalculations.cs\n//\n// (C) Ulrich Kunitz 2002\n//\n\n//\n// Copyright (C) 2004 Novell, Inc (http://www.novell.com)\n//\n// Permission is hereby granted, free of charge, to any person obtaining\n// a copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to\n// permit persons to whom the Software is furnished to do so, subject to\n// the following conditions:\n// \n// The above copyright notice and this permission notice shall be\n// included in all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\n// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\n// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\n// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\nnamespace System.Globalization {\n\n//using System.Collections;\n/*\n/// <summary>A class that provides mathematical functions.</summary>\n/// <remarks>\n/// <para>\n/// We are breaking the .Net\n/// naming conventions to be compatible to the \"Calendrical Calculations\"\n/// bool. \n/// </para>\n/// </remarks>\ninternal class CCMath {\n\t/// <summary>\n\t/// A static method which rounds a double value.\n\t/// </summary>\n\t/// <param name=\"x\">The double value to round.</param>\n\t/// <returns>The rounded double.</returns>\n\tpublic static double round(double x) {\n\t\treturn System.Math.Floor(x+0.5);\n\t}\n\n\t/// <summary>\n\t/// A static method that computes the remainder of the division\n\t/// of two doubles.\n\t/// </summary>\n\t/// <param name=\"x\">The double value which is divided.</param>\n\t/// <param name=\"y\">The divisor.</param>\n\t/// <returns>The remainder as double value.</returns>\n\tpublic static double mod(double x, double y) {\n\t\treturn x - y * System.Math.Floor(x/y);\n\t}\n\n\t/// <summary>\n\t/// The static method divides two integers.\n\t/// </summary>\n\t/// <param name=\"x\">The integer x value.</param>\n\t/// <param name=\"y\">The integer y value.</param>\n\t/// <returns>The qotient of x and y defined by floor(x/y).\n\t/// </returns>\n\t/// <remarks>\n\t/// Please notify that the function is not compatible to the standard\n\t/// integer divide operation /.\n\t/// </remarks>\n\tpublic static int div(int x, int y) {\n\t\treturn (int)System.Math.Floor((double)x/(double)y);\n\t}\n\n\t/// <summary>\n\t/// The static method computes the remainder of two integers.\n\t/// </summary>\n\t/// <param name=\"x\">The integer value which will be divided.</param>\n\t/// <param name=\"y\">The divisor integer value.</param>\n\t/// <returns> The remainder as integer value.</returns>\n\t/// <remarks>\n\t/// Please notify that the method is not compatible to the C#\n\t/// remainder operation %.\n\t/// </remarks>\n\tpublic static int mod(int x, int y) {\n\t\treturn x - y * div(x, y);\n\t}\n\n\t/// <summary>\n\t/// A static method that combines integer division and remainder\n\t/// computation.\n\t/// </summary>\n\t/// <param name=\"remainder\">Remainder integer output value.\n\t/// </param>\n\t/// <param name=\"x\">Integer to be divided.</param>\n\t/// <param name=\"y\">Divisor integer value.</param>\n\t/// <returns>The quotient as integer.</returns>\n\t/// <seealso cref=\"M:div\"/>\n\t/// <seealso cref=\"M:mod\"/>\n\tpublic static int div_mod(out int remainder, int x, int y) {\n\t\tint d = div(x, y);\n\t\tremainder = x - y * d;\n\t\treturn d;\n\t}\n\n\t/// <summary>\n\t/// A static method returning the sign of the argument.\n\t/// </summary>\n\t/// <param name=\"x\">The double argument.</param>\n\t/// <returns>An integer value: -1 for a negative argument;\n\t/// 0 for a zero argument, and 1 for a positive argument.\n\t/// </returns>\n\tpublic static int signum(double x) {\n\t\tif (x < 0.0)\n\t\t\treturn -1;\n\t\tif (x == 0.0)\n\t\t\treturn 0;\n\t\treturn 1;\n\t}\n\n\t/// <summary>\n\t/// A static method returning the sign of the integer\n\t/// argument.\n\t/// </summary>\n\t/// <param name=\"x\">The integer argument.</param>\n\t/// <returns>An integer value: -1 for a negative argument;\n\t/// 0 for a zero argument, and 1 for a positive argument.\n\t/// </returns>\n\tpublic static int signum(int x) {\n\t\tif (x < 0)\n\t\t\treturn -1;\n\t\tif (x == 0)\n\t\t\treturn 0;\n\t\treturn 1;\n\t}\n\n\t/// <summary>\n\t/// An adjusted remainder function as defined in \"Calendrical\n\t/// Calculations\".\n\t/// </summary>\n\t/// <param name=\"x\">The double x argument.</param>\n\t/// <param name=\"y\">The double y argument, the divisor.</param>\n\t/// <returns>A double value representing remainder; but instead 0.0\n\t/// the divisor y is returned.\n\t/// </returns>\n\tpublic static double amod(double x, double y) {\n\t\tdouble d = mod(x, y);\n\t\treturn (d == 0.0) ? y : d;\n\t}\n\n\t/// <summary>\n\t/// The adjusted remainder functions for integers as defined in\n\t/// \"Calendrical Calculations\".\n\t/// </summary>\n\t/// <param name=\"x\">The integer argument to be divided.</param>\n\t/// <param name=\"y\">The integer divisor argument.</param>\n\t/// <returns>The remainder as an integer; however instead 0 \n\t/// is the divisor y returned.\n\t/// </returns>\n\tpublic static int amod(int x, int y) {\n\t\tint i = mod(x, y);\n\t\treturn (i == 0) ? y : i;\n\t}\n}\n*/\n\n/// <summary>The class implements methods to handle the fixed date value from\n/// the \"Calendrical Calculations\" books.\n/// </summary>\n/// <remarks>\n/// <para>\n/// For implementing the Calendar classes I used the algorithms from the\n/// book \"Calendrical Calculations\" by Nachum Dershowitz and Edward M.\n/// Rheingold, second reprint 1998. Trying to prevent the introduction of new\n/// bugs, I implemented their algorithms in the\n/// <see cref=\"N:CalendricalCalculations\"/>\n/// namespace and wrapped it in the calendar classes.\n/// </para>\n/// <para>\n/// The fixed day number is also known as R.D. - rata die.\n/// Midnight at the onset of Monday,\n/// January 1, year 1 (Gregorian) is R.D. 1.\n/// </para>\n/// <para>Here are all my references:</para>\n/// <list type=\"table\">\n/// <item><description>\n/// [1] Nachum Dershowitz and Edward M. Rheingold: \"Calendrical Calculations\";\n/// Cambridge University Press; second reprint 1998.\n/// </description></item>\n/// <item><description>\n/// [2] P. Kenneth Seidelmann (ed.): \"Explanatory Supplement to the Astronomical\n/// Almanac\"; University Science Books, Sausalito; 1992 \n/// </description></item>\n/// <item><description>\n/// [3] F. Richard Stephenson: \"Historical Eclipses and Earth Rotation\";\n/// Cambridge University Press; 1997\n/// </description></item>\n/// </list>\n/// </remarks>\ninternal class CCFixed {\n\t/// <summary>The method computes the\n\t/// <see cref=\"T:System.DateTime\"/>\n\t/// from a fixed day number.\n\t/// </summary>\n\t/// <param name=\"date\">A integer representing the fixed day number.\n\t/// </param>\n\t/// <returns>The <see cref=\"T:System.DateTime\"/> representing\n\t/// the date.\n\t/// </returns>\n\tpublic static System.DateTime ToDateTime(int date) {\n\t\tlong ticks = (date - 1) * System.TimeSpan.TicksPerDay;\n\t\treturn new System.DateTime(ticks);\n\t}\n\n\t/// <summary>The method computes the\n\t/// <see cref=\"T:System.DateTime\"/>\n\t/// from a fixed day number and time arguments.\n\t/// </summary>\n\t/// <param name=\"date\">An integer representing the fixed day number.\n\t/// </param>\n\t/// <param name=\"hour\">An integer argument specifying the hour.\n\t/// </param>\n\t/// <param name=\"minute\">An integer argument specifying the minute.\n\t/// </param>\n\t/// <param name=\"second\">An integer argument giving the second.\n\t/// </param>\n\t/// <param name=\"milliseconds\">An double argument specifying\n\t/// the milliseconds. Notice that\n\t/// <see cref=\"T:System.DateTime\"/> has 100 nanosecond resolution.\n\t/// </param>\n\t/// <returns>The <see cref=\"T:System.DateTime\"/> representing\n\t/// the date.\n\t/// </returns>\n\tpublic static System.DateTime ToDateTime(int date,\n\t\tint hour, int minute, int second, double milliseconds)\n\t{\n\t\tSystem.DateTime time = ToDateTime(date);\n\t\ttime = time.AddHours(hour);\n\t\ttime = time.AddMinutes(minute);\n\t\ttime = time.AddSeconds(second);\n\t\treturn time.AddMilliseconds(milliseconds);\n\t}\n\n\t/// <summary>\n\t/// A static method computing the fixed day number from a \n\t/// <see cref=\"T:System.DateTime\"/> value.\n\t/// </summary>\n\t/// <param name=\"time\">A\n\t/// <see cref=\"T:System.DateTime\"/> value representing the date.\n\t/// </param>\n\t/// <returns>The fixed day number as integer representing the date.\n\t/// </returns>\n\tpublic static int FromDateTime(System.DateTime time) {\n\t\treturn 1 + (int)(time.Ticks / System.TimeSpan.TicksPerDay);\n\t}\n\n\t/// <summary>\n\t/// The static method computes the <see cref=\"T:DayOfWeek\"/>.\n\t/// </summary>\n\t/// <param name=\"date\">An integer representing the fixed day number.\n\t/// </param>\n\t/// <returns>The day of week.</returns>\n\tpublic static DayOfWeek day_of_week(int date) {\n\t\treturn (DayOfWeek)(date % 7);//CCMath.mod(date, 7);\n\t}\n\n\t/// <summary>\n\t/// The static method computes the date of a day of week on or before\n\t/// a particular date.\n\t/// </summary>\n\t/// <param name=\"date\">An integer representing the date as\n\t/// fixed day number.\n\t/// </param>\n\t/// <param name=\"k\">An integer representing the day of the week,\n\t/// starting with 0 for sunday.\n\t/// </param>\n\t/// <returns>The fixed day number of the day of week specified by k\n\t/// on or before the given date.\n\t/// </returns>\n\tpublic static int kday_on_or_before(int date, int k) {\n\t\treturn date - (int)day_of_week(date-k);\n\t}\n\n\t/// <summary>\n\t/// The static method computes the date of a day of week on or after\n\t/// a particular date.\n\t/// </summary>\n\t/// <param name=\"date\">An integer representing the date as\n\t/// fixed day number.\n\t/// </param>\n\t/// <param name=\"k\">An integer representing the day of the week,\n\t/// starting with 0 for sunday.\n\t/// </param>\n\t/// <returns>The fixed day number of the day of week specified by k\n\t/// on or after the given date.\n\t/// </returns>\n\tpublic static int kday_on_or_after(int date, int k) {\n\t\treturn kday_on_or_before(date+6, k);\n\t}\n\n\t/// <summary>\n\t/// The static method computes the date of a day of week that is\n\t/// nearest to a particular date.\n\t/// </summary>\n\t/// <param name=\"date\">An integer representing the date as\n\t/// fixed day number.\n\t/// </param>\n\t/// <param name=\"k\">An integer representing the day of the week,\n\t/// starting with 0 for sunday.\n\t/// </param>\n\t/// <returns>The fixed day number of the day of week neares to the\n\t/// given date.\n\t/// </returns>\n\tpublic static int kd_nearest(int date, int k) {\n\t\treturn kday_on_or_before(date+3, k);\n\t}\n\n\t/// <summary>\n\t/// The static method computes the date of a day of week after\n\t/// a particular date.\n\t/// </summary>\n\t/// <param name=\"date\">An integer representing the date as\n\t/// fixed day number.\n\t/// </param>\n\t/// <param name=\"k\">An integer representing the day of the week,\n\t/// starting with 0 for sunday.\n\t/// </param>\n\t/// <returns>The fixed day number of the day of week specified by k\n\t/// after the given date.\n\t/// </returns>\n\tpublic static int kday_after(int date, int k) {\n\t\treturn kday_on_or_before(date+7, k);\n\t}\n\n\t/// <summary>\n\t/// The static method computes the date of a day of week before\n\t/// a particular date.\n\t/// </summary>\n\t/// <param name=\"date\">An integer representing the date as\n\t/// fixed day number.\n\t/// </param>\n\t/// <param name=\"k\">An integer representing the day of the week,\n\t/// starting with 0 for sunday.\n\t/// </param>\n\t/// <returns>The fixed day number of the day of week specified by k\n\t/// before the given date.\n\t/// </returns>\n\tpublic static int kday_before(int date, int k) {\n\t\treturn kday_on_or_before(date-1, k);\n\t}\n} // class CCFixed\n\n\n/// <summary>\n/// A class encapsulating the functions of the Gregorian calendar as static\n/// methods.\n/// </summary>\n/// <remarks>\n/// <para>\n/// This class is not compatible to\n/// <see cref=\"T:System.Globalization.GregorianCalendar\"/>.\n/// </para>\n/// <para>\n/// The fixed day number is also known as R.D. - rata die.\n/// Midnight at the onset of Monday,\n/// January 1, year 1 (Gregorian) is R.D. 1.\n/// </para>\n/// <seealso cref=\"T:CCFixed\"/>\n/// </remarks>\ninternal class CCGregorianCalendar {\n\t/// <summary>An integer defining the epoch of the Gregorian calendar\n\t/// as fixed day number.</summary>\n\t/// <remarks>The epoch is January 3, 1 C.E. (Julian).</remarks>\n\tconst int epoch = 1;\n\n\t/// <summary>The enumeration defines the months of the Gregorian\n\t/// calendar.\n\t/// </summary>\n\tpublic enum Month {\n\t\t/// <summary>\n\t\t/// January.\n\t\t/// </summary>\n\t\tjanuary = 1,\n\t\t/// <summary>\n\t\t/// February.\n\t\t/// </summary>\n\t\tfebruary,\n\t\t/// <summary>\n\t\t/// March.\n\t\t/// </summary>\n\t\tmarch,\n\t\t/// <summary>\n\t\t/// April.\n\t\t/// </summary>\n\t\tapril,\n\t\t/// <summary>\n\t\t/// May.\n\t\t/// </summary>\n\t\tmay,\n\t\t/// <summary>\n\t\t/// June.\n\t\t/// </summary>\n\t\tjune,\n\t\t/// <summary>\n\t\t/// July.\n\t\t/// </summary>\n\t\tjuly,\n\t\t/// <summary>\n\t\t/// August.\n\t\t/// </summary>\n\t\taugust,\n\t\t/// <summary>\n\t\t/// September.\n\t\t/// </summary>\n\t\tseptember,\n\t\t/// <summary>\n\t\t/// October.\n\t\t/// </summary>\n\t\toctober,\n\t\t/// <summary>\n\t\t/// November.\n\t\t/// </summary>\n\t\tnovember,\n\t\t/// <summary>\n\t\t/// December.\n\t\t/// </summary>\n\t\tdecember\n\t};\n\n\n\t/// <summary>\n\t/// The method tells whether the year is a leap year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer representing the Gregorian year.\n\t/// </param>\n\t/// <returns>A boolean which is true if <paramref name=\"year\"/> is\n\t/// a leap year.\n\t/// </returns>\n\tpublic static bool is_leap_year(int year) {\n\t\tif (year % 4 != 0)\n\t\t\treturn false;\n\t\tswitch (year % 400) {\n\t\tcase 100:\n\t\t\treturn false;\n\t\tcase 200:\n\t\t\treturn false;\n\t\tcase 300:\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t/// <summary>\n\t/// The method returns the fixed day number of the given Gregorian\n\t/// date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Gregorian year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Gregorian year.\n\t/// Non-positive values are allowed also.\n\t/// </param>\n\t/// <returns>An integer value representing the fixed day number.\n\t/// </returns>\n\tpublic static int fixed_from_dmy(int day, int month, int year) {\n\t\tint k = epoch - 1;\n\t\tk += 365 * (year-1);\n\t\t//k += CCMath.div(year-1, 4);\n\t\t//k -= CCMath.div(year-1, 100);\n\t\t//k += CCMath.div(year-1, 400);\n\t\t//k += CCMath.div(367*month-362, 12);\n\t\tk += (year - 1) / 4;\n\t\tk -= (year - 1) / 100;\n\t\tk += (year - 1) / 400;\n\t\tk += (367 * month - 362) / 12;\n\t\tif (month > 2) {\n\t\t\tk -= is_leap_year(year) ? 1 : 2;\n\t\t}\n\n\t\tk += day;\n\n\t\treturn k;\n\t}\n\n\t/// <summary>\n\t/// The method computes the Gregorian year from a fixed day number.\n\t/// </summary>\n\t/// <param name=\"date\">The fixed day number.\n\t/// </param>\n\t/// <returns>An integer value giving the Gregorian year of the date.\n\t/// </returns>\n\tpublic static int year_from_fixed(int date) {\n\t\tint d\t\t= date - epoch;\n\t\tint n_400 = d / 146097;\n\t\td %= 146097;\n\t\tint n_100 = d / 36524;\n\t\td %= 36524;\n\t\tint n_4 = d / 1461;\n\t\td %= 1461;\n\t\tint n_1 = d / 365;\n\t\t//int n_400\t= CCMath.div_mod(out d, d, 146097);\n\t\t//int n_100\t= CCMath.div_mod(out d, d, 36524);\n\t\t//int n_4\t\t= CCMath.div_mod(out d, d, 1461);\n\t\t//int n_1\t\t= CCMath.div(d, 365);\n\n\t\tint year = 400*n_400 + 100*n_100 + 4*n_4 + n_1;\n\t\treturn (n_100 == 4 || n_1 == 4) ? year : year + 1;\n\t}\n\n\t/// <summary>\n\t/// The method computes the Gregorian year and month from a fixed day\n\t/// number.\n\t/// </summary>\n\t/// <param name=\"month\">The output value giving the Gregorian month.\n\t/// </param>\n\t/// <param name=\"year\">The output value giving the Gregorian year.\n\t/// </param>\n\t/// <param name=\"date\">An integer value specifying the fixed day\n\t/// number.</param>\n\tpublic static void my_from_fixed(out int month, out int year,\n\t\tint date)\n\t{\n\t\tyear = year_from_fixed(date);\n\n\t\tint prior_days = date - fixed_from_dmy(1, (int)Month.january,\n\t\t\tyear);\n\t\t\n\t\tint correction;\n\t\tif (date < fixed_from_dmy(1, (int)Month.march, year)) {\n\t\t\tcorrection = 0;\n\t\t} else if (is_leap_year(year)) {\n\t\t\tcorrection = 1;\n\t\t} else {\n\t\t\tcorrection = 2;\n\t\t}\n\n\t\t//month = CCMath.div(12 * (prior_days + correction) + 373, 367);\n\t\tmonth = (12 * (prior_days + correction) + 373) / 367;\n\n\t}\n\n\t/// <summary>\n\t/// The method computes the Gregorian year, month, and day from a\n\t/// fixed day number.\n\t/// </summary>\n\t/// <param name=\"day\">The output value returning the day of the\n\t/// month.\n\t/// </param>\n\t/// <param name=\"month\">The output value giving the Gregorian month.\n\t/// </param>\n\t/// <param name=\"year\">The output value giving the Gregorian year.\n\t/// </param>\n\t/// <param name=\"date\">An integer value specifying the fixed day\n\t/// number.</param>\n\tpublic static void dmy_from_fixed(out int day, out int month,\n\t\tout int year,\n\t\tint date)\n\t{\n\t\tmy_from_fixed(out month, out year, date);\n\t\tday = date - fixed_from_dmy(1, month, year) + 1;\n\t}\n\n\t/// <summary>A method computing the Gregorian month from a fixed\n\t/// day number.\n\t/// </summary>\n\t/// <param name=\"date\">An integer specifying the fixed day number.\n\t/// </param>\n\t/// <returns>An integer value representing the Gregorian month.\n\t/// </returns>\n\tpublic static int month_from_fixed(int date) {\n\t\tint month, year;\n\n\t\tmy_from_fixed(out month, out year, date);\n\t\treturn month;\n\t}\n\n\t/// <summary>\n\t/// A method computing the day of the month from a fixed day number.\n\t/// </summary>\n\t/// <param name=\"date\">An integer specifying the fixed day number.\n\t/// </param>\n\t/// <returns>An integer value representing the day of the month.\n\t/// </returns>\n\tpublic static int day_from_fixed(int date) {\n\t\tint day, month, year;\n\n\t\tdmy_from_fixed(out day, out month, out year, date);\n\t\treturn day;\n\t}\n\n\t/// <summary>\n\t/// The method computes the difference between two Gregorian dates.\n\t/// </summary>\n\t/// <param name=\"dayA\">The integer parameter gives the day of month\n\t/// of the first date.\n\t/// </param>\n\t/// <param name=\"monthA\">The integer parameter gives the Gregorian\n\t/// month of the first date.\n\t/// </param>\n\t/// <param name=\"yearA\">The integer parameter gives the Gregorian\n\t/// year of the first date.\n\t/// </param>\n\t/// <param name=\"dayB\">The integer parameter gives the day of month\n\t/// of the second date.\n\t/// </param>\n\t/// <param name=\"monthB\">The integer parameter gives the Gregorian\n\t/// month of the second date.\n\t/// </param>\n\t/// <param name=\"yearB\">The integer parameter gives the Gregorian\n\t/// year of the second date.\n\t/// </param>\n\t/// <returns>An integer giving the difference of days from the first\n\t/// the second date.\n\t/// </returns>\n\tpublic static int date_difference(int dayA, int monthA, int yearA,\n\t\tint dayB, int monthB, int yearB)\n\t{\n\t\treturn\tfixed_from_dmy(dayB, monthB, yearB) -\n\t\t\tfixed_from_dmy(dayA, monthA, yearA);\n\t}\n\n\t/// <summary>\n\t/// The method computes the number of the day in the year from\n\t/// a Gregorian date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Gregorian year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Gregorian year.\n\t/// Non-positive values are allowed also.\n\t/// </param>\n\t/// <returns>An integer value giving the number of the day in the\n\t/// Gregorian year, counting from 1.\n\t/// </returns>\n\tpublic static int day_number(int day, int month, int year) {\n\t\treturn date_difference(31, (int)Month.december, year-1,\n\t\t\tday, month, year);\n\t}\n\n\t/// <summary>\n\t/// The method computes the days remaining in the given Gregorian\n\t/// year from a Gregorian date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Gregorian year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Gregorian year.\n\t/// Non-positive values are allowed also.\n\t/// </param>\n\t/// <returns>An integer value giving the number of days remaining in\n\t/// the Gregorian year.\n\t/// </returns>\n\tpublic static int days_remaining(int day, int month, int year) {\n\t\treturn date_difference(day, month, year,\n\t\t\t31, (int)Month.december, year);\n\t}\n\n\t// Helper functions for the Gregorian calendars.\n\n\t/// <summary>\n\t/// Adds months to the given date.\n\t/// </summary>\n\t/// <param name=\"time\">The\n\t/// <see cref=\"T:System.DateTime\"/> to which to add\n\t/// months.\n\t/// </param>\n\t/// <param name=\"months\">The number of months to add.</param>\n\t/// <returns>A new <see cref=\"T:System.DateTime\"/> value, that\n\t/// results from adding <paramref name=\"months\"/> to the specified\n\t/// DateTime.</returns>\n\tpublic static System.DateTime AddMonths(System.DateTime time,\n\t\tint months)\n\t{\n\t\tint rd = CCFixed.FromDateTime(time);\n\t\tint day, month, year;\n\t\tdmy_from_fixed(out day, out month, out year, rd);\n\t\tmonth += months;\n\t\tint maxday = GetDaysInMonth (year, month);\n\t\tif (day > maxday)\n\t\t\tday = maxday;\n\t\trd = fixed_from_dmy(day, month, year);\n\t\tSystem.DateTime t = CCFixed.ToDateTime(rd);\n\t\treturn t.Add(time.TimeOfDay);\n\t}\n\n\t/// <summary>\n\t/// Adds years to the given date.\n\t/// </summary>\n\t/// <param name=\"time\">The\n\t/// <see cref=\"T:System.DateTime\"/> to which to add\n\t/// months.\n\t/// </param>\n\t/// <param name=\"years\">The number of years to add.</param>\n\t/// <returns>A new <see cref=\"T:System.DateTime\"/> value, that\n\t/// results from adding <paramref name=\"years\"/> to the specified\n\t/// DateTime.</returns>\n\tpublic static System.DateTime AddYears(System.DateTime time,\n\t\tint years)\n\t{\n\t\tint rd = CCFixed.FromDateTime(time);\n\t\tint day, month, year;\n\t\tdmy_from_fixed(out day, out month, out year, rd);\n\t\tyear += years;\n\t\tint maxday = GetDaysInMonth (year, month);\n\t\tif (day > maxday)\n\t\t\tday = maxday;\n\t\trd = fixed_from_dmy(day, month, year);\n\t\tSystem.DateTime t = CCFixed.ToDateTime(rd);\n\t\treturn t.Add(time.TimeOfDay);\n\t}\n\n\t/// <summary>\n\t/// Gets the of the month from <paramref name=\"time\"/>.\n\t/// </summary>\n\t/// <param name=\"time\">The\n\t/// <see cref=\"T:System.DateTime\"/> that specifies a\n\t/// date.\n\t/// </param>\n\t/// <returns>An integer giving the day of months, starting with 1.\n\t/// </returns>\n\tpublic static int GetDayOfMonth(System.DateTime time) {\n\t\treturn day_from_fixed(CCFixed.FromDateTime(time));\n\t}\n\n\t/// <summary>\n\t/// The method gives the number of the day in the year.\n\t/// </summary>\n\t/// <param name=\"time\">The\n\t/// <see cref=\"T:System.DateTime\"/> that specifies a\n\t/// date.\n\t/// </param>\n\t/// <returns>An integer representing the day of the year,\n\t/// starting with 1.</returns>\n\tpublic static int GetDayOfYear(System.DateTime time) {\n\t\tint rd = CCFixed.FromDateTime(time);\n\t\tint year = year_from_fixed(rd);\n\t\tint rd1_1 = fixed_from_dmy(1, 1, year);\n\t\treturn rd - rd1_1 + 1;\n\t}\n\n\t/// <summary>\n\t/// A method that gives the number of days of the specified\n\t/// month of the <paramref name=\"year\"/>.\n\t/// </summary>\n\t/// <param name=\"year\">An integer that gives the year in the current\n\t/// era.</param>\n\t/// <param name=\"month\">An integer that gives the month, starting\n\t/// with 1.</param>\n\t/// <returns>An integer that gives the number of days of the\n\t/// specified month.</returns>\n\tpublic static int GetDaysInMonth(int year, int month) {\n\t\tint rd1 = fixed_from_dmy(1, month, year);\n\t\tint rd2 = fixed_from_dmy(1, month+1, year);\n\t\treturn rd2 - rd1;\n\t}\n\n\t/// <summary>\n\t/// The method gives the number of days in the specified year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer that gives the year.\n\t/// </param>\n\t/// <returns>An integer that gives the number of days of the\n\t/// specified year.</returns>\n\tpublic static int GetDaysInYear(int year) {\n\t\tint rd1 = fixed_from_dmy(1, 1, year);\n\t\tint rd2 = fixed_from_dmy(1, 1, year+1);\n\t\treturn rd2 - rd1;\n\t}\n\n\t/// <summary>\n\t/// The method gives the number of the month of the specified\n\t/// date.\n\t/// </summary>\n\t/// <param name=\"time\">The\n\t/// <see cref=\"T:System.DateTime\"/> that specifies a\n\t/// date.\n\t/// </param>\n\t/// <returns>An integer representing the month, \n\t/// starting with 1.</returns>\n\tpublic static int GetMonth(System.DateTime time) {\n\t\treturn month_from_fixed(CCFixed.FromDateTime(time));\n\t}\n\n\t/// <summary>\n\t/// The method gives the number of the year of the specified\n\t/// date.\n\t/// </summary>\n\t/// <param name=\"time\">The\n\t/// <see cref=\"T:System.DateTime\"/> that specifies a\n\t/// date.\n\t/// </param>\n\t/// <returns>An integer representing the year. \n\t/// </returns>\n\tpublic static int GetYear(System.DateTime time) {\n\t\treturn year_from_fixed(CCFixed.FromDateTime(time));\n\t}\n\n\t/// <summary>\n\t/// A virtual method that tells whether the given day\n\t/// is a leap day.\n\t/// </summary>\n\t/// <param name=\"year\">An integer that specifies the year.\n\t/// </param>\n\t/// <param name=\"month\">An integer that specifies the month.\n\t/// </param>\n\t/// <param name=\"day\">An integer that specifies the day.\n\t/// </param>\n\t/// <returns>A boolean that tells whether the given day is a leap\n\t/// day.\n\t/// </returns>\n\tpublic static bool IsLeapDay(int year, int month, int day) {\n\t\treturn is_leap_year(year) && month == 2 && day == 29;\n\t}\n\n\t/// <summary>\n\t/// A method that creates the\n\t/// <see cref=\"T:System.DateTime\"/> from the parameters.\n\t/// </summary>\n\t/// <param name=\"year\">An integer that gives the year\n\t/// </param>\n\t/// <param name=\"month\">An integer that specifies the month.\n\t/// </param>\n\t/// <param name=\"day\">An integer that specifies the day.\n\t/// </param>\n\t/// <param name=\"hour\">An integer that specifies the hour.\n\t/// </param>\n\t/// <param name=\"minute\">An integer that specifies the minute.\n\t/// </param>\n\t/// <param name=\"second\">An integer that gives the second.\n\t/// </param>\n\t/// <param name=\"milliseconds\">An integer that gives the\n\t/// milliseconds.\n\t/// </param>\n\t/// <returns>A\n\t/// <see cref=\"T:system.DateTime\"/> representig the date and time.\n\t/// </returns>\n\tpublic static System.DateTime ToDateTime(int year, int month, int day,\n\t\tint hour, int minute, int second, int milliseconds)\n\t{\n\t\treturn CCFixed.ToDateTime(fixed_from_dmy(day, month, year),\n\t\t\thour, minute, second, milliseconds);\n\t}\n} // class CCGregorianCalendar\n\n/*\n/// <summary>\n/// A class encapsulating the functions of the Julian calendar as static\n/// methods.\n/// </summary>\n/// <remarks>\n/// <para>The algorithms don't support a year 0. Years before Common Era\n/// (B.C.E. or B.C.) are negative and years of Common Era (C.E. or A.D.)\n/// are positive.\n/// </para>\n/// <para>\n/// This class is not compatible to\n/// <see cref=\"T:System.Globalization.JulianCalendar\"/>.\n/// </para>\n/// <seealso cref=\"T:CCFixed\"/>\n/// </remarks>\ninternal class CCJulianCalendar {\n\t/// <summary>An integer defining the epoch of the Julian calendar\n\t/// as fixed day number.</summary>\n\t/// <remarks>The epoch is December 30, 0 (Gregorian).</remarks>\n\tconst int epoch = -1; // 30. 12. 0 Gregorian\n\n\t/// <summary>The enumeration defines the months of the Julian\n\t/// calendar.\n\t/// </summary>\n\tpublic enum Month {\n\t\t/// <summary>\n\t\t/// January.\n\t\t/// </summary>\n\t\tjanuary = 1,\n\t\t/// <summary>\n\t\t/// February.\n\t\t/// </summary>\n\t\tfebruary,\n\t\t/// <summary>\n\t\t/// March.\n\t\t/// </summary>\n\t\tmarch,\n\t\t/// <summary>\n\t\t/// April.\n\t\t/// </summary>\n\t\tapril,\n\t\t/// <summary>\n\t\t/// May.\n\t\t/// </summary>\n\t\tmay,\n\t\t/// <summary>\n\t\t/// June.\n\t\t/// </summary>\n\t\tjune,\n\t\t/// <summary>\n\t\t/// July.\n\t\t/// </summary>\n\t\tjuly,\n\t\t/// <summary>\n\t\t/// August.\n\t\t/// </summary>\n\t\taugust,\n\t\t/// <summary>\n\t\t/// September.\n\t\t/// </summary>\n\t\tseptember,\n\t\t/// <summary>\n\t\t/// October.\n\t\t/// </summary>\n\t\toctober,\n\t\t/// <summary>\n\t\t/// November.\n\t\t/// </summary>\n\t\tnovember,\n\t\t/// <summary>\n\t\t/// December.\n\t\t/// </summary>\n\t\tdecember\n\t};\n\n\t/// <summary>\n\t/// The method tells whether the year is a leap year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer representing the Julian year.\n\t/// </param>\n\t/// <returns>A boolean which is true if <paramref name=\"year\"/> is\n\t/// a leap year.\n\t/// </returns>\n\tpublic static bool is_leap_year(int year) {\n\t\treturn CCMath.mod(year, 4) == (year > 0 ? 0 : 3);\n\t}\n\n\t/// <summary>\n\t/// The method returns the fixed day number of the given Julian\n\t/// date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Julian year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Julian year.\n\t/// Positive and Negative values are allowed.\n\t/// </param>\n\t/// <returns>An integer value representing the fixed day number.\n\t/// </returns>\n\tpublic static int fixed_from_dmy(int day, int month, int year) {\n\t\tint y = year < 0 ? year+1 : year;\n\t\tint k = epoch - 1;\n\t\tk += 365 * (y-1);\n\t\tk += CCMath.div(y-1, 4);\n\t\tk += CCMath.div(367*month-362, 12);\n\t\tif (month > 2) {\n\t\t\tk += is_leap_year(year) ? -1 : -2;\n\t\t}\n\t\tk += day;\n\n\t\treturn k;\n\t}\n\n\t/// <summary>\n\t/// The method computes the Julian year from a fixed day number.\n\t/// </summary>\n\t/// <param name=\"date\">The fixed day number.\n\t/// </param>\n\t/// <returns>An integer value giving the Julian year of the date.\n\t/// </returns>\n\tpublic static int year_from_fixed(int date) {\n\t\tint approx = CCMath.div(4*(date-epoch)+1464, 1461);\n\t\treturn approx <= 0 ? approx - 1 : approx;\n\t}\n\n\t/// <summary>\n\t/// The method computes the Julian year and month from a fixed day\n\t/// number.\n\t/// </summary>\n\t/// <param name=\"month\">The output value giving the Julian month.\n\t/// </param>\n\t/// <param name=\"year\">The output value giving the Julian year.\n\t/// </param>\n\t/// <param name=\"date\">An integer value specifying the fixed day\n\t/// number.</param>\n\tpublic static void my_from_fixed(out int month, out int year, int date)\n\t{\n\t\tyear = year_from_fixed(date);\n\n\t\tint prior_days = date - fixed_from_dmy(1, (int)Month.january,\n\t\t\tyear);\n\t\t\n\t\tint correction;\n\t\tif (date < fixed_from_dmy(1, (int)Month.march, year)) {\n\t\t\tcorrection = 0;\n\t\t} else if (is_leap_year(year)) {\n\t\t\tcorrection = 1;\n\t\t} else {\n\t\t\tcorrection = 2;\n\t\t}\n\n\t\tmonth = CCMath.div(12 * (prior_days + correction) + 373, 367);\n\t}\n\t\n\n\t/// <summary>\n\t/// The method computes the Julian year, month, and day from a\n\t/// fixed day number.\n\t/// </summary>\n\t/// <param name=\"day\">The output value returning the day of the\n\t/// month.\n\t/// </param>\n\t/// <param name=\"month\">The output value giving the Julian month.\n\t/// </param>\n\t/// <param name=\"year\">The output value giving the Julian year.\n\t/// </param>\n\t/// <param name=\"date\">An integer value specifying the fixed day\n\t/// number.</param>\n\tpublic static void dmy_from_fixed(out int day, out int month,\n\t\tout int year, int date)\n\t{\n\t\tmy_from_fixed(out month, out year, date);\n\t\tday = date - fixed_from_dmy(1, month, year) + 1;\n\t}\n\n\t/// <summary>A method computing the Julian month from a fixed\n\t/// day number.\n\t/// </summary>\n\t/// <param name=\"date\">An integer specifying the fixed day number.\n\t/// </param>\n\t/// <returns>An integer value representing the Julian month.\n\t/// </returns>\n\tpublic static int month_from_fixed(int date) {\n\t\tint month, year;\n\n\t\tmy_from_fixed(out month, out year, date);\n\t\treturn month;\n\t}\n\n\t/// <summary>\n\t/// A method computing the day of the month from a fixed day number.\n\t/// </summary>\n\t/// <param name=\"date\">An integer specifying the fixed day number.\n\t/// </param>\n\t/// <returns>An integer value representing the day of the month.\n\t/// </returns>\n\tpublic static int day_from_fixed(int date) {\n\t\tint day;\n\t\tint month;\n\t\tint year;\n\n\t\tdmy_from_fixed(out day, out month, out year, date);\n\t\treturn day;\n\t}\n\n\t/// <summary>\n\t/// The method computes the difference between two Julian dates.\n\t/// </summary>\n\t/// <param name=\"dayA\">The integer parameter gives the day of month\n\t/// of the first date.\n\t/// </param>\n\t/// <param name=\"monthA\">The integer parameter gives the Julian\n\t/// month of the first date.\n\t/// </param>\n\t/// <param name=\"yearA\">The integer parameter gives the Julian\n\t/// year of the first date.\n\t/// </param>\n\t/// <param name=\"dayB\">The integer parameter gives the day of month\n\t/// of the second date.\n\t/// </param>\n\t/// <param name=\"monthB\">The integer parameter gives the Julian\n\t/// month of the second date.\n\t/// </param>\n\t/// <param name=\"yearB\">The integer parameter gives the Julian\n\t/// year of the second date.\n\t/// </param>\n\t/// <returns>An integer giving the difference of days from the first\n\t/// the second date.\n\t/// </returns>\n\tpublic static int date_difference(int dayA, int monthA, int yearA,\n\t\tint dayB, int monthB, int yearB)\n\t{\n\t\treturn\tfixed_from_dmy(dayB, monthB, yearB) -\n\t\t\tfixed_from_dmy(dayA, monthA, yearA);\n\t}\n\n\t/// <summary>\n\t/// The method computes the number of the day in the year from\n\t/// a Julian date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Julian year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Julian year.\n\t/// Negative values are allowed also.\n\t/// </param>\n\t/// <returns>An integer value giving the number of the day in the\n\t/// Julian year, counting from 1.\n\t/// </returns>\n\tpublic static int day_number(int day, int month, int year) {\n\t\treturn date_difference(31, (int)Month.december, year-1,\n\t\t\tday, month, year);\n\t}\n\n\t/// <summary>\n\t/// The method computes the days remaining in the given Julian\n\t/// year from a Julian date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Julian year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Julian year.\n\t/// Negative values are allowed also.\n\t/// </param>\n\t/// <returns>An integer value giving the number of days remaining in\n\t/// the Julian year.\n\t/// </returns>\n\tpublic static int days_remaining(int day, int month, int year) {\n\t\treturn date_difference(day, month, year,\n\t\t\t31, (int)Month.december, year);\n\t}\n} // class CCJulianCalendar\n\n/// <summary>\n/// A class encapsulating the functions of the Hebrew calendar as static\n/// methods.\n/// </summary>\n/// <remarks>\n/// <para>\n/// This class is not compatible to\n/// <see cref=\"T:System.Globalization.HebrewCalendar\"/>.\n/// </para>\n/// <seealso cref=\"T:CCFixed\"/>\n/// </remarks>\ninternal class CCHebrewCalendar {\n\t/// <summary>An integer defining the epoch of the Hebrew calendar\n\t/// as fixed day number.</summary>\n\t/// <remarks>The epoch is October 10, 3761 B.C.E. (Julian).</remarks>\n\tconst int epoch = -1373427;\n\n\t/// <summary>The enumeration defines the months of the Gregorian\n\t/// calendar.\n\t/// </summary>\n\t/// <remarks>\n\t/// The enumaration differs from .NET which defines Tishri as month 1.\n\t/// </remarks>\n\tpublic enum Month {\n\t\t/// <summary>\n\t\t/// Nisan.\n\t\t/// </summary>\n\t\tnisan\t = 1,\n\t\t/// <summary>\n\t\t/// Iyyar.\n\t\t/// </summary>\n\t\tiyyar,\n\t\t/// <summary>\n\t\t/// Sivan.\n\t\t/// </summary>\n\t\tsivan,\n\t\t/// <summary>\n\t\t/// Tammuz.\n\t\t/// </summary>\n\t\ttammuz,\n\t\t/// <summary>\n\t\t/// Av.\n\t\t/// </summary>\n\t\tav,\n\t\t/// <summary>\n\t\t/// Elul.\n\t\t/// </summary>\n\t\telul,\n\t\t/// <summary>\n\t\t/// Tishri.\n\t\t/// </summary>\n\t\ttishri,\n\t\t/// <summary>\n\t\t/// Heshvan.\n\t\t/// </summary>\n\t\theshvan,\n\t\t/// <summary>\n\t\t/// Kislev.\n\t\t/// </summary>\n\t\tkislev,\n\t\t/// <summary>\n\t\t/// Teveth.\n\t\t/// </summary>\n\t\tteveth,\n\t\t/// <summary>\n\t\t/// Shevat.\n\t\t/// </summary>\n\t\tshevat,\n\t\t/// <summary>\n\t\t/// Adar.\n\t\t/// </summary>\n\t\tadar,\n\t\t/// <summary>\n\t\t/// Adar I. Only in years with Adar II.\n\t\t/// </summary>\n\t\tadar_I = 12,\n\t\t/// <summary>\n\t\t/// Adar II. Only in years wirh Adar I.\n\t\t/// </summary>\n\t\tadar_II = 13,\n\t};\n\n\t/// <summary>\n\t/// The method tells whether the year is a leap year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer representing the Hebrew year.\n\t/// </param>\n\t/// <returns>A boolean which is true if <paramref name=\"year\"/> is\n\t/// a leap year.\n\t/// </returns>\n\tpublic static bool is_leap_year(int year) {\n\t\treturn CCMath.mod(7*year+1, 19) < 7; \n\t}\n\n\t/// <summary>\n\t/// The Method gives the number of the last month in a year, which\n\t/// is equal with the number of month in a Hebrew year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer representing the Hebrew year.\n\t/// </param>\n\t/// <returns>An integer giving the number of the last month of the \n\t/// Hebrew year, which is the same as the numbers of month in the\n\t/// year.\n\t/// </returns>\n\tpublic static int last_month_of_year(int year) {\n\t\treturn is_leap_year(year) ? 13 : 12;\n\t}\n\n\t\n\t/// <summary>The method is a helper function.</summary>\n\t/// <param name=\"year\">An integer specifying the Hebrew year.\n\t/// </param>\n\t/// <returns>An integer representing the number of elapsed days\n\t/// until the Hebrew year.</returns>\n\tpublic static int elapsed_days(int year) {\n\t\tint months_elapsed = CCMath.div(235*year-234, 19);\n\t\tint r;\n\t\tint d = CCMath.div_mod(out r, months_elapsed, 1080);\n\t\tint parts_elapsed = 204 + 793 * r;\n\t\tint hours_elapsed = 11 + 12 * months_elapsed +\n\t\t\t\t    793 * d + CCMath.div(parts_elapsed, 1080);\n\n\t\tint day = 29*months_elapsed + CCMath.div(hours_elapsed, 24);\n\n\t\tif (CCMath.mod(3*(day+1), 7) < 3) {\n\t\t\tday += 1;\n\t\t}\n\n\t\treturn day;\n\t}\n\n\t/// <summary>A method computing the delay of new year for the given\n\t/// Hebrew year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer that gives the Hebrew year.\n\t/// </param>\n\t/// <returns>The new year delay in days of the given Hebrew year.\n\t/// </returns>\n\tpublic static int new_year_delay(int year) {\n\t\tint ny1 = elapsed_days(year);\n\t\tint ny2 = elapsed_days(year+1);\n\n\t\tif (ny2 - ny1 == 356) {\n\t\t\treturn 2;\n\t\t}\n\t\tint ny0 = elapsed_days(year-1);\n\t\tif (ny1 - ny0 == 382) {\n\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n\n\t/// <summary>\n\t/// The method computes the last day of month (nummer of days in a\n\t/// month) of the given Hebrew year.\n\t/// </summary>\n\t/// <param name=\"month\">The Hebrew month, allowed value between\n\t/// One and Thirteen.\n\t/// </param>\n\t/// <param name=\"year\">An integer that gives the Hebrew year.\n\t/// </param>\n\t/// <returns>The number of the last day of the month of the given\n\t/// Hebrew year, which gives automatically the number of days in the\n\t/// month.\n\t/// </returns>\n\t/// <exception cref=\"T:System.ArgumentOutOfRange.Exception\">\n\t/// The exception is thrown if month not between One and Thirteen.\n\t/// </exception>\n\tpublic static int last_day_of_month(int month, int year) {\n\t\tif (month < 1 || month > 13)\n\t\t\tthrow new System.ArgumentOutOfRangeException(\"month\",\n\t\t\t\t\"Month should be between One and Thirteen.\");\n\t\tswitch (month) {\n\t\t\tcase 2: return 29;\n\t\t\tcase 4: return 29;\n\t\t\tcase 6: return 29;\n\t\t\tcase 8:\n\t\t\t\tif (!long_heshvan(year))\n\t\t\t\t\treturn 29;\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tif (short_kislev(year))\n\t\t\t\t\treturn 29;\n\t\t\t\tbreak;\n\t\t\tcase 10: return 29;\n\t\t\tcase 12:\n\t\t\t\tif (!is_leap_year(year))\n\t\t\t\t\treturn 29;\n\t\t\t\tbreak;\n\t\t\tcase 13: return 29;\n\t\t}\n\t\treturn 30;\n\t}\n\t\n\t/// <summary>\n\t/// The functions checks whether the month Heshvan is a long one\n\t/// in the given Hebrew year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer that gives the Hebrew year.\n\t/// </param>\n\t/// <returns>A boolean value: true if there is a long Heshvan\n\t/// in the given Hebrew year; false otherwise.\n\t/// </returns>\n\tpublic static bool long_heshvan(int year) {\n\t\treturn CCMath.mod(days_in_year(year), 10) == 5;\n\t}\n\n\t/// <summary>\n\t/// The functions checks whether the month Kislev is a short one\n\t/// in the given Hebrew year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer that gives the Hebrew year.\n\t/// </param>\n\t/// <returns>A boolean value: true if there is a short Kislev\n\t/// in the given Hebrew year; false otherwise.\n\t/// </returns>\n\tpublic static bool short_kislev(int year) {\n\t\treturn CCMath.mod(days_in_year(year), 10) == 3;\n\t}\n\n\t/// <summary>\n\t/// The functions gives the number of days in the specified Hebrew\n\t/// year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer that gives the Hebrew year.\n\t/// </param>\n\t/// <returns>The days of the Hebrew year as integer.\n\t/// </returns>\n\tpublic static int days_in_year(int year) {\n\t\treturn\tfixed_from_dmy(1, 7, year+1) -\n\t\t\tfixed_from_dmy(1, 7, year);\n\t}\n\n\t/// <summary>\n\t/// The method returns the fixed day number of the given Hebrew\n\t/// date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Hebrew year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Hebrew year.\n\t/// Non-positive values are allowed also.\n\t/// </param>\n\t/// <returns>An integer value representing the fixed day number.\n\t/// </returns>\n\tpublic static int fixed_from_dmy(int day, int month, int year) {\n\t\tint m;\n\t\tint k = epoch-1;\n\t\tk += elapsed_days(year);\n\t\tk += new_year_delay(year);\n\n\t\tif (month < 7) {\n\t\t\tint l = last_month_of_year(year);\n\t\t\tfor (m = 7; m <= l; m++) {\n\t\t\t\tk += last_day_of_month(m, year);\n\t\t\t}\n\t\t\tfor (m = 1; m < month; m++) {\n\t\t\t\tk += last_day_of_month(m, year);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tfor (m = 7; m < month; m++) {\n\t\t\t\tk += last_day_of_month(m, year);\n\t\t\t}\n\t\t}\n\t\t\n\t\tk += day;\n\n\t\treturn k;\n\t}\n\n\t/// <summary>\n\t/// The method computes the Hebrew year from a fixed day number.\n\t/// </summary>\n\t/// <param name=\"date\">The fixed day number.\n\t/// </param>\n\t/// <returns>An integer value giving the Hebrew year of the date.\n\t/// </returns>\n\tpublic static int year_from_fixed(int date) {\n\t\tint approx = (int)System.Math.Floor(\n\t\t\t((double)(date - epoch))/(35975351.0/98496.0));\n\t\tint y;\n\t\tfor (y = approx; date >= fixed_from_dmy(1, 7, y); y++) {} \n\t\treturn y-1;\n\t}\n\n\t/// <summary>\n\t/// The method computes the Hebrew year and month from a fixed day\n\t/// number.\n\t/// </summary>\n\t/// <param name=\"month\">The output value giving the Hebrew month.\n\t/// </param>\n\t/// <param name=\"year\">The output value giving the Hebrew year.\n\t/// </param>\n\t/// <param name=\"date\">An integer value specifying the fixed day\n\t/// number.</param>\n\tpublic static void my_from_fixed(out int month, out int year,\n\t\tint date)\n\t{\n\t\tyear = year_from_fixed(date);\n\n\t\tint start = date < fixed_from_dmy(1, 1, year) ? 7 : 1;\n\n\t\tfor (month = start;\n\t\t     date > fixed_from_dmy(last_day_of_month(month, year),\n\t\t     \t\t\t\tmonth, year);\n\t\t     month++)\n\t\t{}\n\t}\n\n\t/// <summary>\n\t/// The method computes the Hebrew year, month, and day from a\n\t/// fixed day number.\n\t/// </summary>\n\t/// <param name=\"day\">The output value returning the day of the\n\t/// month.\n\t/// </param>\n\t/// <param name=\"month\">The output value giving the Hebrew month.\n\t/// </param>\n\t/// <param name=\"year\">The output value giving the Hebrew year.\n\t/// </param>\n\t/// <param name=\"date\">An integer value specifying the fixed day\n\t/// number.</param>\n\tpublic static void dmy_from_fixed(out int day, out int month,\n\t\tout int year, int date)\n\t{\n\t\tmy_from_fixed(out month, out year, date);\n\t\tday = date - fixed_from_dmy(1, month, year) + 1;\n\t}\n\n\t/// <summary>A method computing the Hebrew month from a fixed\n\t/// day number.\n\t/// </summary>\n\t/// <param name=\"date\">An integer specifying the fixed day number.\n\t/// </param>\n\t/// <returns>An integer value representing the Hebrew month.\n\t/// </returns>\n\tpublic static int month_from_fixed(int date) {\n\t\tint month, year;\n\n\t\tmy_from_fixed(out month, out year, date);\n\t\treturn month;\n\t}\n\n\t/// <summary>\n\t/// A method computing the day of the month from a fixed day number.\n\t/// </summary>\n\t/// <param name=\"date\">An integer specifying the fixed day number.\n\t/// </param>\n\t/// <returns>An integer value representing the day of the month.\n\t/// </returns>\n\tpublic static int day_from_fixed(int date) {\n\t\tint day, month, year;\n\t\t\n\t\tdmy_from_fixed(out day, out month, out year, date);\n\t\treturn day;\n\t}\n\n\t/// <summary>\n\t/// The method computes the difference between two Hebrew dates.\n\t/// </summary>\n\t/// <param name=\"dayA\">The integer parameter gives the day of month\n\t/// of the first date.\n\t/// </param>\n\t/// <param name=\"monthA\">The integer parameter gives the Hebrew\n\t/// month of the first date.\n\t/// </param>\n\t/// <param name=\"yearA\">The integer parameter gives the Hebrew\n\t/// year of the first date.\n\t/// </param>\n\t/// <param name=\"dayB\">The integer parameter gives the day of month\n\t/// of the second date.\n\t/// </param>\n\t/// <param name=\"monthB\">The integer parameter gives the Hebrew\n\t/// month of the second date.\n\t/// </param>\n\t/// <param name=\"yearB\">The integer parameter gives the Hebrew\n\t/// year of the second date.\n\t/// </param>\n\t/// <returns>An integer giving the difference of days from the first\n\t/// the second date.\n\t/// </returns>\n\tpublic static int date_difference(int dayA, int monthA, int yearA,\n\t\tint dayB, int monthB, int yearB)\n\t{\n\t\treturn\tfixed_from_dmy(dayB, monthB, yearB) -\n\t\t\tfixed_from_dmy(dayA, monthA, yearA);\n\t}\n\n\t/// <summary>\n\t/// The method computes the number of the day in the year from\n\t/// a Hebrew date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Hebrew year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Hebrew year.\n\t/// </param>\n\t/// <returns>An integer value giving the number of the day in the\n\t/// Hebrew year, counting from 1.\n\t/// </returns>\n\tpublic static int day_number(int day, int month, int year) {\n\t\treturn date_difference(1, 7, year,\n\t\t\tday, month, year) + 1;\n\t}\n\n\t/// <summary>\n\t/// The method computes the days remaining in the given Hebrew\n\t/// year from a Hebrew date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Hebrew year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Hebrew year.\n\t/// </param>\n\t/// <returns>An integer value giving the number of days remaining in\n\t/// the Hebrew year.\n\t/// </returns>\n\tpublic static int days_remaining(int day, int month, int year) {\n\t\treturn date_difference(day, month, year,\n\t\t\t1, 7, year+1)-1;\n\t}\n} // class HebrewCalendar\n\n\n/// <summary>\n/// A class encapsulating the functions of the Islamic calendar as static\n/// methods.\n/// </summary>\n/// <remarks>\n/// <para>There is no difference here in using Hijri or Islamic calendar.\n/// </para>\n/// <para>The epoch of the Islamic calendar isn't fixed, because we cannot\n/// surely say today, when the crescent of the new moon has been observed \n/// around the July 16, 622 C.E. Julian. Even today the start and end of \n/// the month Ramadan is defined by religous authorities. So the calendar\n/// can be offset by two days.\n/// </para> \n/// <para>\n/// We don't support the offset here, however we changed the epoch from\n/// \"Calendrical Calculations\" to value, that .Net seems to be using.\n/// </para>\n/// <para>\n/// This class is not compatible to\n/// <see cref=\"T:System.Globalization.HijriCalendar\"/>.\n/// </para>\n/// <seealso cref=\"T:CCFixed\"/>\n/// </remarks>\ninternal class CCHijriCalendar {\n\t/// <summary>An integer defining the epoch of the Gregorian calendar\n\t/// as fixed day number.</summary>\n\t/// <remarks>\n\t/// <para>\n\t/// The epoch is given as 16 July 622 C.E. Julian (R.D. 227015)\n\t/// in Calendrical Calculations, the approximate date of\n\t/// the emigration of\n\t/// Muhammed to Medina. However there is no way to determine today\n\t/// the observation of the crescent of the new moon in July 622 C.E.\n\t/// (Julian). So there is some variability in the epoch.\n\t/// Religous authorities determine the epoch by observing the\n\t/// crescent of the new moon for the month Ramadan, so there might\n\t/// be an offsets by two days of the epoch.\n\t/// </para>\n\t/// <para>Windows\n\t/// supports an AddHijriDate parameter in the registry to adapt\n\t/// for it. It seems that the .NET implementation of\n\t/// HijriCalendar uses an epoch of 227014, so we use it here. The\n\t/// ArgumentOutOfRangeException gives July, 18 622 as epoch,\n\t/// which is 227014 supporting our theory.\n\t/// </para>\n\t/// </remarks>\n\tconst int epoch = 227014;\n\n\t/// <summary>The enumeration defines the months of the Islamic\n\t/// calendar.\n\t/// </summary>\n\tpublic enum Month {\n\t\t/// <summary>\n\t\t/// Muharram.\n\t\t/// </summary>\n\t\tmuharram = 1,\n\t\t/// <summary>\n\t\t/// Safar.\n\t\t/// </summary>\n\t\tsafar,\n\t\t/// <summary>\n\t\t/// Rabi I.\n\t\t/// </summary>\n\t\trabi_I,\n\t\t/// <summary>\n\t\t/// Rabi II.\n\t\t/// </summary>\n\t\trabi_II,\n\t\t/// <summary>\n\t\t/// Jumada I.\n\t\t/// </summary>\n\t\tjumada_I,\n\t\t/// <summary>\n\t\t/// Jumada II.\n\t\t/// </summary>\n\t\tjumada_II,\n\t\t/// <summary>\n\t\t/// Rajab.\n\t\t/// </summary>\n\t\trajab,\n\t\t/// <summary>\n\t\t/// Shaban.\n\t\t/// </summary>\n\t\tshaban,\n\t\t/// <summary>\n\t\t/// Ramadan.\n\t\t/// </summary>\n\t\tramadan,\n\t\t/// <summary>\n\t\t/// Shawwal.\n\t\t/// </summary>\n\t\tshawwal,\n\t\t/// <summary>\n\t\t/// Dhu Al-Quada.\n\t\t/// </summary>\n\t\tdhu_al_quada,\n\t\t/// <summary>\n\t\t/// Dhu Al-Hijja.\n\t\t/// </summary>\n\t\tdhu_al_hijja,\n\t};\n\n\t/// <summary>\n\t/// The method tells whether the year is a leap year.\n\t/// </summary>\n\t/// <param name=\"year\">An integer representing the Islamic year.\n\t/// </param>\n\t/// <returns>A boolean which is true if <paramref name=\"year\"/> is\n\t/// a leap year.\n\t/// </returns>\n\tpublic static bool is_leap_year(int year) {\n\t\treturn CCMath.mod(14+11*year, 30) < 11;\n\t}\n\n\t/// <summary>\n\t/// The method returns the fixed day number of the given Islamic\n\t/// date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Islamic year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Islamic year.\n\t/// Non-positive values are allowed also.\n\t/// </param>\n\t/// <returns>An integer value representing the fixed day number.\n\t/// </returns>\n\tpublic static int fixed_from_dmy(int day, int month, int year) {\n\t\tint k = epoch - 1;\n\t\tk += 354 * (year-1);\n\t\tk += CCMath.div(3+11*year, 30);\n\t\tk += (int)System.Math.Ceiling(29.5 * (double)(month-1));\n\t\tk += day;\n\n\t\treturn k;\n\t}\n\n\t/// <summary>\n\t/// The method computes the Islamic year from a fixed day number.\n\t/// </summary>\n\t/// <param name=\"date\">The fixed day number.\n\t/// </param>\n\t/// <returns>An integer value giving the Islamic year of the date.\n\t/// </returns>\n\tpublic static int year_from_fixed(int date) {\n\t\treturn CCMath.div(30*(date-epoch)+10646, 10631);\n\t}\n\n\t/// <summary>\n\t/// The method computes the Islamic year and month from a fixed day\n\t/// number.\n\t/// </summary>\n\t/// <param name=\"month\">The output value giving the Islamic month.\n\t/// </param>\n\t/// <param name=\"year\">The output value giving the Islamic year.\n\t/// </param>\n\t/// <param name=\"date\">An integer value specifying the fixed day\n\t/// number.</param>\n\tpublic static void my_from_fixed(out int month, out int year, int date)\n\t{\n\t\tyear = year_from_fixed(date);\n\n\t\tint m = 1+(int)System.Math.Ceiling(\n\t\t\t((double)(date-29-fixed_from_dmy(1,1,year)))/29.5);\n\n\t\tmonth = m < 12 ? m : 12;\n\t}\n\t\n\t/// <summary>\n\t/// The method computes the Islamic year, month, and day from a\n\t/// fixed day number.\n\t/// </summary>\n\t/// <param name=\"day\">The output value returning the day of the\n\t/// month.\n\t/// </param>\n\t/// <param name=\"month\">The output value giving the Islamic month.\n\t/// </param>\n\t/// <param name=\"year\">The output value giving the Islamic year.\n\t/// </param>\n\t/// <param name=\"date\">An integer value specifying the fixed day\n\t/// number.</param>\n\tpublic static void dmy_from_fixed(out int day, out int month,\n\t\tout int year, int date)\n\t{\n\t\tmy_from_fixed(out month, out year, date);\n\t\tday = date - fixed_from_dmy(1, month, year) + 1;\n\t}\n\n\t/// <summary>A method computing the Islamic month from a fixed\n\t/// day number.\n\t/// </summary>\n\t/// <param name=\"date\">An integer specifying the fixed day number.\n\t/// </param>\n\t/// <returns>An integer value representing the Islamic month.\n\t/// </returns>\n\tpublic static int month_from_fixed(int date) {\n\t\tint month, year;\n\n\t\tmy_from_fixed(out month, out year, date);\n\t\treturn month;\n\t}\n\n\t/// <summary>\n\t/// A method computing the day of the month from a fixed day number.\n\t/// </summary>\n\t/// <param name=\"date\">An integer specifying the fixed day number.\n\t/// </param>\n\t/// <returns>An integer value representing the day of the month.\n\t/// </returns>\n\tpublic static int day_from_fixed(int date) {\n\t\tint day;\n\t\tint month;\n\t\tint year;\n\n\t\tdmy_from_fixed(out day, out month, out year, date);\n\t\treturn day;\n\t}\n\n\t/// <summary>\n\t/// The method computes the difference between two Islamic dates.\n\t/// </summary>\n\t/// <param name=\"dayA\">The integer parameter gives the day of month\n\t/// of the first date.\n\t/// </param>\n\t/// <param name=\"monthA\">The integer parameter gives the Islamic\n\t/// month of the first date.\n\t/// </param>\n\t/// <param name=\"yearA\">The integer parameter gives the Islamic\n\t/// year of the first date.\n\t/// </param>\n\t/// <param name=\"dayB\">The integer parameter gives the day of month\n\t/// of the second date.\n\t/// </param>\n\t/// <param name=\"monthB\">The integer parameter gives the Islamic\n\t/// month of the second date.\n\t/// </param>\n\t/// <param name=\"yearB\">The integer parameter gives the Islamic\n\t/// year of the second date.\n\t/// </param>\n\t/// <returns>An integer giving the difference of days from the first\n\t/// the second date.\n\t/// </returns>\n\tpublic static int date_difference(int dayA, int monthA, int yearA,\n\t\tint dayB, int monthB, int yearB)\n\t{\n\t\treturn\tfixed_from_dmy(dayB, monthB, yearB) -\n\t\t\tfixed_from_dmy(dayA, monthA, yearA);\n\t}\n\n\t/// <summary>\n\t/// The method computes the number of the day in the year from\n\t/// a Islamic date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Islamic year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Islamic year.\n\t/// </param>\n\t/// <returns>An integer value giving the number of the day in the\n\t/// Islamic year, counting from 1.\n\t/// </returns>\n\tpublic static int day_number(int day, int month, int year) {\n\t\treturn date_difference(31, 12, year-1, day, month, year);\n\t}\n\n\t/// <summary>\n\t/// The method computes the days remaining in the given Islamic\n\t/// year from a Islamic date.\n\t/// </summary>\n\t/// <param name=\"day\">An integer representing the day of the month,\n\t/// counting from 1.\n\t/// </param>\n\t/// <param name=\"month\">An integer representing the month in the\n\t/// Islamic year.\n\t/// </param>\n\t/// <param name=\"year\">An integer representing the Islamic year.\n\t/// Non-positive values are allowed also.\n\t/// </param>\n\t/// <returns>An integer value giving the number of days remaining in\n\t/// the Islamic year.\n\t/// </returns>\n\tpublic static int days_remaining(int day, int month, int year) {\n\t\treturn date_difference(day, month, year,31, 12, year);\n\t}\n} // class CCHijriCalendar\n\ninternal class CCEastAsianLunisolarCalendar\n{\n\tconst int initial_epact = 29; // at 1900\n\n\tpublic static int fixed_from_dmy (int day, int month, int year)\n\t{\n\t\tthrow new Exception (\"fixed_from_dmy\");\n\t}\n\n\tpublic static int year_from_fixed (int date)\n\t{\n\t\tthrow new Exception (\"year_from_fixed\");\n\t}\n\n\tpublic static void my_from_fixed(out int month, out int year, int date)\n\t{\n\t\tthrow new Exception (\"my_from_fixed\");\n\t}\n\n\tpublic static void dmy_from_fixed(out int day, out int month,\n\t\tout int year, int date)\n\t{\n\t\tthrow new Exception (\"dmy_from_fixed\");\n\t}\n\n\tpublic static DateTime AddMonths (DateTime date, int months)\n\t{\n\t\t\n\t\tthrow new Exception (\"AddMonths\");\n\t}\n\n\tpublic static DateTime AddYears (DateTime date, int years)\n\t{\n\t\tthrow new Exception (\"AddYears\");\n\t}\n\n\tpublic static int GetDayOfMonth (DateTime date)\n\t{\n\t\tthrow new Exception (\"GetDayOfMonth\");\n\t}\n\n\tpublic static int GetDayOfYear (DateTime date)\n\t{\n\t\tthrow new Exception (\"GetDayOfYear\");\n\t}\n\n\tpublic static int GetDaysInMonth (int gyear, int month)\n\t{\n\t\tthrow new Exception (\"GetDaysInMonth\");\n\t}\n\n\tpublic static int GetDaysInYear (int year)\n\t{\n\t\tthrow new Exception (\"GetDaysInYear\");\n\t}\n\n\tpublic static int GetMonth (DateTime date)\n\t{\n\t\tthrow new Exception (\"GetMonth\");\n\t}\n\n\tstatic readonly int [] leap_month_calc = new int [] {\n\t\t0, 2, 0, 2, 2, 4, 5, 6, 7, 8, 9, 10};\n\n\tpublic static bool IsLeapMonth (int gyear, int month)\n\t{\n\t\tint goldenNumber = gyear % 19;\n\n\t\tbool chu = false;\n\t\tbool leap = false;\n\t\tdouble s = 0;\n\t\tfor (int y = 0; y < goldenNumber; y++) {\n\t\t\tfor (int l = 0, m = 1; m <= month; m++) {\n\t\t\t\tif (leap) {\n\t\t\t\t\tl += 30;\n\t\t\t\t\tleap = false;\n\t\t\t\t\tif (y == goldenNumber && m == month)\n\t\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tl += chu ? 30 : 29;\n\t\t\t\t\tchu = !chu;\n\t\t\t\t\ts += 30.44;\n\t\t\t\t\tif (s - l > 29)\n\t\t\t\t\t\tleap = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\n\t\tthrow new Exception (\"IsLeapMonth\");\n\t}\n\n\tpublic static bool IsLeapYear (int gyear)\n\t{\n\n\t\t// FIXME: it is still wrong.\n\t\tint d = gyear % 19;\n\t\tswitch (d) {\n\t\tcase 0: case 3: case 6: case 9: case 11: case 14: case 17:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tpublic static DateTime ToDateTime (int year, int month, int day, int hour, int minute, int second, int millisecond)\n\t{\n\t\tthrow new Exception (\"ToDateTime\");\n\t}\n}\n\n/// <summary>\n/// A class that supports the Gregorian based calendars with other eras\n/// (e.g. <see cref=\"T:System.Gloablization.JapaneseCalendar\"/>).\n/// </summary>\ninternal class CCGregorianEraHandler {\n\t/// <summary>\n\t/// A struct that represents a single era.\n\t/// </summary>\n\tstruct Era {\n\t\t/// <summary>\n\t\t/// The integer number identifying the era.\n\t\t/// </summary>\n\t\tprivate int _nr;\n\n\t\t/// <value>\n\t\t/// A get-only property that gives the era integer number.\n\t\t/// </value>\n\t\tpublic int Nr { get { return _nr; } }\n\n\t\t/// <summary>This integer gives the first day of the era as\n\t\t/// fixed day number.\n\t\t/// </summary>\n\t\tprivate int _start; // inclusive\n\t\t/// <summary>\n\t\t/// This integer gives the gregorian year of the\n\t\t/// <see cref=\"M:_start\"/> value.\n\t\t/// </summary>\n\t\tprivate int _gregorianYearStart;\n\t\t/// <summary>\n\t\t/// This integer gives the last day of the era as fixed day\n\t\t/// number.\n\t\t/// </summary>\n\t\tprivate int _end;   // inclusive\t\n\t\t/// <summary>\n\t\t/// This integer gives the largest year number of this era.\n\t\t/// </summary>\n\t\tprivate int _maxYear;\n\n\t\t/// <summary>\n\t\t/// This constructor creates the era structure.\n\t\t/// </summary>\n\t\t/// <param name=\"nr\">The integer number of the era.\n\t\t/// </param>\n\t\t/// <param name=\"start\">The fixed day number defining the\n\t\t/// first day of the era.\n\t\t/// </param>\n\t\t/// <param name=\"end\">The fixed day number that defines the\n\t\t/// last day of the era.\n\t\t/// </param>\n\t\tpublic Era(int nr, int start, int end) {\n\t\t\tif (nr == 0)\n\t\t\t\tthrow new System.ArgumentException(\n\t\t\t\t\t\"Era number shouldn't be zero.\");\n\t\t\t_nr = nr;\n\t\t\tif (start > end) {\n\t\t\t\tthrow new System.ArgumentException(\n\t\t\t\t\t\"Era should start before end.\");\n\t\t\t}\n\t\t\t_start = start;\n\t\t\t_end = end;\n\n\t\t\t_gregorianYearStart =\n\t\t\t\tCCGregorianCalendar.year_from_fixed(_start);\n\t\t\tint gregorianYearEnd =\n\t\t\t\tCCGregorianCalendar.year_from_fixed(_end);\n\t\t\t_maxYear = gregorianYearEnd - _gregorianYearStart + 1;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This method computes the Gregorian year from the year\n\t\t/// of this era.\n\t\t/// </summary>\n\t\t/// <param name=\"year\">An integer giving the year in the\n\t\t/// era.\n\t\t/// </param>\n\t\t/// <returns>\n\t\t/// The Gregorian year as integer.\n\t\t/// </returns>\n\t\t/// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n\t\t/// The exception is thrown if the year isn't valid in this\n\t\t/// era.\n\t\t/// </exception>\n\t\tpublic int GregorianYear(int year) {\n\t\t\tif (year < 1 || year > _maxYear) {\n\t\t\t\tSystem.IO.StringWriter sw = \n\t\t\t\t\tnew System.IO.StringWriter();\n\t\t\t\tsw.Write(\n\t\t\t\t\t\"Valid Values are between \" +\n\t\t\t\t\t\"{0} and {1}, inclusive.\",\n\t\t\t\t\t1, _maxYear);\n\t\t\t\tthrow new System.ArgumentOutOfRangeException(\n\t\t\t\t\t\"year\", sw.ToString());\n\t\t\t}\n\t\t\treturn year + _gregorianYearStart - 1;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This function checks wether the given fixed day number is\n\t\t/// ion the time span of the era.\n\t\t/// </summary>\n\t\t/// <param name=\"date\">An integer giving the fixed day\n\t\t/// number.\n\t\t/// </param>\n\t\t/// <returns>A boolean: true if the argument is in the time\n\t\t/// span of the era.\n\t\t/// </returns>\n\t\tpublic bool Covers(int date) {\n\t\t\treturn _start <= date && date <= _end;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// This function returns the year of the era and sets\n\t\t/// the era in an output parameter.\n\t\t/// </summary>\n\t\t/// <param name=\"era\">An output parameter returning the\n\t\t/// era number.\n\t\t/// </param>\n\t\t/// <param name=\"date\">An integer giving the fixed day\n\t\t/// number.\n\t\t/// </param>\n\t\t/// <returns>An integer giving the year of the era.\n\t\t/// </returns>\n\t\t/// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n\t\t/// The exception is thrown if date is outside of the time\n\t\t/// span of the era.\n\t\t/// </exception>\n\t\tpublic int EraYear(out int era, int date) {\n\t\t\tif (!Covers(date))\n\t\t\t\tthrow new System.ArgumentOutOfRangeException(\n\t\t\t\t\t\"date\", \n\t\t\t\t\t\"Time was out of Era range.\");\n\t\t\tint gregorianYear =\n\t\t\t\tCCGregorianCalendar.year_from_fixed(date);\n\t\t\tera = _nr;\n\t\t\treturn gregorianYear - _gregorianYearStart + 1;\n\t\t}\n\t} // struct Era\n\n\t/// <summary>\n\t/// A private member storing the eras in a\n\t/// <see cref=\"T:System.Collections.SortedList\"/>.\n\t/// </summary>\n\t//private SortedList _Eras;\n\n\t/// <value>\n\t/// The property returns the era numbers as an array of integers.\n\t/// </value>\n\tpublic int[] Eras {\n\t\tget {\n\t\t\tint[] a = new int[_Eras.Count];\n\n\t\t\tfor (int i = 0; i < _Eras.Count; i++) {\n\t\t\t\tEra e = (Era)_Eras.GetByIndex(i);\n\t\t\t\ta[i] = e.Nr;\n\t\t\t}\n\n\t\t\treturn a;\n\t\t}\n\t}\n\n\t/// <summary>\n\t/// Constructor.\n\t/// </summary>\n\tpublic CCGregorianEraHandler() {\n\t\t_Eras = new SortedList();\n\t}\n\n\t/// <summary>\n\t/// Method adds an era to the GregorianEraHandler instance.\n\t/// </summary>\n\t/// <param name=\"nr\">The integer number of the era.\n\t/// </param>\n\t/// <param name=\"rd_start\">The fixed day number defining the\n\t/// first day of the era.\n\t/// </param>\n\t/// <param name=\"rd_end\">The fixed day number that defines the\n\t/// last day of the era.\n\t/// </param>\n\tpublic void appendEra(int nr, int rd_start, int rd_end) {\n\t\tEra era = new Era(nr, rd_start, rd_end);\n\t\t_Eras[(System.Object)nr] = era;\n\t}\n\t/// <summary>\n\t/// Method adds a yet not-ended era to the GregorianEraHandler\n\t/// instance.\n\t/// </summary>\n\t/// <param name=\"nr\">The integer number of the era.\n\t/// </param>\n\t/// <param name=\"rd_start\">The fixed day number defining the\n\t/// first day of the era.\n\t/// </param>\n\tpublic void appendEra(int nr, int rd_start) {\n\t\tappendEra(nr, rd_start,\n\t\t\tCCFixed.FromDateTime(DateTime.MaxValue));\n\t}\n\n\t/// <summary>\n\t/// This method computes the Gregorian year from the year\n\t/// of the given era.\n\t/// </summary>\n\t/// <param name=\"year\">An integer giving the year in the\n\t/// era.\n\t/// </param>\n\t/// <param name=\"era\">An integer giving the era number.\n\t/// </param>\n\t/// <returns>\n\t/// The Gregorian year as integer.\n\t/// </returns>\n\t/// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n\t/// The exception is thrown if the year isn't valid in this\n\t/// era.\n\t/// </exception>\n\tpublic int GregorianYear(int year, int era) {\n\t\tEra e = (Era)_Eras[(System.Object)era];\n\t\treturn e.GregorianYear(year);\n\t}\n\n\t/// <summary>\n\t/// This function returns the year of the era and sets\n\t/// the era in an output parameter.\n\t/// </summary>\n\t/// <param name=\"era\">An output parameter returning the\n\t/// era number.\n\t/// </param>\n\t/// <param name=\"date\">An integer giving the fixed day\n\t/// number.\n\t/// </param>\n\t/// <returns>An integer giving the year of the era.\n\t/// </returns>\n\t/// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n\t/// The exception is thrown if the fixed day number is outside of the\n\t/// time spans of all eras.\n\t/// </exception>\n\tpublic int EraYear(out int era, int date)\n\t{\n\t\tIList list = _Eras.GetValueList();\n\n\t\tforeach (Era e in list) {\n\t\t\tif (e.Covers(date))\n\t\t\t\treturn e.EraYear(out era, date);\n\t\t}\n\n\t\tthrow new System.ArgumentOutOfRangeException(\"date\",\n\t\t\t\"Time value was out of era range.\");\n\t}\n\n\t/// <summary>\n\t/// The method checks whether a given\n\t/// <see cref=\"T:System.DateTime\"/> is covered by any era.\n\t/// </summary>\n\t/// <param name=\"time\">A \n\t/// <see cref=\"T:System.DateTime\"/> giving the date and time.\n\t/// </param>\n\t/// <exception cref=\"T:System.ArgumentOutOfRangeException\">\n\t/// The exception is thrown if the argument isn't inside the time\n\t/// span of any era.\n\t/// </exception>\n\tpublic void CheckDateTime(System.DateTime time) {\n\t\tint date = CCFixed.FromDateTime(time);\n\n\t\tif (!ValidDate(date))\n\t\t\tthrow new System.ArgumentOutOfRangeException(\"time\",\n\t\t\t\t\"Time value was out of era range.\");\n\t}\n\t\t\n\t/// <summary>\n\t/// The method tests whether a given\n\t/// fixed day number is covered by any era.\n\t/// </summary>\n\t/// <param name=\"date\">An integer representing the fixed day number.\n\t/// </param>\n\t/// <returns> A boolean is returned: true if the argument is inside\n\t/// the time span of one era; false otherwise.\n\t/// </returns>\n\tpublic bool ValidDate(int date) {\n\t\tIList list = _Eras.GetValueList();\n\n\t\tforeach (Era e in list) {\n\t\t\tif (e.Covers(date))\n\t\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/// <summary>\n\t/// The method tests, whether the era number does exist.\n\t/// </summary>\n\t/// <param name=\"era\">An integer giving the era number.\n\t/// </param>\n\t/// <returns>A boole value: True if the era number does exist;\n\t/// false otherwise.\n\t/// </returns>\n\tpublic bool ValidEra(int era) {\n\t\treturn _Eras.Contains((System.Object)era);\n\t}\n} // class CCGregorianEraHandler\n\n\n// FIXME: remove this class. It should be identical to CCGregorianEraHandler\ninternal class CCEastAsianLunisolarEraHandler\n{\n\tstruct Era \n\t{\n\t\tprivate int _nr; // era index\n\n\t\tpublic int Nr {\n\t\t\tget { return _nr; }\n\t\t}\n\n\t\tprivate int _start; // inclusive\n\t\tprivate int _gregorianYearStart;\n\t\tprivate int _end;   // inclusive\n\t\tprivate int _maxYear;\n\n\t\tpublic Era (int nr, int start, int end)\n\t\t{\n\t\t\tif (nr == 0)\n\t\t\t\tthrow new ArgumentException (\"Era number shouldn't be zero.\");\n\t\t\t_nr = nr;\n\t\t\tif (start > end)\n\t\t\t\tthrow new ArgumentException (\"Era should start before end.\");\n\t\t\t_start = start;\n\t\t\t_end = end;\n\n\t\t\t_gregorianYearStart = CCGregorianCalendar.year_from_fixed (_start);\n\t\t\tint gregorianYearEnd = CCGregorianCalendar.year_from_fixed (_end);\n\t\t\t_maxYear = gregorianYearEnd - _gregorianYearStart + 1;\n\t\t}\n\n\t\tpublic int GregorianYear (int year) \n\t\t{\n\t\t\tif (year < 1 || year > _maxYear)\n\t\t\t\tthrow new ArgumentOutOfRangeException (\"year\", String.Format (\"Valid Values are between {0} and {1}, inclusive.\", 1, _maxYear));\n\t\t\treturn year + _gregorianYearStart - 1;\n\t\t}\n\n\t\tpublic bool Covers (int date) {\n\t\t\treturn _start <= date && date <= _end;\n\t\t}\n\n\t\tpublic int EraYear (out int era, int date) {\n\t\t\tif (!Covers (date))\n\t\t\t\tthrow new ArgumentOutOfRangeException (\"date\", \"Time was out of Era range.\");\n\t\t\tint gregorianYear = CCGregorianCalendar.year_from_fixed (date);\n\t\t\tera = _nr;\n\t\t\treturn gregorianYear - _gregorianYearStart + 1;\n\t\t}\n\t}\n\n\t//private SortedList _Eras;\n\n\tpublic int [] Eras \n\t{\n\t\tget {\n\t\t\tint[] a = new int [_Eras.Count];\n\t\t\tfor (int i = 0; i < _Eras.Count; i++) {\n\t\t\t\tEra e = (Era) _Eras.GetByIndex (i);\n\t\t\t\ta[i] = e.Nr;\n\t\t\t}\n\t\t\treturn a;\n\t\t}\n\t}\n\n\tpublic CCEastAsianLunisolarEraHandler ()\n\t{\n\t\t_Eras = new SortedList ();\n\t}\n\n\tpublic void appendEra (int nr, int rd_start, int rd_end)\n\t{\n\t\tEra era = new Era (nr, rd_start, rd_end);\n\t\t_Eras [nr] = era;\n\t}\n\n\tpublic void appendEra (int nr, int rd_start)\n\t{\n\t\tappendEra (nr, rd_start, CCFixed.FromDateTime (DateTime.MaxValue));\n\t}\n\n\tpublic int GregorianYear (int year, int era)\n\t{\n\t\tEra e = (Era) _Eras [era];\n\t\treturn e.GregorianYear (year);\n\t}\n\n\tpublic int EraYear (out int era, int date)\n\t{\n\t\tforeach (Era e in _Eras.Values)\n\t\t\tif (e.Covers (date))\n\t\t\t\treturn e.EraYear (out era, date);\n\n\t\tthrow new ArgumentOutOfRangeException (\"date\", \"Time value was out of era range.\");\n\t}\n\n\tpublic void CheckDateTime (DateTime time)\n\t{\n\t\tint date = CCFixed.FromDateTime (time);\n\n\t\tif (!ValidDate (date))\n\t\t\tthrow new ArgumentOutOfRangeException (\"time\", \"Time value was out of era range.\");\n\t}\n\t\t\n\tpublic bool ValidDate (int date)\n\t{\n\t\tforeach (Era e in _Eras.Values) {\n\t\t\tif (e.Covers (date))\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpublic bool ValidEra (int era)\n\t{\n\t\treturn _Eras.Contains (era);\n\t}\n}\n*/\n} // namespace System.Globalization\n"
  },
  {
    "path": "corlib/System.Globalization/CultureInfo.cs",
    "content": "#if !LOCALTEST\n\nusing System.Threading;\nusing System.Collections.Generic;\nusing System.IO;\n\nnamespace System.Globalization {\n\tpublic class CultureInfo {\n\n\t\t#region Static methods\n\n\t\tprivate static Dictionary<string, CultureInfo> shareByName = new Dictionary<string,CultureInfo>();\n\n\t\tprivate static CultureInfo invariantCulture = null;\n\n\t\tpublic static CultureInfo GetCultureInfo(string name) {\n\t\t\t// Always use lower-case version of name\n\t\t\tlock (shareByName) {\n\t\t\t\tCultureInfo ci;\n\t\t\t\tif (!shareByName.TryGetValue(name.ToLowerInvariant(), out ci)) {\n\t\t\t\t\tci = new CultureInfo(name);\n\t\t\t\t\t// Don't put in cache, as the constructor already does this\n\t\t\t\t}\n\t\t\t\treturn ci;\n\t\t\t}\n\t\t}\n\n\t\tpublic static CultureInfo CurrentCulture {\n\t\t\tget {\n\t\t\t\treturn Thread.CurrentThread.CurrentCulture;\n\t\t\t}\n\t\t}\n\n\t\tpublic static CultureInfo InvariantCulture {\n\t\t\tget {\n\t\t\t\tif (invariantCulture == null) {\n\t\t\t\t\tinvariantCulture = new CultureInfo(string.Empty);\n\t\t\t\t}\n\t\t\t\treturn invariantCulture;\n\t\t\t}\n\t\t}\n\n\t\tpublic static CultureInfo[] GetCultures(CultureTypes types) {\n\t\t\tDirectoryInfo cultureDir = new DirectoryInfo(Environment.CultureDirectory);\n\t\t\tList<CultureInfo> ret = new List<CultureInfo>();\n\t\t\tforeach (FileInfo fi in cultureDir.GetFiles()) {\n\t\t\t\tCultureInfo ci = CultureInfo.GetCultureInfo(fi.Name);\n\t\t\t\tif ((ci.cultureTypes & types) > 0) {\n\t\t\t\t\tret.Add(ci);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ret.ToArray();\n\t\t}\n\n\t\t#endregion\n\n\t\tprivate string name;\n\t\tprivate int lcid;\n\t\tprivate string parentName;\n\t\tprivate CultureInfo parent = null;\n\t\tprivate string displayName;\n\t\tprivate string englishName;\n\t\tprivate string nativeName;\n\t\tprivate string twoLetterISOLanguageName;\n\t\tprivate string threeLetterISOLanguageName;\n\t\tprivate string threeLetterWindowsLanguageName;\n\t\tprivate CultureTypes cultureTypes;\n\t\tprivate string ietfLanguageTag;\n\t\tprivate bool isNeutralCulture;\n\t\tprivate NumberFormatInfo numberFormatInfo;\n\t\tprivate TextInfo textInfo;\n\t\tprivate DateTimeFormatInfo dateTimeFormat;\n\n\t\tpublic CultureInfo(string name) {\n\t\t\tif (name == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tif (name.Length == 0) {\n\t\t\t\tConstructInvariant();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Always use lower-case version of name\n\t\t\tstring nameLower = name.ToLowerInvariant();\n\t\t\t// If this culture is already loaded and cached, then just copy all of its settings\n\t\t\tlock (shareByName) {\n\t\t\t\tCultureInfo cached;\n\t\t\t\tif (shareByName.TryGetValue(nameLower, out cached)) {\n\t\t\t\t\tCopyFrom(cached);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Not cached, so create from new and place in cache\n\t\t\tConstructFromFile(name);\n\t\t}\n\n\t\tprivate void ConstructInvariant() {\n\t\t\tthis.name = string.Empty;\n\t\t\tthis.displayName =\n\t\t\tthis.englishName =\n\t\t\tthis.nativeName = \"Invariant Language (Invariant Country)\";\n\t\t\tthis.lcid = 0x7f;\n\t\t\tthis.numberFormatInfo = NumberFormatInfo.InvariantInfo;\n\t\t\tthis.dateTimeFormat = DateTimeFormatInfo.InvariantInfo;\n\t\t}\n\n\t\tprivate void ConstructFromFile(string name) {\n\t\t\tstring fileName = Environment.CultureDirectory + Path.DirectorySeparatorStr + name;\n\t\t\ttry {\n\t\t\t\tusing (StreamReader s = File.OpenText(fileName)) {\n\t\t\t\t\tthis.name = s.ReadLine();\n\t\t\t\t\tthis.lcid = int.Parse(s.ReadLine().Substring(2), NumberStyles.HexNumber);\n\t\t\t\t\tthis.parentName = s.ReadLine();\n\t\t\t\t\tthis.englishName = s.ReadLine();\n\t\t\t\t\tthis.nativeName = s.ReadLine();\n\t\t\t\t\tthis.displayName = s.ReadLine();\n\t\t\t\t\tthis.twoLetterISOLanguageName = s.ReadLine();\n\t\t\t\t\tthis.threeLetterISOLanguageName = s.ReadLine();\n\t\t\t\t\tthis.threeLetterWindowsLanguageName = s.ReadLine();\n\t\t\t\t\tstring calendarName = s.ReadLine(); // Calendar\n\t\t\t\t\ts.ReadLine(); // Optional calendars\n\t\t\t\t\tthis.cultureTypes = (CultureTypes)int.Parse(s.ReadLine());\n\t\t\t\t\tthis.ietfLanguageTag = s.ReadLine();\n\t\t\t\t\tthis.isNeutralCulture = bool.Parse(s.ReadLine());\n\t\t\t\t\tthis.textInfo = new TextInfo(this, s);\n\t\t\t\t\tif (!this.isNeutralCulture) {\n\t\t\t\t\t\tthis.numberFormatInfo = new NumberFormatInfo(s);\n\t\t\t\t\t\tthis.dateTimeFormat = new DateTimeFormatInfo(s, calendarName);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.numberFormatInfo = null;\n\t\t\t\t\t\tthis.dateTimeFormat = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (FileNotFoundException) {\n\t\t\t\tthrow new ArgumentException(string.Format(\"{0} is not a valid culture\", name));\n\t\t\t}\n\t\t\tlock (shareByName) {\n\t\t\t\tshareByName.Add(name.ToLowerInvariant(), this);\n\t\t\t}\n\t\t}\n\n\t\tprivate void CopyFrom(CultureInfo ci) {\n\t\t\tthis.name = ci.name;\n\t\t\tthis.lcid = ci.lcid;\n\t\t\tthis.parent = ci.parent;\n\t\t\tthis.englishName = ci.englishName;\n\t\t\tthis.nativeName = ci.nativeName;\n\t\t\tthis.displayName = ci.displayName;\n\t\t\tthis.twoLetterISOLanguageName = ci.twoLetterISOLanguageName;\n\t\t\tthis.threeLetterISOLanguageName = ci.threeLetterISOLanguageName;\n\t\t\tthis.threeLetterWindowsLanguageName = ci.threeLetterWindowsLanguageName;\n\t\t\tthis.cultureTypes = ci.cultureTypes;\n\t\t\tthis.ietfLanguageTag = ci.ietfLanguageTag;\n\t\t\tthis.isNeutralCulture = ci.isNeutralCulture;\n\n\t\t\tthis.textInfo = ci.textInfo;\n\t\t\tthis.numberFormatInfo = ci.numberFormatInfo;\n\t\t\tthis.dateTimeFormat = ci.dateTimeFormat;\n\t\t}\n\n\t\tpublic bool IsReadOnly {\n\t\t\tget{\n\t\t\t\t// At the moment, all CultureInfo's are read-only\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual NumberFormatInfo NumberFormat {\n\t\t\tget {\n\t\t\t\tif (this.numberFormatInfo == null) {\n\t\t\t\t\tthrow new NotSupportedException(\"Not supported for neutral cultures\");\n\t\t\t\t}\n\t\t\t\treturn this.numberFormatInfo;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual DateTimeFormatInfo DateTimeFormat {\n\t\t\tget {\n\t\t\t\tif (this.dateTimeFormat == null) {\n\t\t\t\t\tthrow new NotSupportedException(\"Not supported for neutral cultures\");\n\t\t\t\t}\n\t\t\t\treturn this.dateTimeFormat;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual int LCID {\n\t\t\tget {\n\t\t\t\treturn this.lcid;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string Name {\n\t\t\tget {\n\t\t\t\treturn this.name;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual CultureInfo Parent {\n\t\t\tget {\n\t\t\t\tif (this.parent == null) {\n\t\t\t\t\tthis.parent = CultureInfo.GetCultureInfo(this.parentName);\n\t\t\t\t}\n\t\t\t\treturn this.parent;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string DisplayName {\n\t\t\tget {\n\t\t\t\treturn this.displayName;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string EnglishName {\n\t\t\tget {\n\t\t\t\treturn this.englishName;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string NativeName {\n\t\t\tget {\n\t\t\t\treturn this.nativeName;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string TwoLetterISOLanguageName {\n\t\t\tget {\n\t\t\t\treturn this.twoLetterISOLanguageName;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string ThreeLetterISOLanguageName {\n\t\t\tget {\n\t\t\t\treturn this.threeLetterISOLanguageName;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string ThreeLetterWindowsLanguageName {\n\t\t\tget {\n\t\t\t\treturn this.threeLetterWindowsLanguageName;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual CultureTypes CultureTypes {\n\t\t\tget {\n\t\t\t\treturn this.cultureTypes;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual string IetfLanguageTag {\n\t\t\tget {\n\t\t\t\treturn this.ietfLanguageTag;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual bool IsNeutralCulture {\n\t\t\tget {\n\t\t\t\treturn this.isNeutralCulture;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual TextInfo TextInfo {\n\t\t\tget {\n\t\t\t\treturn this.textInfo;\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ToString() {\n\t\t\treturn this.name;\n\t\t}\n\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System.Globalization/CultureTypes.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.Globalization {\n\t[Flags]\n\tpublic enum CultureTypes {\n\t\tNeutralCultures = 1,\n\t\tSpecificCultures = 2,\n\t\tInstalledWin32Cultures = 4,\n\t\tAllCultures = 7,\n\t\tUserCustomCulture = 8,\n\t\tReplacementCultures = 16,\n\t\tWindowsOnlyCultures = 32,\n\t\tFrameworkCultures = 64,\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System.Globalization/DateTimeFormatInfo.cs",
    "content": "#if !LOCALTEST\n\nusing System.IO;\nusing System.Threading;\nnamespace System.Globalization {\n\tpublic sealed class DateTimeFormatInfo {\n\n\t\tpublic static DateTimeFormatInfo InvariantInfo {\n\t\t\tget {\n\t\t\t\tDateTimeFormatInfo dtfi = new DateTimeFormatInfo();\n\t\t\t\tdtfi.isReadOnly = true;\n\t\t\t\treturn dtfi;\n\t\t\t}\n\t\t}\n\n\t\tpublic static DateTimeFormatInfo CurrentInfo {\n\t\t\tget {\n\t\t\t\treturn Thread.CurrentThread.CurrentCulture.DateTimeFormat;\n\t\t\t}\n\t\t}\n\n\t\tpublic static DateTimeFormatInfo GetInstance(IFormatProvider fp) {\n\t\t\tif (fp != null) {\n\t\t\t\tDateTimeFormatInfo dtf = (DateTimeFormatInfo)fp.GetFormat(typeof(DateTimeFormatInfo));\n\t\t\t\tif (dtf != null) {\n\t\t\t\t\treturn dtf;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn CurrentInfo;\n\t\t}\n\n\t\tprivate bool isReadOnly;\n\t\tprivate string[] abbreviatedDayNames;\n\t\tprivate string[] abbreviatedMonthGenitiveNames;\n\t\tprivate string[] abbreviatedMonthNames;\n\t\tprivate string amDesignator;\n\t\tprivate CalendarWeekRule calendarWeekRule;\n\t\tprivate string dateSeparator;\n\t\tprivate string[] dayNames;\n\t\tprivate DayOfWeek firstDayOfWeek;\n\t\tprivate string fullDateTimePattern;\n\t\tprivate string longDatePattern;\n\t\tprivate string longTimePattern;\n\t\tprivate string monthDayPattern;\n\t\tprivate string[] monthGenitiveNames;\n\t\tprivate string[] monthNames;\n\t\tprivate string nativeCalendarName; // This probably needs to change\n\t\tprivate string pmDesignator;\n\t\tprivate string rfc1123Pattern;\n\t\tprivate string shortDatePattern;\n\t\tprivate string[] shortestDayNames;\n\t\tprivate string shortTimePattern;\n\t\tprivate string sortableDateTimePattern;\n\t\tprivate string timeSeparator;\n\t\tprivate string universalSortableDateTimePattern;\n\t\tprivate string yearMonthPattern;\n\t\tprivate Calendar calendar;\n\n\t\tinternal DateTimeFormatInfo(StreamReader s, string calendarName) {\n\t\t\tchar[] comma = new char[] { ',' };\n\t\t\tthis.abbreviatedDayNames = s.ReadLine().Split(comma);\n\t\t\tthis.abbreviatedMonthGenitiveNames = s.ReadLine().Split(comma);\n\t\t\tthis.abbreviatedMonthNames = s.ReadLine().Split(comma);\n\t\t\tthis.amDesignator = s.ReadLine();\n\t\t\tthis.calendarWeekRule = (CalendarWeekRule)int.Parse(s.ReadLine());\n\t\t\tthis.dateSeparator = s.ReadLine();\n\t\t\tthis.dayNames = s.ReadLine().Split(comma);\n\t\t\tthis.firstDayOfWeek = (DayOfWeek)int.Parse(s.ReadLine());\n\t\t\tthis.fullDateTimePattern = s.ReadLine();\n\t\t\tthis.longDatePattern = s.ReadLine();\n\t\t\tthis.longTimePattern = s.ReadLine();\n\t\t\tthis.monthDayPattern = s.ReadLine();\n\t\t\tthis.monthGenitiveNames = s.ReadLine().Split(comma);\n\t\t\tthis.monthNames = s.ReadLine().Split(comma);\n\t\t\tthis.nativeCalendarName = s.ReadLine();\n\t\t\ts.ReadLine(); // TODO: Appears to be a mistake in the culture files. Extra line added.\n\t\t\tthis.pmDesignator = s.ReadLine();\n\t\t\tthis.rfc1123Pattern = s.ReadLine(); // This is always the same, so does it need to be in the culture file?\n\t\t\tthis.shortDatePattern = s.ReadLine();\n\t\t\tthis.shortestDayNames = s.ReadLine().Split(comma);\n\t\t\tthis.shortTimePattern = s.ReadLine();\n\t\t\tthis.sortableDateTimePattern = s.ReadLine(); // This is always the same\n\t\t\tthis.timeSeparator = s.ReadLine();\n\t\t\tthis.universalSortableDateTimePattern = s.ReadLine(); // This is always the same\n\t\t\tthis.yearMonthPattern = s.ReadLine();\n\t\t\tthis.calendar = Calendar.CreateByName(calendarName);\n\t\t}\n\n\t\tpublic DateTimeFormatInfo() {\n\t\t\t// Construct an invariant culture DateTimeFormatInfo\n\t\t\tchar[] comma = new char[] { ',' };\n\t\t\tthis.isReadOnly = true;\n\t\t\tthis.abbreviatedDayNames = \"Sun,Mon,Tue,Wed,Thu,Fri,Sat\".Split(comma);\n\t\t\tthis.abbreviatedMonthGenitiveNames = \"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\".Split(comma);\n\t\t\tthis.abbreviatedMonthNames = \"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\".Split(comma);\n\t\t\tthis.amDesignator = \"AM\";\n\t\t\tthis.calendarWeekRule = CalendarWeekRule.FirstDay;\n\t\t\tthis.dateSeparator = \"/\";\n\t\t\tthis.dayNames = \"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\".Split(comma);\n\t\t\tthis.firstDayOfWeek = DayOfWeek.Sunday;\n\t\t\tthis.fullDateTimePattern = \"dddd, dd MMMM yyyy HH:mm:ss\";\n\t\t\tthis.longDatePattern = \"dddd, dd MMMM yyyy\";\n\t\t\tthis.longTimePattern = \"HH:mm:ss\";\n\t\t\tthis.monthDayPattern = \"MMMM dd\";\n\t\t\tthis.monthGenitiveNames = \"January,February,March,April,May,June,July,August,September,October,November,December,\".Split(comma);\n\t\t\tthis.monthNames = \"January,February,March,April,May,June,July,August,September,October,November,December,\".Split(comma);\n\t\t\tthis.nativeCalendarName = \"Gregorian Calendar\";\n\t\t\tthis.pmDesignator = \"PM\";\n\t\t\tthis.rfc1123Pattern = \"ddd, dd MMM yyyy HH':'mm':'ss 'GMT'\";\n\t\t\tthis.shortDatePattern = \"MM/dd/yyyy\";\n\t\t\tthis.shortestDayNames = \"Su,Mo,Tu,We,Th,Fr,Sa\".Split(comma);\n\t\t\tthis.shortTimePattern = \"HH:mm\";\n\t\t\tthis.sortableDateTimePattern = \"yyyy'-'MM'-'dd'T'HH':'mm':'ss\";\n\t\t\tthis.timeSeparator = \":\";\n\t\t\tthis.universalSortableDateTimePattern = \"yyyy'-'MM'-'dd HH':'mm':'ss'Z'\";\n\t\t\tthis.yearMonthPattern = \"yyyy MMMM\";\n\t\t\tthis.calendar = new GregorianCalendar();\n\t\t}\n\n\t\tpublic bool IsReadOnly { get { return this.isReadOnly; } }\n\t\tpublic string[] AbbreviatedDayNames { get { return this.abbreviatedDayNames; } }\n\t\tpublic string[] AbbreviatedMonthGenitiveNames { get { return this.abbreviatedMonthGenitiveNames; } }\n\t\tpublic string[] AbbreviatedMonthNames { get { return this.abbreviatedMonthNames; } }\n\t\tpublic string AMDesignator { get { return this.amDesignator; } }\n\t\tpublic CalendarWeekRule CalendarWeekRule { get { return this.calendarWeekRule; } }\n\t\tpublic string DateSeparator { get { return this.dateSeparator; } }\n\t\tpublic string[] DayNames { get { return this.dayNames; } }\n\t\tpublic DayOfWeek FirstDayOfWeek { get { return this.firstDayOfWeek; } }\n\t\tpublic string FullDateTimePattern { get { return this.fullDateTimePattern; } }\n\t\tpublic string LongDatePattern { get { return this.longDatePattern; } }\n\t\tpublic string LongTimePattern { get { return this.longTimePattern; } }\n\t\tpublic string MonthDayPattern { get { return this.monthDayPattern; } }\n\t\tpublic string[] MonthGenitiveNames { get { return this.monthGenitiveNames; } }\n\t\tpublic string[] MonthNames { get { return this.monthNames; } }\n\t\tpublic string NativeCalendarName { get { return this.nativeCalendarName; } }\n\t\tpublic string PMDesignator { get { return this.pmDesignator; } }\n\t\tpublic string RFC1123Pattern { get { return this.rfc1123Pattern; } }\n\t\tpublic string ShortDatePattern { get { return this.shortDatePattern; } }\n\t\tpublic string[] ShortestDayNames { get { return this.shortestDayNames; } }\n\t\tpublic string ShortTimePattern { get { return this.shortTimePattern; } }\n\t\tpublic string SortableDateTimePattern { get { return this.sortableDateTimePattern; } }\n\t\tpublic string TimeSeparator { get { return this.timeSeparator; } }\n\t\tpublic string UniversalSortableDateTimePattern { get { return this.universalSortableDateTimePattern; } }\n\t\tpublic string YearMonthPattern { get { return this.yearMonthPattern; } }\n\t\tpublic Calendar Calendar { get { return this.calendar; } }\n\n\t\tpublic string GetAbbreviatedDayName(DayOfWeek dow) {\n\t\t\treturn this.abbreviatedDayNames[(int)dow];\n\t\t}\n\n\t\tpublic string GetAbbreviatedMonthName(int m) {\n\t\t\treturn this.abbreviatedMonthNames[m];\n\t\t}\n\n\t\tpublic string GetDayName(DayOfWeek dow) {\n\t\t\treturn this.dayNames[(int)dow];\n\t\t}\n\n\t\tpublic string GetEraName(int era) {\n\t\t\treturn this.calendar.eraNames[era - 1];\n\t\t}\n\n\t\tpublic string GetMonthName(int m) {\n\t\t\treturn this.monthNames[m];\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/DigitShapes.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.Globalization {\n\tpublic enum DigitShapes {\n\t\tContext = 0,\n\t\tNone = 1,\n\t\tNativeNational = 2\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/GregorianCalendar.cs",
    "content": "#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Globalization {\n\tpublic class GregorianCalendar : Calendar {\n\n\t\tpublic const int ADEra = 1;\n\n\t\tprivate GregorianCalendarTypes type;\n\n\t\tpublic GregorianCalendar() : this(GregorianCalendarTypes.Localized) { }\n\n\t\tpublic GregorianCalendar(GregorianCalendarTypes type) {\n\t\t\tbase.eraNames = new string[] { \"A.D.\" };\n\t\t\tbase.eraAbbrNames = new string[] { \"AD\" };\n\t\t\tthis.type = type;\n\t\t}\n\n\t\tpublic override int[] Eras {\n\t\t\tget {\n\t\t\t\treturn new int[] { ADEra };\n\t\t\t}\n\t\t}\n\n\t\tpublic override int GetEra(DateTime dt) {\n\t\t\treturn ADEra;\n\t\t}\n\n\t\tpublic override DayOfWeek GetDayOfWeek(DateTime time) {\n\t\t\tint rd = CCFixed.FromDateTime(time);\n\t\t\treturn (DayOfWeek)CCFixed.day_of_week(rd);\n\t\t}\n\n\t\tpublic override int GetDayOfMonth(DateTime time) {\n\t\t\treturn CCGregorianCalendar.GetDayOfMonth(time);\n\t\t}\n\n\t\tpublic override int GetMonth(DateTime time) {\n\t\t\treturn CCGregorianCalendar.GetMonth(time);\n\t\t}\n\n\t\tpublic override int GetYear(DateTime time) {\n\t\t\treturn CCGregorianCalendar.GetYear(time);\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/GregorianCalendarTypes.cs",
    "content": "#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Globalization {\n\tpublic enum GregorianCalendarTypes {\n\t\tLocalized = 1,\n\t\tUSEnglish = 2,\n\t\tMiddleEastFrench = 9,\n\t\tArabic = 10,\n\t\tTransliteratedEnglish = 11,\n\t\tTransliteratedFrench = 12,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/NumberFormatInfo.cs",
    "content": "#if !LOCALTEST\n\nusing System.Threading;\nusing System.IO;\nnamespace System.Globalization {\n\tpublic class NumberFormatInfo : IFormatProvider {\n\n\t\t#region Static Methods/Properties\n\n\t\tprivate static string[] defaultNativeDigits = new string[] { \"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\" };\n\n\t\tpublic static NumberFormatInfo CurrentInfo {\n\t\t\tget {\n\t\t\t\tNumberFormatInfo nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;\n\t\t\t\treturn nfi;\n\t\t\t}\n\t\t}\n\n\t\tpublic static NumberFormatInfo InvariantInfo {\n\t\t\tget {\n\t\t\t\tNumberFormatInfo nfi = new NumberFormatInfo();\n\t\t\t\tnfi.isReadOnly = true;\n\t\t\t\treturn nfi;\n\t\t\t}\n\t\t}\n\n\t\tpublic static NumberFormatInfo GetInstance(IFormatProvider provider) {\n\t\t\tif (provider != null) {\n\t\t\t\tNumberFormatInfo nfi;\n\t\t\t\tnfi = (NumberFormatInfo)provider.GetFormat(typeof(NumberFormatInfo));\n\t\t\t\tif (nfi != null) {\n\t\t\t\t\treturn nfi;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn CurrentInfo;\n\t\t}\n\n\t\t#endregion\n\n\t\tprivate bool isReadOnly;\n\t\tprivate int currencyDecimalDigits;\n\t\tprivate string currencyDecimalSeparator;\n\t\tprivate string currencyGroupSeparator;\n\t\tprivate int[] currencyGroupSizes;\n\t\tprivate int currencyNegativePattern;\n\t\tprivate int currencyPositivePattern;\n\t\tprivate string currencySymbol;\n\t\tprivate DigitShapes digitSubstitution;\n\t\tprivate string naNSymbol;\n\t\tprivate string[] nativeDigits;\n\t\tprivate string negativeInfinitySymbol;\n\t\tprivate string negativeSign;\n\t\tprivate int numberDecimalDigits;\n\t\tprivate string numberDecimalSeparator;\n\t\tprivate string numberGroupSeparator;\n\t\tprivate int[] numberGroupSizes;\n\t\tprivate int numberNegativePattern;\n\t\tprivate int percentDecimalDigits;\n\t\tprivate string percentDecimalSeparator;\n\t\tprivate string percentGroupSeparator;\n\t\tprivate int[] percentGroupSizes;\n\t\tprivate int percentNegativePattern;\n\t\tprivate int percentPositivePattern;\n\t\tprivate string percentSymbol;\n\t\tprivate string perMilleSymbol;\n\t\tprivate string positiveInfinitySymbol;\n\t\tprivate string positiveSign;\n\n\t\tprivate static int[] ConvertToIntArray(string s) {\n\t\t\tstring[] list = s.Split(',');\n\t\t\tint listLen = list.Length;\n\t\t\tint[] ret = new int[listLen];\n\t\t\tfor (int i = 0; i < listLen; i++) {\n\t\t\t\tret[i] = int.Parse(list[i]);\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\tinternal NumberFormatInfo(StreamReader s) {\n\t\t\tthis.isReadOnly = true;\n\t\t\t// Sets up information from stream\n\t\t\tthis.currencyDecimalDigits = int.Parse(s.ReadLine());\n\t\t\tthis.currencyDecimalSeparator = s.ReadLine();\n\t\t\tthis.currencyGroupSeparator = s.ReadLine();\n\t\t\tthis.currencyGroupSizes = ConvertToIntArray(s.ReadLine());\n\t\t\tthis.currencyNegativePattern = int.Parse(s.ReadLine());\n\t\t\tthis.currencyPositivePattern = int.Parse(s.ReadLine());\n\t\t\tthis.currencySymbol = s.ReadLine();\n\t\t\tthis.digitSubstitution = (DigitShapes)int.Parse(s.ReadLine());\n\t\t\tthis.naNSymbol = s.ReadLine();\n\t\t\tthis.nativeDigits = s.ReadLine().Split(',');\n\t\t\tthis.negativeInfinitySymbol = s.ReadLine();\n\t\t\tthis.negativeSign = s.ReadLine();\n\t\t\tthis.numberDecimalDigits = int.Parse(s.ReadLine());\n\t\t\tthis.numberDecimalSeparator = s.ReadLine();\n\t\t\tthis.numberGroupSeparator = s.ReadLine();\n\t\t\tthis.numberGroupSizes = ConvertToIntArray(s.ReadLine());\n\t\t\tthis.numberNegativePattern = int.Parse(s.ReadLine());\n\t\t\tthis.percentDecimalDigits = int.Parse(s.ReadLine());\n\t\t\tthis.percentDecimalSeparator = s.ReadLine();\n\t\t\tthis.percentGroupSeparator = s.ReadLine();\n\t\t\tthis.percentGroupSizes = ConvertToIntArray(s.ReadLine());\n\t\t\tthis.percentNegativePattern = int.Parse(s.ReadLine());\n\t\t\tthis.percentPositivePattern = int.Parse(s.ReadLine());\n\t\t\tthis.percentSymbol = s.ReadLine();\n\t\t\tthis.perMilleSymbol = s.ReadLine();\n\t\t\tthis.positiveInfinitySymbol = s.ReadLine();\n\t\t\tthis.positiveSign = s.ReadLine();\n\t\t}\n\n\t\tpublic NumberFormatInfo() {\n\t\t\tthis.isReadOnly = true;\n\t\t\t// Set up defaults for invariant culture\n\t\t\tthis.currencyDecimalDigits = 2;\n\t\t\tthis.currencyDecimalSeparator = \".\";\n\t\t\tthis.currencyGroupSeparator = \",\";\n\t\t\tthis.currencyGroupSizes = new int[] { 3 };\n\t\t\tthis.currencyNegativePattern = 0;\n\t\t\tthis.currencyPositivePattern = 0;\n\t\t\tthis.currencySymbol = \"$\";\n\t\t\tthis.digitSubstitution = DigitShapes.None;\n\t\t\tthis.naNSymbol = \"NaN\";\n\t\t\tthis.nativeDigits = defaultNativeDigits;\n\t\t\tthis.negativeInfinitySymbol = \"-Infinity\";\n\t\t\tthis.negativeSign = \"-\";\n\t\t\tthis.numberDecimalDigits = 2;\n\t\t\tthis.numberDecimalSeparator = \".\";\n\t\t\tthis.numberGroupSeparator = \",\";\n\t\t\tthis.numberGroupSizes = new int[] { 3 };\n\t\t\tthis.numberNegativePattern = 1;\n\t\t\tthis.percentDecimalDigits = 2;\n\t\t\tthis.percentDecimalSeparator = \".\";\n\t\t\tthis.percentGroupSeparator = \",\";\n\t\t\tthis.percentGroupSizes = new int[] { 3 };\n\t\t\tthis.percentNegativePattern = 0;\n\t\t\tthis.percentPositivePattern = 0;\n\t\t\tthis.percentSymbol = \"%\";\n\t\t\tthis.perMilleSymbol = \"\\x2030\";\n\t\t\tthis.positiveInfinitySymbol = \"Infinity\";\n\t\t\tthis.positiveSign = \"+\";\n\t\t}\n\n\t\tpublic bool IsReadOnly { get { return this.isReadOnly; } }\n\t\tpublic int CurrencyDecimalDigits { get { return this.currencyDecimalDigits; } }\n\t\tpublic string CurrencyDecimalSeparator { get { return this.currencyDecimalSeparator; } }\n\t\tpublic string CurrencyGroupSeparator { get { return this.currencyGroupSeparator; } }\n\t\tpublic int[] CurrencyGroupSizes { get { return this.currencyGroupSizes; } }\n\t\tpublic int CurrencyNegativePattern { get { return this.currencyNegativePattern; } }\n\t\tpublic int CurrencyPositivePattern { get { return this.currencyPositivePattern; } }\n\t\tpublic string CurrencySymbol { get { return this.currencySymbol; } }\n\t\tpublic DigitShapes DigitSubstitution { get { return this.digitSubstitution; } }\n\t\tpublic string NaNSymbol { get { return this.naNSymbol; } }\n\t\tpublic string[] NativeDigits { get { return this.nativeDigits; } }\n\t\tpublic string NegativeInfinitySymbol { get { return this.negativeInfinitySymbol; } }\n\t\tpublic string NegativeSign { get { return this.negativeSign; } }\n\t\tpublic int NumberDecimalDigits { get { return this.numberDecimalDigits; } }\n\t\tpublic string NumberDecimalSeparator { get { return this.numberDecimalSeparator; } }\n\t\tpublic string NumberGroupSeparator { get { return this.numberGroupSeparator; } }\n\t\tpublic int[] NumberGroupSizes { get { return this.numberGroupSizes; } }\n\t\tpublic int NumberNegativePattern { get { return this.numberNegativePattern; } }\n\t\tpublic int PercentDecimalDigits { get { return this.percentDecimalDigits; } }\n\t\tpublic string PercentDecimalSeparator { get { return this.percentDecimalSeparator; } }\n\t\tpublic string PercentGroupSeparator { get { return this.percentGroupSeparator; } }\n\t\tpublic int[] PercentGroupSizes { get { return this.percentGroupSizes; } }\n\t\tpublic int PercentNegativePattern { get { return this.percentNegativePattern; } }\n\t\tpublic int PercentPositivePattern { get { return this.percentPositivePattern; } }\n\t\tpublic string PercentSymbol { get { return this.percentSymbol; } }\n\t\tpublic string PerMilleSymbol { get { return this.perMilleSymbol; } }\n\t\tpublic string PositiveInfinitySymbol { get { return this.positiveInfinitySymbol; } }\n\t\tpublic string PositiveSign { get { return this.positiveSign; } }\n\n\t\t#region IFormatProvider Members\n\n\t\tpublic object GetFormat(Type formatType) {\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\t#endregion\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/NumberStyles.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.Globalization {\n\tpublic enum NumberStyles {\n\t\tNone = 0x00000000,\n\t\tAllowLeadingWhite = 0x00000001,\n\t\tAllowTrailingWhite = 0x00000002,\n\t\tAllowLeadingSign = 0x00000004,\n\t\tAllowTrailingSign = 0x00000008,\n\t\tAllowParentheses = 0x00000010,\n\t\tAllowDecimalPoint = 0x00000020,\n\t\tAllowThousands = 0x00000040,\n\t\tAllowExponent = 0x00000080,\n\t\tAllowCurrencySymbol = 0x00000100,\n\t\tAllowHexSpecifier = 0x00000200,\n\n\t\tInteger = (AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign),\n\t\tHexNumber = (AllowLeadingWhite | AllowTrailingWhite | AllowHexSpecifier),\n\t\tNumber = (AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n\t\t\t\t  AllowTrailingSign | AllowDecimalPoint | AllowThousands),\n\t\tFloat = (AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n\t\t\t\t  AllowDecimalPoint | AllowExponent),\n\t\tCurrency = (AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n\t\t\t\t  AllowTrailingSign | AllowParentheses | AllowDecimalPoint |\n\t\t\t\t  AllowThousands | AllowCurrencySymbol),\n\t\tAny = (AllowLeadingWhite | AllowTrailingWhite | AllowLeadingSign |\n\t\t\t\t  AllowTrailingSign | AllowParentheses | AllowDecimalPoint |\n\t\t\t\t  AllowThousands | AllowExponent | AllowCurrencySymbol),\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/TextInfo.cs",
    "content": "#if !LOCALTEST\n\nusing System.Text;\nusing System.IO;\nnamespace System.Globalization {\n\tpublic class TextInfo {\n\n\t\tprivate int ansiCodePage;\n\t\tprivate int ebcdicCodePage;\n\t\tprivate bool isRightToLeft;\n\t\tprivate string listSeparator;\n\t\tprivate int macCodePage;\n\t\tprivate int oemCodePage;\n\t\tprivate CultureInfo ci;\n\n\t\tinternal TextInfo(CultureInfo ci, StreamReader s) {\n\t\t\tthis.ansiCodePage = int.Parse(s.ReadLine());\n\t\t\tthis.ebcdicCodePage = int.Parse(s.ReadLine());\n\t\t\tthis.isRightToLeft = bool.Parse(s.ReadLine());\n\t\t\tthis.listSeparator = s.ReadLine();\n\t\t\tthis.macCodePage = int.Parse(s.ReadLine());\n\t\t\tthis.oemCodePage = int.Parse(s.ReadLine());\n\t\t\tthis.ci = ci;\n\t\t}\n\n\t\tpublic virtual int ANSICodePage {\n\t\t\tget {\n\t\t\t\treturn this.ansiCodePage;\n\t\t\t}\n\t\t}\n\n\t\tpublic string CultureName {\n\t\t\tget {\n\t\t\t\treturn this.ci.Name;\n\t\t\t}\n\t\t}\n\n\t\tpublic int EBCDICCodePage {\n\t\t\tget {\n\t\t\t\treturn this.ebcdicCodePage;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsReadOnly {\n\t\t\tget {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsRightToLeft {\n\t\t\tget {\n\t\t\t\treturn this.isRightToLeft;\n\t\t\t}\n\t\t}\n\n\t\tpublic int LCID {\n\t\t\tget {\n\t\t\t\treturn this.ci.LCID;\n\t\t\t}\n\t\t}\n\n\t\tpublic string ListSeparator {\n\t\t\tget {\n\t\t\t\treturn this.listSeparator;\n\t\t\t}\n\t\t}\n\n\t\tpublic int MacCodePage {\n\t\t\tget {\n\t\t\t\treturn this.macCodePage;\n\t\t\t}\n\t\t}\n\n\t\tpublic int OEMCodePage {\n\t\t\tget {\n\t\t\t\treturn this.oemCodePage;\n\t\t\t}\n\t\t}\n\n\t\tpublic char ToLower(char c) {\n\t\t\t// For the moment, ignore culture\n\t\t\treturn char.ToLowerInvariant(c);\n\t\t}\n\n\t\tpublic string ToLower(string s) {\n\t\t\t// For the moment, ignore culture\n\t\t\treturn s.ToLowerInvariant();\n\t\t}\n\n\t\tpublic char ToUpper(char c) {\n\t\t\t// For the moment, ignore culture\n\t\t\treturn char.ToUpperInvariant(c);\n\t\t}\n\n\t\tpublic string ToUpper(string s) {\n\t\t\t// For the moment, ignore culture\n\t\t\treturn s.ToUpperInvariant();\n\t\t}\n\n\t\tpublic string ToTitleCase(string str) {\n\t\t\tif (str == null) {\n\t\t\t\tthrow new ArgumentNullException(\"str\");\n\t\t\t}\n\n\t\t\tStringBuilder sb = null;\n\t\t\tint i = 0;\n\t\t\tint start = 0;\n\t\t\twhile (i < str.Length) {\n\t\t\t\tif (!char.IsLetter(str[i++])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ti--;\n\t\t\t\tchar t = ToUpper(str[i]);\n\t\t\t\tbool capitalize = true;\n\t\t\t\tif (t == str[i]) {\n\t\t\t\t\tcapitalize = false;\n\t\t\t\t\tbool allTitle = true;\n\t\t\t\t\t// if the word is all titlecase,\n\t\t\t\t\t// then don't capitalize it.\n\t\t\t\t\tint saved = i;\n\t\t\t\t\twhile (++i < str.Length) {\n\t\t\t\t\t\tif (char.IsWhiteSpace(str[i])) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tt = ToUpper(str[i]);\n\t\t\t\t\t\tif (t != str[i]) {\n\t\t\t\t\t\t\tallTitle = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (allTitle) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\ti = saved;\n\n\t\t\t\t\t// still check if all remaining\n\t\t\t\t\t// characters are lowercase,\n\t\t\t\t\t// where we don't have to modify\n\t\t\t\t\t// the source word.\n\t\t\t\t\twhile (++i < str.Length) {\n\t\t\t\t\t\tif (char.IsWhiteSpace(str[i])) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (ToLower(str[i]) != str[i]) {\n\t\t\t\t\t\t\tcapitalize = true;\n\t\t\t\t\t\t\ti = saved;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (capitalize) {\n\t\t\t\t\tif (sb == null) {\n\t\t\t\t\t\tsb = new StringBuilder(str.Length);\n\t\t\t\t\t}\n\t\t\t\t\tsb.Append(str, start, i - start);\n\t\t\t\t\tsb.Append(ToUpper(str[i]));\n\t\t\t\t\tstart = i + 1;\n\t\t\t\t\twhile (++i < str.Length) {\n\t\t\t\t\t\tif (char.IsWhiteSpace(str[i])) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsb.Append(ToLower(str[i]));\n\t\t\t\t\t}\n\t\t\t\t\tstart = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (sb != null)\n\t\t\t\tsb.Append(str, start, str.Length - start);\n\n\t\t\treturn sb != null ? sb.ToString() : str;\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Globalization/UnicodeCategory.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.Globalization {\n\tpublic enum UnicodeCategory {\n\t\tUppercaseLetter = 0,\n\t\tLowercaseLetter = 1,\n\t\tTitlecaseLetter = 2,\n\t\tModifierLetter = 3,\n\t\tOtherLetter = 4,\n\t\tNonSpacingMark = 5,\n\t\tSpacingCombiningMark = 6,\n\t\tEnclosingMark = 7,\n\t\tDecimalDigitNumber = 8,\n\t\tLetterNumber = 9,\n\t\tOtherNumber = 10,\n\t\tSpaceSeparator = 11,\n\t\tLineSeparator = 12,\n\t\tParagraphSeparator = 13,\n\t\tControl = 14,\n\t\tFormat = 15,\n\t\tSurrogate = 16,\n\t\tPrivateUse = 17,\n\t\tConnectorPunctuation = 18,\n\t\tDashPunctuation = 19,\n\t\tOpenPunctuation = 20,\n\t\tClosePunctuation = 21,\n\t\tInitialQuotePunctuation = 22,\n\t\tFinalQuotePunctuation = 23,\n\t\tOtherPunctuation = 24,\n\t\tMathSymbol = 25,\n\t\tCurrencySymbol = 26,\n\t\tModifierSymbol = 27,\n\t\tOtherSymbol = 28,\n\t\tOtherNotAssigned = 29,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/CheckArgument.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tinternal static class CheckArgument {\n\t\t/// <summary>\n\t\t/// Generates and exception if arg contains whitepace only\n\t\t/// </summary>\n\t\tpublic static void WhitespaceOnly(string arg, string desc) {\n\t\t\tif (arg != null && arg.Length > 0) {\n\t\t\t\tstring temp = arg.Trim();\n\t\t\t\tif (temp.Length == 0) {\n\t\t\t\t\tthrow new ArgumentException(desc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if arg contains whitepace only\n\t\t/// </summary>\n\t\tpublic static void WhitespaceOnly(string arg) {\n\t\t\tWhitespaceOnly(arg, \"Argument string consists of whitespace characters only.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if arg is empty\n\t\t/// </summary>\n\t\tpublic static void Empty(string arg, string desc) {\n\t\t\tif (arg != null && arg.Length == 0) {\n\t\t\t\tthrow new ArgumentException(desc);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if arg is empty\n\t\t/// </summary>\n\t\tpublic static void Empty(string arg) {\n\t\t\tEmpty(arg, \"Argument string is empty.\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if arg is null\n\t\t/// </summary>\n\t\tpublic static void Null(Object arg, string desc) {\n\t\t\tif (arg == null) {\n\t\t\t\tthrow new ArgumentNullException(desc);\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if arg is null\n\t\t/// </summary>\n\t\tpublic static void Null(Object arg) {\n\t\t\tif (arg == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if path contains invalid path characters\n\t\t/// </summary>\n\t\tpublic static void PathChars(string path, string desc) {\n\t\t\tif (path != null) {\n\t\t\t\tif (path.IndexOfAny(System.IO.Path.InvalidPathChars) > -1) {\n\t\t\t\t\tthrow new ArgumentException(desc);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if path contains invalid path characters\n\t\t/// </summary>\n\t\tpublic static void PathChars(string path) {\n\t\t\tPathChars(path, \"Path contains invalid characters\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if path too long\n\t\t/// </summary>\n\t\tpublic static void PathLength(string path, string desc) {\n\t\t\t//TODO: find out how long is too long\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if path too long\n\t\t/// </summary>\n\t\tpublic static void PathLength(string path) {\n\t\t\tPathLength(path, \"Path is too long\");\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if path is illegal\n\t\t/// </summary>\n\t\tpublic static void Path(string path, bool bAllowNull, bool bLength) {\n\t\t\tif (path != null) //allow null\n\t\t\t{\n\t\t\t\tEmpty(path, \"Path cannot be the empty string\");\t// path can't be empty\n\t\t\t\tWhitespaceOnly(path, \"Path cannot be all whitespace\");\t// path can't be all whitespace\n\t\t\t\tPathChars(path);\t// path can't contain invalid characters\n\t\t\t\tif (bLength) {\n\t\t\t\t\tPathLength(\"Path too long\");\n\t\t\t\t}\n\t\t\t} else if (!bAllowNull) {\n\t\t\t\tthrow new ArgumentNullException(\"Parameter name: path\");\n\t\t\t}\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if path is illegal\n\t\t/// </summary>\n\t\tpublic static void Path(string path, bool bAllowNull) {\n\t\t\tPath(path, bAllowNull, false);\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Generates and exception if path is illegal\n\t\t/// </summary>\n\t\tpublic static void Path(string path) {\n\t\t\tPath(path, false, false);\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/Directory.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic static class Directory {\n\n\t\tpublic static string GetCurrentDirectory() {\n\t\t\tint error;\n\t\t\tstring dir = FileInternal.GetCurrentDirectory(out error);\n\t\t\tif (error != 0) {\n\t\t\t\tthrow FileInternal.GetException(error, string.Empty);\n\t\t\t}\n\t\t\treturn dir;\n\t\t}\n\n\t\tpublic static string[] GetFiles(string path) {\n\t\t\treturn GetFiles(path, \"*\");\n\t\t}\n\n\t\tpublic static string[] GetFiles(string path, string pattern) {\n\t\t\treturn GetFileSystemEntries(path, pattern, FileAttributes.Directory, 0);\n\t\t}\n\n\t\tprivate static string[] GetFileSystemEntries(string path, string pattern, FileAttributes mask, FileAttributes attrs) {\n\t\t\tif (path == null || pattern == null)\n\t\t\t\tthrow new ArgumentNullException();\n\n\t\t\tif (pattern == String.Empty)\n\t\t\t\treturn new string[] { };\n\n\t\t\tif (path.Trim() == \"\")\n\t\t\t\tthrow new ArgumentException(\"The Path does not have a valid format\");\n\n\t\t\tstring wild = Path.Combine(path, pattern);\n\t\t\tstring wildpath = Path.GetDirectoryName(wild);\n\t\t\tif (wildpath.IndexOfAny(Path.InvalidPathChars) != -1)\n\t\t\t\tthrow new ArgumentException(\"Path contains invalid characters\");\n\n\t\t\tif (wildpath.IndexOfAny(Path.InvalidPathChars) != -1) {\n\t\t\t\tif (path.IndexOfAny(SearchPattern.InvalidChars) == -1)\n\t\t\t\t\tthrow new ArgumentException(\"Path contains invalid characters\", \"path\");\n\n\t\t\t\tthrow new ArgumentException(\"Pattern contains invalid characters\", \"pattern\");\n\t\t\t}\n\n\t\t\tint error;\n\t\t\tif (!FileInternal.ExistsDirectory(wildpath, out error)) {\n\t\t\t\tif (error == FileInternal.Error_OK) {\n\t\t\t\t\tint file_error;\n\t\t\t\t\tif (FileInternal.ExistsFile(wildpath, out file_error)) {\n\t\t\t\t\t\treturn new string[] { wildpath };\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (error != FileInternal.ERROR_PATH_NOT_FOUND)\n\t\t\t\t\tthrow FileInternal.GetException(error, wildpath);\n\n\t\t\t\tif (wildpath.IndexOfAny(SearchPattern.WildcardChars) == -1)\n\t\t\t\t\tthrow new DirectoryNotFoundException(\"Directory '\" + wildpath + \"' not found.\");\n\n\t\t\t\tif (path.IndexOfAny(SearchPattern.WildcardChars) == -1)\n\t\t\t\t\tthrow new ArgumentException(\"Pattern is invalid\", \"pattern\");\n\n\t\t\t\tthrow new ArgumentException(\"Path is invalid\", \"path\");\n\t\t\t}\n\n\t\t\tstring path_with_pattern = Path.Combine(wildpath, pattern);\n\t\t\tstring[] result = FileInternal.GetFileSystemEntries(path, path_with_pattern, attrs, mask, out error);\n\t\t\tif (error != 0)\n\t\t\t\tthrow FileInternal.GetException(error, wildpath);\n\n\t\t\treturn result;\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/DirectoryInfo.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic class DirectoryInfo : FileSystemInfo {\n\n\t\tprivate string current;\n\t\tprivate string parent;\n\t\t\n\t\tpublic DirectoryInfo(string path) {\n\t\t\tbase.CheckPath(path);\n\n\t\t\tbase.fullPath = Path.GetFullPath(path);\n\t\t\tbase.originalPath = path;\n\n\t\t\tint len = base.fullPath.Length - 1;\n\t\t\tif ((len > 1) && (base.fullPath[len] == Path.DirectorySeparatorChar)) {\n\t\t\t\tlen--;\n\t\t\t}\n\t\t\tint last = base.fullPath.LastIndexOf(Path.DirectorySeparatorChar, len);\n\t\t\tif ((last == -1) || ((last == 0) && (len == 0))) {\n\t\t\t\tcurrent = base.fullPath;\n\t\t\t\tparent = null;\n\t\t\t} else {\n\t\t\t\tcurrent = base.fullPath.Substring(last + 1, len - last);\n\t\t\t\tif (last == 0 && !Environment.IsRunningOnWindows) {\n\t\t\t\t\tparent = Path.DirectorySeparatorStr;\n\t\t\t\t} else {\n\t\t\t\t\tparent = base.fullPath.Substring(0, last);\n\t\t\t\t}\n\t\t\t\t// adjust for drives, i.e. a special case for windows\n\t\t\t\tif (Environment.IsRunningOnWindows) {\n\t\t\t\t\tif ((parent.Length == 2) && (parent[1] == ':') && Char.IsLetter(parent[0])) {\n\t\t\t\t\t\tparent += Path.DirectorySeparatorChar;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool Exists {\n\t\t\tget { throw new Exception(\"The method or operation is not implemented.\"); }\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn this.current;\n\t\t\t}\n\t\t}\n\n\t\tpublic FileInfo[] GetFiles() {\n\t\t\treturn GetFiles(\"*\");\n\t\t}\n\n\t\tpublic FileInfo[] GetFiles(string pattern) {\n\t\t\tstring[] names = Directory.GetFiles(base.fullPath, pattern);\n\n\t\t\tFileInfo[] infos = new FileInfo[names.Length];\n\t\t\tint i = 0;\n\t\t\tforeach (string name in names) {\n\t\t\t\tinfos[i++] = new FileInfo(name);\n\t\t\t}\n\t\t\treturn infos;\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/DirectoryNotFoundException.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic class DirectoryNotFoundException : SystemException {\n\n\t\tpublic DirectoryNotFoundException() : base(\"Directory not found.\") { }\n\t\tpublic DirectoryNotFoundException(string msg) : base(msg) { }\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/File.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic static class File {\n\n\t\tpublic static FileStream OpenRead(string path) {\n\t\t\treturn new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);\n\t\t}\n\n\t\tpublic static StreamReader OpenText(string path) {\n\t\t\treturn new StreamReader(path);\n\t\t}\n\n\t\tpublic static bool Exists(string path) {\n\t\t\tif (string.IsNullOrEmpty(path)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tint error;\n\t\t\treturn FileInternal.ExistsFile(path, out error);\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/FileAccess.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic enum FileAccess : int {\n\t\tRead = 1,\n\t\tWrite = 2,\n\t\tReadWrite = Read | Write,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/FileAttributes.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic enum FileAttributes {\n\t\tArchive = 0x00020,\n\t\tCompressed = 0x00800,\n\t\tDevice = 0x00040, // Reserved for future use (NOT the w32 value). \n\t\tDirectory = 0x00010,\n\t\tEncrypted = 0x04000, // NOT the w32 value\n\t\tHidden = 0x00002,\n\t\tNormal = 0x00080,\n\t\tNotContentIndexed = 0x02000,\n\t\tOffline = 0x01000,\n\t\tReadOnly = 0x00001,\n\t\tReparsePoint = 0x00400,\n\t\tSparseFile = 0x00200,\n\t\tSystem = 0x00004,\n\t\tTemporary = 0x00100\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/FileInfo.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic sealed class FileInfo : FileSystemInfo {\n\n#pragma warning disable 0169\n\t\tprivate bool exists;\n#pragma warning restore 0169\n\n\t\tpublic FileInfo(string path) {\n\t\t\tCheckPath(path);\n\n\t\t\tbase.originalPath = path;\n\t\t\tbase.fullPath = Path.GetFullPath(path);\n\t\t}\n\n\t\tpublic override bool Exists {\n\t\t\tget { throw new Exception(\"The method or operation is not implemented.\"); }\n\t\t}\n\n\t\tpublic override string Name {\n\t\t\tget {\n\t\t\t\treturn Path.GetFileName(base.fullPath);\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/FileInternal.cs",
    "content": "#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nnamespace System.IO {\n\tinternal static class FileInternal {\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static IntPtr Open(string fileName, FileMode mode, FileAccess access, FileShare share, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static int Read(IntPtr handle, byte[] dst, int dstOfs, int count, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static void Close(IntPtr handle, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static string GetCurrentDirectory(out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static FileAttributes GetFileAttributes(string path, out int error);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static string[] GetFileSystemEntries(string path, string pathPattern, FileAttributes attrs, FileAttributes mask, out int error);\n\n\t\tpublic const int Error_OK = 0;\n\t\tpublic const int Error_UnknownMode = -1;\n\t\tpublic const int ERROR_FILE_NOT_FOUND = 2;\n\t\tpublic const int ERROR_PATH_NOT_FOUND = 3;\n\n\t\tpublic static Exception GetException(int error, string path) {\n\t\t\tswitch (error) {\n\t\t\tcase Error_UnknownMode:\n\t\t\t\treturn new IOException(\"Unknown file mode\");\n\t\t\tcase ERROR_FILE_NOT_FOUND:\n\t\t\t\treturn new FileNotFoundException(string.Format(\"Could not find file \\\"{0}\\\"\", path));\n\t\t\tdefault:\n\t\t\t\treturn new IOException();\n\t\t\t}\n\t\t}\n\n\t\tpublic static readonly FileAttributes InvalidFileAttributes = (FileAttributes)(-1);\n\n\t\tpublic static bool ExistsFile(string path, out int error) {\n\t\t\tFileAttributes attrs = GetFileAttributes(path, out error);\n\t\t\tif (attrs == InvalidFileAttributes) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ((attrs & FileAttributes.Directory) != 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tpublic static bool ExistsDirectory(string path, out int error) {\n\t\t\tFileAttributes attrs = GetFileAttributes(path, out error);\n\t\t\t// Actually, we are looking for a directory, not a file\n\t\t\tif (error == FileInternal.ERROR_FILE_NOT_FOUND) {\n\t\t\t\terror = FileInternal.ERROR_PATH_NOT_FOUND;\n\t\t\t}\n\t\t\tif (attrs == InvalidFileAttributes) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ((attrs & FileAttributes.Directory) == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/FileMode.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic enum FileMode : int {\n\t\tCreateNew = 1,\n\t\tCreate = 2,\n\t\tOpen = 3,\n\t\tOpenOrCreate = 4,\n\t\tTruncate = 5,\n\t\tAppend = 6,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/FileNotFoundException.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic class FileNotFoundException : IOException {\n\n\t\tpublic FileNotFoundException(string msg) : base(msg) { }\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/FileShare.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic enum FileShare : int {\n\t\tNone = 0,\n\t\tRead = 1,\n\t\tWrite = 2,\n\t\tReadWrite = 3,\n\t\tDelete = 4,\n\t\tInheritable = 16,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/FileStream.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic class FileStream : Stream {\n\n\t\tprivate IntPtr handle = IntPtr.Zero;\n\t\tprivate string filename;\n\t\tprivate bool canRead, canWrite, canSeek;\n\n\t\tpublic FileStream(string filename, FileMode mode, FileAccess access, FileShare share) {\n\t\t\tint error;\n\t\t\tIntPtr handle = FileInternal.Open(filename, mode, access, share, out error);\n\t\t\tif (error != 0) {\n\t\t\t\tthrow FileInternal.GetException(error, filename);\n\t\t\t}\n\t\t\tthis.handle = handle;\n\t\t\tthis.filename = filename;\n\n\t\t\tthis.canRead = true;\n\t\t\tthis.canWrite = true;\n\t\t\tthis.canSeek = true;\n\t\t}\n\n\t\t~FileStream() {\n\t\t\tthis.Dispose(false);\n\t\t}\n\n\t\tprotected override void Dispose(bool disposing) {\n\t\t\tif (this.handle != IntPtr.Zero) {\n\t\t\t\tint error;\n\t\t\t\tFileInternal.Close(this.handle, out error);\n\t\t\t\tif (disposing && error != 0) {\n\t\t\t\t\t// Throw exception on error, but not if this is being called from destructor\n\t\t\t\t\tthrow FileInternal.GetException(error, this.filename);\n\t\t\t\t}\n\t\t\t\tthis.handle = IntPtr.Zero;\n\t\t\t\t// TODO: GC.UnregisterForFinalize(this);\n\t\t\t}\n\t\t}\n\n\t\tpublic override void Flush() {\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\tpublic override int Read(byte[] buffer, int offset, int count) {\n\t\t\tif (this.handle == IntPtr.Zero) {\n\t\t\t\tthrow new ObjectDisposedException(\"Stream has been closed\");\n\t\t\t}\n\t\t\tif (offset < 0 || count < 0 || offset + count > buffer.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\n\t\t\tint error;\n\t\t\tint ret = FileInternal.Read(this.handle, buffer, offset, count, out error);\n\t\t\tif (error != 0) {\n\t\t\t\tthrow FileInternal.GetException(error, this.filename);\n\t\t\t}\n\t\t\treturn ret;\n\t\t}\n\n\t\tpublic override long Seek(long offset, SeekOrigin origin) {\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\tpublic override void SetLength(long value) {\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\tpublic override void Write(byte[] buffer, int offset, int count) {\n\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t}\n\n\t\tpublic override bool CanRead {\n\t\t\tget {\n\t\t\t\treturn this.canRead;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool CanSeek {\n\t\t\tget {\n\t\t\t\treturn this.canSeek;\n\t\t\t}\n\t\t}\n\n\t\tpublic override bool CanWrite {\n\t\t\tget {\n\t\t\t\treturn this.canWrite;\n\t\t\t}\n\t\t}\n\n\t\tpublic override long Length {\n\t\t\tget { throw new Exception(\"The method or operation is not implemented.\"); }\n\t\t}\n\n\t\tpublic override long Position {\n\t\t\tget {\n\t\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t\t}\n\t\t\tset {\n\t\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t\t}\n\t\t}\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System.IO/FileSystemInfo.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic abstract class FileSystemInfo : MarshalByRefObject {\n\n\t\tprotected string fullPath = null;\n\t\tprotected string originalPath = null;\n\n\t\tinternal void CheckPath(string path) {\n\t\t\tif (path == null)\n\t\t\t\tthrow new ArgumentNullException(\"path\");\n\n\t\t\tif (path.Length == 0)\n\t\t\t\tthrow new ArgumentException(\"path\", \"Empty path.\");\n\n\t\t\tif (path.IndexOfAny(Path.InvalidPathChars) != -1)\n\t\t\t\tthrow new ArgumentException(\"path\", \"Invalid characters in path.\");\n\t\t}\n\n\t\tpublic abstract bool Exists { get; }\n\n\t\tpublic abstract string Name { get; }\n\n\t\tpublic virtual string FullName {\n\t\t\tget {\n\t\t\t\treturn this.fullPath;\n\t\t\t}\n\t\t}\n\n\t\tpublic string Extension {\n\t\t\tget {\n\t\t\t\treturn Path.GetExtension(Name);\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/IOException.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic class IOException : SystemException {\n\n\t\tpublic IOException() : base(\"I/O Error\") { }\n\t\tpublic IOException(string message) : base(message) { }\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/Path.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic static class Path {\n\n\t\t/*\t\tstatic Path() {\n\t\t\t\t\tInvalidPathChars = GetInvalidPathChars();\n\t\t\t\t\tif (Environment.Platform == PlatformID.Unix) {\n\t\t\t\t\t\tAltDirectorySeparatorChar = '/';\n\t\t\t\t\t\tDirectorySeparatorChar = '/';\n\t\t\t\t\t\tPathSeparator = ';';\n\t\t\t\t\t\tVolumeSeparatorChar = '/';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tAltDirectorySeparatorChar = '/';\n\t\t\t\t\t\tDirectorySeparatorChar = '\\\\';\n\t\t\t\t\t\tPathSeparator = ';';\n\t\t\t\t\t\tVolumeSeparatorChar = ':';\n\t\t\t\t\t}\n\t\t\t\t\tDirectorySeparatorStr = DirectorySeparatorChar.ToString();\n\t\t\t\t\tdirEqualsVolume = (DirectorySeparatorChar == VolumeSeparatorChar);\n\t\t\t\t}\n\n\t\t\t\tpublic static readonly char AltDirectorySeparatorChar;\n\t\t\t\tpublic static readonly char DirectorySeparatorChar;\n\t\t\t\tinternal static readonly string DirectorySeparatorStr;\n\t\t\t\tpublic static readonly char[] InvalidPathChars;\n\t\t\t\tpublic static readonly char PathSeparator;\n\t\t\t\tpublic static readonly char VolumeSeparatorChar;\n\t\t\t\tprivate static bool dirEqualsVolume;\n\n\t\t\t\tpublic static char[] GetInvalidPathChars() {\n\t\t\t\t\t// return a new array as we do not want anyone to be able to change the values\n\t\t\t\t\tif (Environment.Platform == PlatformID.Unix) {\n\t\t\t\t\t\treturn new char[] { '\\x00' };\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn new char[] {\n\t\t\t\t\t\t\t'\\x22', '\\x3C', '\\x3E', '\\x7C', '\\x00', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\x07',\n\t\t\t\t\t\t\t'\\x08', '\\x09', '\\x0A', '\\x0B', '\\x0C', '\\x0D', '\\x0E', '\\x0F', '\\x10', '\\x11', '\\x12', \n\t\t\t\t\t\t\t'\\x13', '\\x14', '\\x15', '\\x16', '\\x17', '\\x18', '\\x19', '\\x1A', '\\x1B', '\\x1C', '\\x1D', \n\t\t\t\t\t\t\t'\\x1E', '\\x1F' };\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tprivate static bool IsDsc(char c) {\n\t\t\t\t\treturn c == DirectorySeparatorChar || c == AltDirectorySeparatorChar;\n\t\t\t\t}\n\n\t\t\t\tprivate static string WindowsDriveAdjustment(string path) {\n\t\t\t\t\t// two special cases to consider when a drive is specified\n\t\t\t\t\tif (path.Length < 2) {\n\t\t\t\t\t\treturn path;\n\t\t\t\t\t}\n\t\t\t\t\tif ((path[1] != ':') || !Char.IsLetter(path[0])) {\n\t\t\t\t\t\treturn path;\n\t\t\t\t\t}\n\t\t\t\t\tstring current = Directory.GetCurrentDirectory();\n\t\t\t\t\t// first, only the drive is specified\n\t\t\t\t\tif (path.Length == 2) {\n\t\t\t\t\t\t// then if the current directory is on the same drive\n\t\t\t\t\t\tif (current[0] == path[0]) {\n\t\t\t\t\t\t\tpath = current; // we return it\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpath += '\\\\';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if ((path[2] != Path.DirectorySeparatorChar) && (path[2] != Path.AltDirectorySeparatorChar)) {\n\t\t\t\t\t\t// second, the drive + a directory is specified *without* a separator between them (e.g. C:dir).\n\t\t\t\t\t\t// If the current directory is on the specified drive...\n\t\t\t\t\t\tif (current[0] == path[0]) {\n\t\t\t\t\t\t\t// then specified directory is appended to the current drive directory\n\t\t\t\t\t\t\tpath = Path.Combine(current, path.Substring(2, path.Length - 2));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// if not, then just pretend there was a separator (Path.Combine won't work in this case)\n\t\t\t\t\t\t\tpath = String.Concat(path.Substring(0, 2), DirectorySeparatorStr, path.Substring(2, path.Length - 2));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn path;\n\t\t\t\t}\n\n\t\t\t\tpublic static bool IsPathRooted(string path) {\n\t\t\t\t\tif (path == null || path.Length == 0) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tif (path.IndexOfAny(InvalidPathChars) != -1) {\n\t\t\t\t\t\tthrow new ArgumentException(\"Illegal characters in path\", \"path\");\n\t\t\t\t\t}\n\t\t\t\t\tchar c = path[0];\n\t\t\t\t\treturn (c == DirectorySeparatorChar ||\n\t\t\t\t\t\tc == AltDirectorySeparatorChar ||\n\t\t\t\t\t\t(!dirEqualsVolume && path.Length > 1 && path[1] == VolumeSeparatorChar));\n\t\t\t\t}\n\n\t\t\t\tstatic string CanonicalizePath(string path) {\n\t\t\t\t\t// STEP 1: Check for empty string\n\t\t\t\t\tif (path == null) {\n\t\t\t\t\t\treturn path;\n\t\t\t\t\t}\n\t\t\t\t\tif (Environment.IsRunningOnWindows) {\n\t\t\t\t\t\tpath = path.Trim();\n\t\t\t\t\t}\n\t\t\t\t\tif (path.Length == 0) {\n\t\t\t\t\t\treturn path;\n\t\t\t\t\t}\n\t\t\t\t\t// STEP 2: Check to see if this is only a root\n\t\t\t\t\tstring root = Path.GetPathRoot(path);\n\t\t\t\t\t// it will return '\\' for path '\\', while it should return 'c:\\' or so.\n\t\t\t\t\t// Note: commenting this out makes the ened for the (target == 1...) check in step 5\n\t\t\t\t\t//if (root == path) return path;\n\n\t\t\t\t\t// STEP 3: split the directories, this gets rid of consecutative \"/\"'s\n\t\t\t\t\tstring[] dirs = path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);\n\t\t\t\t\t// STEP 4: Get rid of directories containing . and ..\n\t\t\t\t\tint target = 0;\n\n\t\t\t\t\tfor (int i = 0; i < dirs.Length; i++) {\n\t\t\t\t\t\tif (dirs[i] == \".\" || (i != 0 && dirs[i].Length == 0)) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t} else if (dirs[i] == \"..\") {\n\t\t\t\t\t\t\tif (target != 0) {\n\t\t\t\t\t\t\t\ttarget--;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdirs[target++] = dirs[i];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// STEP 5: Combine everything.\n\t\t\t\t\tif (target == 0 || (target == 1 && dirs[0] == \"\")) {\n\t\t\t\t\t\treturn root;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstring ret = String.Join(DirectorySeparatorStr, dirs, 0, target);\n\t\t\t\t\t\tif (Environment.IsRunningOnWindows) {\n\t\t\t\t\t\t\tif (!SameRoot(root, ret)) {\n\t\t\t\t\t\t\t\tret = root + ret;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// In GetFullPath(), it is assured that here never comes UNC. So this must only applied to such path that starts with '\\', without drive specification.\n\t\t\t\t\t\t\tif (!IsDsc(path[0]) && SameRoot(root, path)) {\n\t\t\t\t\t\t\t\tif (ret.Length <= 2 && !ret.EndsWith(DirectorySeparatorStr)) { // '\\' after \"c:\"\n\t\t\t\t\t\t\t\t\tret += Path.DirectorySeparatorChar;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn ret;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tstring current = Directory.GetCurrentDirectory();\n\t\t\t\t\t\t\t\tif (current.Length > 1 && current[1] == Path.VolumeSeparatorChar) {\n\t\t\t\t\t\t\t\t\t// DOS local file path\n\t\t\t\t\t\t\t\t\tif (ret.Length == 0 || IsDsc(ret[0])) {\n\t\t\t\t\t\t\t\t\t\tret += '\\\\';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn current.Substring(0, 2) + ret;\n\t\t\t\t\t\t\t\t} else if (IsDsc(current[current.Length - 1]) && IsDsc(ret[0])) {\n\t\t\t\t\t\t\t\t\treturn current + ret.Substring(1);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\treturn current + ret;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tpublic static string GetFullPath(string path) {\n\t\t\t\t\tif (path == null) {\n\t\t\t\t\t\tthrow new ArgumentNullException(\"path\");\n\t\t\t\t\t}\n\t\t\t\t\tif (path.Trim().Length == 0) {\n\t\t\t\t\t\tstring msg = \"The specified path is not of a legal form (empty).\";\n\t\t\t\t\t\tthrow new ArgumentException(msg, \"path\");\n\t\t\t\t\t}\n\n\t\t\t\t\t// adjust for drives, i.e. a special case for windows\n\t\t\t\t\tif (Environment.IsRunningOnWindows) {\n\t\t\t\t\t\tpath = WindowsDriveAdjustment(path);\n\t\t\t\t\t}\n\t\t\t\t\t// if the supplied path ends with a separator...\n\t\t\t\t\tchar end = path[path.Length - 1];\n\n\t\t\t\t\tif (path.Length >= 2 && IsDsc(path[0]) && IsDsc(path[1])) {\n\t\t\t\t\t\tif (path.Length == 2 || path.IndexOf(path[0], 2) < 0) {\n\t\t\t\t\t\t\tthrow new ArgumentException(\"UNC pass should be of the form \\\\\\\\server\\\\share.\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (path[0] != DirectorySeparatorChar) {\n\t\t\t\t\t\t\tpath = path.Replace(AltDirectorySeparatorChar, DirectorySeparatorChar);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (!IsPathRooted(path)) {\n\t\t\t\t\t\t\tpath = Directory.GetCurrentDirectory() + DirectorySeparatorStr + path;\n\t\t\t\t\t\t} else if (DirectorySeparatorChar == '\\\\' && path.Length >= 2 && IsDsc(path[0]) && !IsDsc(path[1])) { // like `\\abc\\def'\n\t\t\t\t\t\t\tstring current = Directory.GetCurrentDirectory();\n\t\t\t\t\t\t\tif (current[1] == VolumeSeparatorChar) {\n\t\t\t\t\t\t\t\tpath = current.Substring(0, 2) + path;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tpath = current.Substring(0, current.IndexOf('\\\\', current.IndexOf(\"\\\\\\\\\") + 1));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpath = CanonicalizePath(path);\n\t\t\t\t\t}\n\n\t\t\t\t\t// if the original ended with a [Alt]DirectorySeparatorChar then ensure the full path also ends with one\n\t\t\t\t\tif (IsDsc(end) && (path[path.Length - 1] != DirectorySeparatorChar)) {\n\t\t\t\t\t\tpath += DirectorySeparatorChar;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn path;\n\t\t\t\t}*/\n\n\t\tpublic static readonly char[] InvalidPathChars;\n\t\tpublic static readonly char AltDirectorySeparatorChar;\n\t\tpublic static readonly char DirectorySeparatorChar;\n\t\tpublic static readonly char PathSeparator;\n\t\tinternal static readonly string DirectorySeparatorStr;\n\t\tpublic static readonly char VolumeSeparatorChar;\n\n\t\tprivate static readonly char[] PathSeparatorChars;\n\t\tprivate static readonly bool dirEqualsVolume;\n\n\t\t// class methods\n\t\tpublic static string ChangeExtension(string path, string extension) {\n\t\t\tif (path == null)\n\t\t\t\treturn null;\n\n\t\t\tif (path.IndexOfAny(InvalidPathChars) != -1)\n\t\t\t\tthrow new ArgumentException(\"Illegal characters in path\", \"path\");\n\n\t\t\tint iExt = findExtension(path);\n\n\t\t\tif (extension == null)\n\t\t\t\treturn iExt < 0 ? path : path.Substring(0, iExt);\n\t\t\telse if (extension == String.Empty)\n\t\t\t\treturn iExt < 0 ? path + '.' : path.Substring(0, iExt + 1);\n\n\t\t\telse if (path.Length != 0) {\n\t\t\t\tif (extension.Length > 0 && extension[0] != '.')\n\t\t\t\t\textension = \".\" + extension;\n\t\t\t} else\n\t\t\t\textension = String.Empty;\n\n\t\t\tif (iExt < 0) {\n\t\t\t\treturn path + extension;\n\t\t\t} else if (iExt > 0) {\n\t\t\t\tstring temp = path.Substring(0, iExt);\n\t\t\t\treturn temp + extension;\n\t\t\t}\n\n\t\t\treturn extension;\n\t\t}\n\n\t\tpublic static string Combine(string path1, string path2) {\n\t\t\tif (path1 == null)\n\t\t\t\tthrow new ArgumentNullException(\"path1\");\n\n\t\t\tif (path2 == null)\n\t\t\t\tthrow new ArgumentNullException(\"path2\");\n\n\t\t\tif (path1 == String.Empty)\n\t\t\t\treturn path2;\n\n\t\t\tif (path2 == String.Empty)\n\t\t\t\treturn path1;\n\n\t\t\tif (path1.IndexOfAny(InvalidPathChars) != -1)\n\t\t\t\tthrow new ArgumentException(\"Illegal characters in path\", \"path1\");\n\n\t\t\tif (path2.IndexOfAny(InvalidPathChars) != -1)\n\t\t\t\tthrow new ArgumentException(\"Illegal characters in path\", \"path2\");\n\n\t\t\t//TODO???: UNC names\n\t\t\t// LAMESPEC: MS says that if path1 is not empty and path2 is a full path\n\t\t\t// it should throw ArgumentException\n\t\t\tif (IsPathRooted(path2))\n\t\t\t\treturn path2;\n\n\t\t\tchar p1end = path1[path1.Length - 1];\n\t\t\tif (p1end != DirectorySeparatorChar && p1end != AltDirectorySeparatorChar && p1end != VolumeSeparatorChar)\n\t\t\t\treturn path1 + DirectorySeparatorChar + path2;\n\n\t\t\treturn path1 + path2;\n\t\t}\n\n\t\tpublic static string GetDirectoryName(string path) {\n\t\t\t// LAMESPEC: For empty string MS docs say both\n\t\t\t// return null AND throw exception.  Seems .NET throws.\n\t\t\tif (path == String.Empty) {\n\t\t\t\tthrow new ArgumentException();\n\t\t\t}\n\t\t\tif (path == null || GetPathRoot(path) == path) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tCheckArgument.WhitespaceOnly(path);\n\t\t\tCheckArgument.PathChars(path);\n\n\t\t\tint nLast = path.LastIndexOfAny(PathSeparatorChars);\n\t\t\tif (nLast == 0) {\n\t\t\t\tnLast++;\n\t\t\t}\n\t\t\tif (nLast > 0) {\n\t\t\t\tstring ret = path.Substring(0, nLast);\n\t\t\t\tint l = ret.Length;\n\t\t\t\tif (l >= 2 && ret[l - 1] == VolumeSeparatorChar) {\n\t\t\t\t\treturn ret + DirectorySeparatorChar;\n\t\t\t\t} else {\n\t\t\t\t\treturn ret;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn String.Empty;\n\t\t}\n\n\t\tpublic static string GetExtension(string path) {\n\t\t\tif (path == null) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (path.IndexOfAny(InvalidPathChars) != -1) {\n\t\t\t\tthrow new ArgumentException(\"Illegal characters in path\", \"path\");\n\t\t\t}\n\t\t\tint iExt = findExtension(path);\n\n\t\t\tif (iExt > -1) {\n\t\t\t\tif (iExt < path.Length - 1) {\n\t\t\t\t\treturn path.Substring(iExt);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn string.Empty;\n\t\t}\n\n\t\tpublic static string GetFileName(string path) {\n\t\t\tif (path == null || path == String.Empty) {\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tif (path.IndexOfAny(InvalidPathChars) != -1) {\n\t\t\t\tthrow new ArgumentException(\"Illegal characters in path\", \"path\");\n\t\t\t}\n\t\t\tint nLast = path.LastIndexOfAny(PathSeparatorChars);\n\t\t\tif (nLast >= 0) {\n\t\t\t\treturn path.Substring(nLast + 1);\n\t\t\t}\n\t\t\treturn path;\n\t\t}\n\n\t\tpublic static string GetFileNameWithoutExtension(string path) {\n\t\t\treturn ChangeExtension(GetFileName(path), null);\n\t\t}\n\n\t\tpublic static string GetFullPath(string path) {\n\t\t\tstring fullpath = InsecureGetFullPath(path);\n\t\t\treturn fullpath;\n\t\t}\n\n\t\tinternal static string WindowsDriveAdjustment(string path) {\n\t\t\t// two special cases to consider when a drive is specified\n\t\t\tif (path.Length < 2) {\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tif ((path[1] != ':') || !Char.IsLetter(path[0])) {\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tstring current = Directory.GetCurrentDirectory();\n\t\t\t// first, only the drive is specified\n\t\t\tif (path.Length == 2) {\n\t\t\t\t// then if the current directory is on the same drive\n\t\t\t\tif (current[0] == path[0]) {\n\t\t\t\t\tpath = current; // we return it\n\t\t\t\t} else {\n\t\t\t\t\tpath += '\\\\';\n\t\t\t\t}\n\t\t\t} else if ((path[2] != Path.DirectorySeparatorChar) && (path[2] != Path.AltDirectorySeparatorChar)) {\n\t\t\t\t// second, the drive + a directory is specified *without* a separator between them (e.g. C:dir).\n\t\t\t\t// If the current directory is on the specified drive...\n\t\t\t\tif (current[0] == path[0]) {\n\t\t\t\t\t// then specified directory is appended to the current drive directory\n\t\t\t\t\tpath = Path.Combine(current, path.Substring(2, path.Length - 2));\n\t\t\t\t} else {\n\t\t\t\t\t// if not, then just pretend there was a separator (Path.Combine won't work in this case)\n\t\t\t\t\tpath = String.Concat(path.Substring(0, 2), DirectorySeparatorStr, path.Substring(2, path.Length - 2));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn path;\n\t\t}\n\n\t\t// insecure - do not call directly\n\t\tinternal static string InsecureGetFullPath(string path) {\n\t\t\tif (path == null) {\n\t\t\t\tthrow new ArgumentNullException(\"path\");\n\t\t\t}\n\t\t\tif (path.Trim().Length == 0) {\n\t\t\t\tstring msg = \"The specified path is not of a legal form (empty).\";\n\t\t\t\tthrow new ArgumentException(msg, \"path\");\n\t\t\t}\n\n\t\t\t// adjust for drives, i.e. a special case for windows\n\t\t\tif (Environment.IsRunningOnWindows) {\n\t\t\t\tpath = WindowsDriveAdjustment(path);\n\t\t\t}\n\t\t\t// if the supplied path ends with a separator...\n\t\t\tchar end = path[path.Length - 1];\n\n\t\t\tif (path.Length >= 2 &&\n\t\t\t\tIsDsc(path[0]) &&\n\t\t\t\tIsDsc(path[1])) {\n\t\t\t\tif (path.Length == 2 || path.IndexOf(path[0], 2) < 0) {\n\t\t\t\t\tthrow new ArgumentException(\"UNC pass should be of the form \\\\\\\\server\\\\share.\");\n\t\t\t\t}\n\t\t\t\tif (path[0] != DirectorySeparatorChar) {\n\t\t\t\t\tpath = path.Replace(AltDirectorySeparatorChar, DirectorySeparatorChar);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!IsPathRooted(path)) {\n\t\t\t\t\tpath = Directory.GetCurrentDirectory() + DirectorySeparatorStr + path;\n\t\t\t\t} else if (DirectorySeparatorChar == '\\\\' &&\n\t\t\t\t\tpath.Length >= 2 &&\n\t\t\t\t\tIsDsc(path[0]) &&\n\t\t\t\t\t!IsDsc(path[1])) { // like `\\abc\\def'\n\t\t\t\t\tstring current = Directory.GetCurrentDirectory();\n\t\t\t\t\tif (current[1] == VolumeSeparatorChar) {\n\t\t\t\t\t\tpath = current.Substring(0, 2) + path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpath = current.Substring(0, current.IndexOf('\\\\', current.IndexOf(\"\\\\\\\\\") + 1));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tpath = CanonicalizePath(path);\n\t\t\t}\n\n\t\t\t// if the original ended with a [Alt]DirectorySeparatorChar then ensure the full path also ends with one\n\t\t\tif (IsDsc(end) && (path[path.Length - 1] != DirectorySeparatorChar)) {\n\t\t\t\tpath += DirectorySeparatorChar;\n\t\t\t}\n\n\t\t\treturn path;\n\t\t}\n\n\t\tstatic bool IsDsc(char c) {\n\t\t\treturn c == DirectorySeparatorChar || c == AltDirectorySeparatorChar;\n\t\t}\n\n\t\tpublic static string GetPathRoot(string path) {\n\t\t\tif (path == null)\n\t\t\t\treturn null;\n\n\t\t\tif (path == String.Empty)\n\t\t\t\tthrow new ArgumentException(\"This specified path is invalid.\");\n\n\t\t\tif (!IsPathRooted(path))\n\t\t\t\treturn String.Empty;\n\n\t\t\tif (DirectorySeparatorChar == '/') {\n\t\t\t\t// UNIX\n\t\t\t\treturn IsDsc(path[0]) ? DirectorySeparatorStr : String.Empty;\n\t\t\t} else {\n\t\t\t\t// Windows\n\t\t\t\tint len = 2;\n\n\t\t\t\tif (path.Length == 1 && IsDsc(path[0]))\n\t\t\t\t\treturn DirectorySeparatorStr;\n\t\t\t\telse if (path.Length < 2)\n\t\t\t\t\treturn String.Empty;\n\n\t\t\t\tif (IsDsc(path[0]) && IsDsc(path[1])) {\n\t\t\t\t\t// UNC: \\\\server or \\\\server\\share\n\t\t\t\t\t// Get server\n\t\t\t\t\twhile (len < path.Length && !IsDsc(path[len])) len++;\n\n\t\t\t\t\t// Get share\n\t\t\t\t\tif (len < path.Length) {\n\t\t\t\t\t\tlen++;\n\t\t\t\t\t\twhile (len < path.Length && !IsDsc(path[len])) len++;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn DirectorySeparatorStr +\n\t\t\t\t\t\tDirectorySeparatorStr +\n\t\t\t\t\t\tpath.Substring(2, len - 2).Replace(AltDirectorySeparatorChar, DirectorySeparatorChar);\n\t\t\t\t} else if (IsDsc(path[0])) {\n\t\t\t\t\t// path starts with '\\' or '/'\n\t\t\t\t\treturn DirectorySeparatorStr;\n\t\t\t\t} else if (path[1] == VolumeSeparatorChar) {\n\t\t\t\t\t// C:\\folder\n\t\t\t\t\tif (path.Length >= 3 && (IsDsc(path[2]))) len++;\n\t\t\t\t} else\n\t\t\t\t\treturn Directory.GetCurrentDirectory().Substring(0, 2);// + path.Substring (0, len);\n\t\t\t\treturn path.Substring(0, len);\n\t\t\t}\n\t\t}\n\n\t\tpublic static string GetTempFileName() {\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\n\t\t/*public static string GetTempPath() {\n\t\t\tstring p = get_temp_path();\n\t\t\tif (p.Length > 0 && p[p.Length - 1] != DirectorySeparatorChar)\n\t\t\t\treturn p + DirectorySeparatorChar;\n\n\t\t\treturn p;\n\t\t}\n\n\t\t//private static extern string get_temp_path();\n\t\t*/\n\n\t\tpublic static bool HasExtension(string path) {\n\t\t\tif (path == null || path.Trim() == String.Empty)\n\t\t\t\treturn false;\n\n\t\t\tint pos = findExtension(path);\n\t\t\treturn 0 <= pos && pos < path.Length - 1;\n\t\t}\n\n\t\tpublic static bool IsPathRooted(string path) {\n\t\t\tif (path == null || path.Length == 0)\n\t\t\t\treturn false;\n\n\t\t\tif (path.IndexOfAny(InvalidPathChars) != -1)\n\t\t\t\tthrow new ArgumentException(\"Illegal characters in path\", \"path\");\n\n\t\t\tchar c = path[0];\n\t\t\treturn (c == DirectorySeparatorChar ||\n\t\t\t\tc == AltDirectorySeparatorChar ||\n\t\t\t\t(!dirEqualsVolume && path.Length > 1 && path[1] == VolumeSeparatorChar));\n\t\t}\n\n\t\tpublic static char[] GetInvalidFileNameChars ()\n\t\t{\n\t\t\t// return a new array as we do not want anyone to be able to change the values\n\t\t\tif (Environment.IsRunningOnWindows) {\n\t\t\t\treturn new char [41] { '\\x00', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\x07',\n\t\t\t\t\t'\\x08', '\\x09', '\\x0A', '\\x0B', '\\x0C', '\\x0D', '\\x0E', '\\x0F', '\\x10', '\\x11', '\\x12', \n\t\t\t\t\t'\\x13', '\\x14', '\\x15', '\\x16', '\\x17', '\\x18', '\\x19', '\\x1A', '\\x1B', '\\x1C', '\\x1D', \n\t\t\t\t\t'\\x1E', '\\x1F', '\\x22', '\\x3C', '\\x3E', '\\x7C', ':', '*', '?', '\\\\', '/' };\n\t\t\t} else {\n\t\t\t\treturn new char [2] { '\\x00', '/' };\n\t\t\t}\n\t\t}\n\n\t\tpublic static char[] GetInvalidPathChars ()\n\t\t{\n\t\t\t// return a new array as we do not want anyone to be able to change the values\n\t\t\tif (Environment.IsRunningOnWindows) {\n\t\t\t\treturn new char [36] { '\\x22', '\\x3C', '\\x3E', '\\x7C', '\\x00', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\x07',\n\t\t\t\t\t'\\x08', '\\x09', '\\x0A', '\\x0B', '\\x0C', '\\x0D', '\\x0E', '\\x0F', '\\x10', '\\x11', '\\x12', \n\t\t\t\t\t'\\x13', '\\x14', '\\x15', '\\x16', '\\x17', '\\x18', '\\x19', '\\x1A', '\\x1B', '\\x1C', '\\x1D', \n\t\t\t\t\t'\\x1E', '\\x1F' };\n\t\t\t} else {\n\t\t\t\treturn new char [1] { '\\x00' };\n\t\t\t}\n\t\t}\n\n\t\tpublic static string GetRandomFileName ()\n\t\t{\n\t\t\tthrow new NotImplementedException();\n\t\t}\n\t\t// private class methods\n\n\t\tprivate static int findExtension(string path) {\n\t\t\t// method should return the index of the path extension\n\t\t\t// start or -1 if no valid extension\n\t\t\tif (path != null) {\n\t\t\t\tint iLastDot = path.LastIndexOf('.');\n\t\t\t\tint iLastSep = path.LastIndexOfAny(PathSeparatorChars);\n\n\t\t\t\tif (iLastDot > iLastSep)\n\t\t\t\t\treturn iLastDot;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\n\t\tstatic Path() {\n\t\t\tif (Environment.Platform == PlatformID.Unix) {\n\t\t\t\tAltDirectorySeparatorChar = '/';\n\t\t\t\tDirectorySeparatorChar = '/';\n\t\t\t\tPathSeparator = ';';\n\t\t\t\tVolumeSeparatorChar = '/';\n\t\t\t} else {\n\t\t\t\tAltDirectorySeparatorChar = '/';\n\t\t\t\tDirectorySeparatorChar = '\\\\';\n\t\t\t\tPathSeparator = ';';\n\t\t\t\tVolumeSeparatorChar = ':';\n\t\t\t}\n\n\t\t\t// this copy will be modifiable (\"by design\")\n\t\t\tInvalidPathChars = GetInvalidPathChars ();\n\n\t\t\t// internal fields\n\t\t\tDirectorySeparatorStr = DirectorySeparatorChar.ToString();\n\t\t\tPathSeparatorChars = new char[] {\n\t\t\t\tDirectorySeparatorChar,\n\t\t\t\tAltDirectorySeparatorChar,\n\t\t\t\tVolumeSeparatorChar\n\t\t\t};\n\n\t\t\tdirEqualsVolume = (DirectorySeparatorChar == VolumeSeparatorChar);\n\t\t}\n\n\t\tstatic bool SameRoot(string root, string path) {\n\t\t\t// compare root - if enough details are available\n\t\t\tif ((root.Length < 2) || (path.Length < 2))\n\t\t\t\treturn false;\n\t\t\t// same volume/drive\n\t\t\tif (!root[0].Equals(path[0]))\n\t\t\t\treturn false;\n\t\t\t// presence if the separator\n\t\t\tif (path[1] != Path.VolumeSeparatorChar)\n\t\t\t\treturn false;\n\t\t\tif ((root.Length > 2) && (path.Length > 2)) {\n\t\t\t\t// but don't directory compare the directory separator\n\t\t\t\treturn (IsDsc(root[2]) && IsDsc(path[2]));\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tstatic string CanonicalizePath(string path) {\n\t\t\t// STEP 1: Check for empty string\n\t\t\tif (path == null)\n\t\t\t\treturn path;\n\t\t\tif (Environment.IsRunningOnWindows)\n\t\t\t\tpath = path.Trim();\n\n\t\t\tif (path.Length == 0)\n\t\t\t\treturn path;\n\n\t\t\t// STEP 2: Check to see if this is only a root\n\t\t\tstring root = Path.GetPathRoot(path);\n\t\t\t// it will return '\\' for path '\\', while it should return 'c:\\' or so.\n\t\t\t// Note: commenting this out makes the ened for the (target == 1...) check in step 5\n\t\t\t//if (root == path) return path;\n\n\t\t\t// STEP 3: split the directories, this gets rid of consecutative \"/\"'s\n\t\t\tstring[] dirs = path.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);\n\t\t\t// STEP 4: Get rid of directories containing . and ..\n\t\t\tint target = 0;\n\n\t\t\tfor (int i = 0; i < dirs.Length; i++) {\n\t\t\t\tif (dirs[i] == \".\" || (i != 0 && dirs[i].Length == 0))\n\t\t\t\t\tcontinue;\n\t\t\t\telse if (dirs[i] == \"..\") {\n\t\t\t\t\tif (target != 0)\n\t\t\t\t\t\ttarget--;\n\t\t\t\t} else\n\t\t\t\t\tdirs[target++] = dirs[i];\n\t\t\t}\n\n\t\t\t// STEP 5: Combine everything.\n\t\t\tif (target == 0 || (target == 1 && dirs[0] == \"\"))\n\t\t\t\treturn root;\n\t\t\telse {\n\t\t\t\tstring ret = String.Join(DirectorySeparatorStr, dirs, 0, target);\n\t\t\t\tif (Environment.IsRunningOnWindows) {\n\t\t\t\t\tif (!SameRoot(root, ret))\n\t\t\t\t\t\tret = root + ret;\n\t\t\t\t\t// In GetFullPath(), it is assured that here never comes UNC. So this must only applied to such path that starts with '\\', without drive specification.\n\t\t\t\t\tif (!IsDsc(path[0]) && SameRoot(root, path)) {\n\t\t\t\t\t\tif (ret.Length <= 2 && !ret.EndsWith(DirectorySeparatorStr)) // '\\' after \"c:\"\n\t\t\t\t\t\t\tret += Path.DirectorySeparatorChar;\n\t\t\t\t\t\treturn ret;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstring current = Directory.GetCurrentDirectory();\n\t\t\t\t\t\tif (current.Length > 1 && current[1] == Path.VolumeSeparatorChar) {\n\t\t\t\t\t\t\t// DOS local file path\n\t\t\t\t\t\t\tif (ret.Length == 0 || IsDsc(ret[0]))\n\t\t\t\t\t\t\t\tret += '\\\\';\n\t\t\t\t\t\t\treturn current.Substring(0, 2) + ret;\n\t\t\t\t\t\t} else if (IsDsc(current[current.Length - 1]) && IsDsc(ret[0]))\n\t\t\t\t\t\t\treturn current + ret.Substring(1);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\treturn current + ret;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn ret;\n\t\t\t}\n\t\t}\n\n\t\t// required for FileIOPermission (and most proibably reusable elsewhere too)\n\t\t// both path MUST be \"full paths\"\n\t\tstatic internal bool IsPathSubsetOf(string subset, string path) {\n\t\t\tif (subset.Length > path.Length)\n\t\t\t\treturn false;\n\n\t\t\t// check that everything up to the last separator match\n\t\t\tint slast = subset.LastIndexOfAny(PathSeparatorChars);\n\t\t\tif (String.Compare(subset, 0, path, 0, slast) != 0)\n\t\t\t\treturn false;\n\n\t\t\tslast++;\n\t\t\t// then check if the last segment is identical\n\t\t\tint plast = path.IndexOfAny(PathSeparatorChars, slast);\n\t\t\tif (plast >= slast) {\n\t\t\t\treturn String.Compare(subset, slast, path, slast, path.Length - plast) == 0;\n\t\t\t}\n\t\t\tif (subset.Length != path.Length)\n\t\t\t\treturn false;\n\n\t\t\treturn String.Compare(subset, slast, path, slast, subset.Length - slast) == 0;\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/SearchPattern.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tinternal class SearchPattern {\n\n\t\tinternal static readonly char[] WildcardChars = { '*', '?' };\n\t\tinternal static readonly char[] InvalidChars = { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar };\n\t\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/SeekOrigin.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.IO {\n\tpublic enum SeekOrigin : int {\n\t\tBegin = 0,\n\t\tCurrent = 1,\n\t\tEnd = 2,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/Stream.cs",
    "content": "#if !LOCALTEST\n\nusing System.Runtime.InteropServices;\nnamespace System.IO {\n\tpublic abstract class Stream : MarshalByRefObject, IDisposable {\n\n\t\tpublic static readonly Stream Null = new NullStream();\n\n\t\tprivate class NullStream : Stream {\n\t\t\tpublic override bool CanRead { get { return true; } }\n\t\t\tpublic override bool CanSeek { get { return true; } }\n\t\t\tpublic override bool CanWrite { get { return true; } }\n\t\t\tpublic override long Length { get { return 0; } }\n\t\t\tpublic override long Position { get { return 0; } set { } }\n\t\t\tpublic override void Flush() { }\n\t\t\tpublic override int Read(byte[] buffer, int offset, int count) { return 0; }\n\t\t\tpublic override int ReadByte() { return -1; }\n\t\t\tpublic override long Seek(long offset, SeekOrigin origin) { return 0; }\n\t\t\tpublic override void Write(byte[] buffer, int offset, int count) { }\n\t\t\tpublic override void WriteByte(byte value) { }\n\t\t\tpublic override void SetLength(long value) { }\n\t\t}\n\n\t\tprotected Stream() {\n\t\t}\n\n\t\tpublic abstract bool CanRead { get; }\n\t\tpublic abstract bool CanSeek { get; }\n\t\tpublic abstract bool CanWrite { get; }\n\t\tpublic abstract long Length { get; }\n\t\tpublic abstract long Position { get; set; }\n\n\t\tpublic virtual bool CanTimeout {\n\t\t\tget {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tpublic void Dispose() {\n\t\t\tClose();\n\t\t}\n\n\t\tvoid IDisposable.Dispose() {\n\t\t\tClose();\n\t\t}\n\n\t\tpublic virtual void Close() {\n\t\t\tDispose(true);\n\t\t}\n\n\t\tprotected virtual void Dispose(bool disposing) {\n\t\t\t// nothing.\n\t\t}\n\n\t\tpublic abstract void Flush();\n\n\t\tpublic abstract int Read([In, Out] byte[] buffer, int offset, int count);\n\n\t\tpublic virtual int ReadByte() {\n\t\t\tbyte[] buffer = new byte[1];\n\n\t\t\tif (Read(buffer, 0, 1) == 1)\n\t\t\t\treturn buffer[0];\n\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic abstract long Seek(long offset, SeekOrigin origin);\n\n\t\tpublic abstract void SetLength(long value);\n\n\t\tpublic abstract void Write(byte[] buffer, int offset, int count);\n\n\t\tpublic virtual void WriteByte(byte value) {\n\t\t\tbyte[] buffer = new byte[1];\n\n\t\t\tbuffer[0] = value;\n\n\t\t\tWrite(buffer, 0, 1);\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/StreamReader.cs",
    "content": "#if !LOCALTEST\n\nusing System;\nusing System.Text;\nusing System.Runtime.InteropServices;\n\nnamespace System.IO {\n\tpublic class StreamReader : TextReader {\n\n\t\tconst int DefaultBufferSize = 1024;\n\t\tconst int DefaultFileBufferSize = 4096;\n\t\tconst int MinimumBufferSize = 128;\n\n\t\t//\n\t\t// The input buffer\n\t\t//\n\t\tbyte[] input_buffer;\n\n\t\t//\n\t\t// The decoded buffer from the above input buffer\n\t\t//\n\t\tchar[] decoded_buffer;\n\n\t\t//\n\t\t// Decoded bytes in decoded_buffer.\n\t\t//\n\t\tint decoded_count;\n\n\t\t//\n\t\t// Current position in the decoded_buffer\n\t\t//\n\t\tint pos;\n\n\t\t//\n\t\t// The buffer size that we are using\n\t\t//\n\t\tint buffer_size;\n\n\t\tint do_checks;\n\n\t\tEncoding encoding;\n\t\tDecoder decoder;\n\n\t\tStream base_stream;\n\t\tbool mayBlock;\n\t\tStringBuilder line_builder;\n\n\t\tprivate class NullStreamReader : StreamReader {\n\t\t\tpublic override int Peek() {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tpublic override int Read() {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\tpublic override int Read([In, Out] char[] buffer, int index, int count) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tpublic override string ReadLine() {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tpublic override string ReadToEnd() {\n\t\t\t\treturn String.Empty;\n\t\t\t}\n\n\t\t\tpublic override Stream BaseStream {\n\t\t\t\tget { return Stream.Null; }\n\t\t\t}\n\n\t\t\tpublic override Encoding CurrentEncoding {\n\t\t\t\tget { return Encoding.Unicode; }\n\t\t\t}\n\t\t}\n\n\t\tpublic new static readonly StreamReader Null = (StreamReader)(new NullStreamReader());\n\n\t\tinternal StreamReader() { }\n\n\t\tpublic StreamReader(Stream stream)\n\t\t\t: this(stream, Encoding.UTF8Unmarked, true, DefaultBufferSize) { }\n\n\t\tpublic StreamReader(Stream stream, bool detect_encoding_from_bytemarks)\n\t\t\t: this(stream, Encoding.UTF8Unmarked, detect_encoding_from_bytemarks, DefaultBufferSize) { }\n\n\t\tpublic StreamReader(Stream stream, Encoding encoding)\n\t\t\t: this(stream, encoding, true, DefaultBufferSize) { }\n\n\t\tpublic StreamReader(Stream stream, Encoding encoding, bool detect_encoding_from_bytemarks)\n\t\t\t: this(stream, encoding, detect_encoding_from_bytemarks, DefaultBufferSize) { }\n\n\t\tpublic StreamReader(Stream stream, Encoding encoding, bool detect_encoding_from_bytemarks, int buffer_size) {\n\t\t\tInitialize(stream, encoding, detect_encoding_from_bytemarks, buffer_size);\n\t\t}\n\n\t\tpublic StreamReader(string path)\n\t\t\t: this(path, Encoding.UTF8Unmarked, true, DefaultFileBufferSize) { }\n\n\t\tpublic StreamReader(string path, bool detect_encoding_from_bytemarks)\n\t\t\t: this(path, Encoding.UTF8Unmarked, detect_encoding_from_bytemarks, DefaultFileBufferSize) { }\n\n\t\tpublic StreamReader(string path, Encoding encoding)\n\t\t\t: this(path, encoding, true, DefaultFileBufferSize) { }\n\n\t\tpublic StreamReader(string path, Encoding encoding, bool detect_encoding_from_bytemarks)\n\t\t\t: this(path, encoding, detect_encoding_from_bytemarks, DefaultFileBufferSize) { }\n\n\t\tpublic StreamReader(string path, Encoding encoding, bool detect_encoding_from_bytemarks, int buffer_size) {\n\t\t\tif (null == path) {\n\t\t\t\tthrow new ArgumentNullException(\"path\");\n\t\t\t}\n\t\t\tif (String.Empty == path) {\n\t\t\t\tthrow new ArgumentException(\"Empty path not allowed\");\n\t\t\t}\n\t\t\tif (path.IndexOfAny(Path.InvalidPathChars) != -1) {\n\t\t\t\tthrow new ArgumentException(\"path contains invalid characters\");\n\t\t\t}\n\t\t\tif (null == encoding) {\n\t\t\t\tthrow new ArgumentNullException(\"encoding\");\n\t\t\t}\n\t\t\tif (buffer_size <= 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"buffer_size\", \"The minimum size of the buffer must be positive\");\n\t\t\t}\n\n\t\t\tStream stream = File.OpenRead(path);\n\t\t\tInitialize(stream, encoding, detect_encoding_from_bytemarks, buffer_size);\n\t\t}\n\n\t\tinternal void Initialize(Stream stream, Encoding encoding, bool detect_encoding_from_bytemarks, int buffer_size) {\n\t\t\tif (null == stream) {\n\t\t\t\tthrow new ArgumentNullException(\"stream\");\n\t\t\t}\n\t\t\tif (null == encoding) {\n\t\t\t\tthrow new ArgumentNullException(\"encoding\");\n\t\t\t}\n\t\t\tif (!stream.CanRead) {\n\t\t\t\tthrow new ArgumentException(\"Cannot read stream\");\n\t\t\t}\n\t\t\tif (buffer_size <= 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"buffer_size\", \"The minimum size of the buffer must be positive\");\n\t\t\t}\n\n\t\t\tif (buffer_size < MinimumBufferSize) {\n\t\t\t\tbuffer_size = MinimumBufferSize;\n\t\t\t}\n\n\t\t\tbase_stream = stream;\n\t\t\tinput_buffer = new byte[buffer_size];\n\t\t\tthis.buffer_size = buffer_size;\n\t\t\tthis.encoding = encoding;\n\t\t\tdecoder = encoding.GetDecoder();\n\n\t\t\tbyte[] preamble = encoding.GetPreamble();\n\t\t\tdo_checks = detect_encoding_from_bytemarks ? 1 : 0;\n\t\t\tdo_checks += (preamble.Length == 0) ? 0 : 2;\n\n\t\t\tdecoded_buffer = new char[encoding.GetMaxCharCount(buffer_size)];\n\t\t\tdecoded_count = 0;\n\t\t\tpos = 0;\n\t\t}\n\n\t\tpublic virtual Stream BaseStream {\n\t\t\tget {\n\t\t\t\treturn base_stream;\n\t\t\t}\n\t\t}\n\n\t\tpublic virtual Encoding CurrentEncoding {\n\t\t\tget {\n\t\t\t\tif (encoding == null) {\n\t\t\t\t\tthrow new Exception();\n\t\t\t\t}\n\t\t\t\treturn encoding;\n\t\t\t}\n\t\t}\n\n\n\t\tpublic bool EndOfStream {\n\t\t\tget { return Peek() < 0; }\n\t\t}\n\n\t\tpublic override void Close() {\n\t\t\tDispose(true);\n\t\t}\n\n\t\tprotected override void Dispose(bool disposing) {\n\t\t\tif (disposing && base_stream != null) {\n\t\t\t\tbase_stream.Close();\n\t\t\t}\n\t\t\tinput_buffer = null;\n\t\t\tdecoded_buffer = null;\n\t\t\tencoding = null;\n\t\t\tdecoder = null;\n\t\t\tbase_stream = null;\n\t\t\tbase.Dispose(disposing);\n\t\t}\n\n\t\t//\n\t\t// Provides auto-detection of the encoding, as well as skipping over\n\t\t// byte marks at the beginning of a stream.\n\t\t//\n\t\tint DoChecks(int count) {\n\t\t\tif ((do_checks & 2) == 2) {\n\t\t\t\tbyte[] preamble = encoding.GetPreamble();\n\t\t\t\tint c = preamble.Length;\n\t\t\t\tif (count >= c) {\n\t\t\t\t\tint i;\n\n\t\t\t\t\tfor (i = 0; i < c; i++) {\n\t\t\t\t\t\tif (input_buffer[i] != preamble[i]) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (i == c) {\n\t\t\t\t\t\treturn i;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ((do_checks & 1) == 1) {\n\t\t\t\tif (count < 2) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\t/*if (input_buffer[0] == 0xfe && input_buffer[1] == 0xff) {\n\t\t\t\t\tthis.encoding = Encoding.BigEndianUnicode;\n\t\t\t\t\treturn 2;\n\t\t\t\t}*/\n\n\t\t\t\tif (count < 3) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tif (input_buffer[0] == 0xef && input_buffer[1] == 0xbb && input_buffer[2] == 0xbf) {\n\t\t\t\t\tthis.encoding = Encoding.UTF8Unmarked;\n\t\t\t\t\treturn 3;\n\t\t\t\t}\n\n\t\t\t\tif (count < 4) {\n\t\t\t\t\tif (input_buffer[0] == 0xff && input_buffer[1] == 0xfe && input_buffer[2] != 0) {\n\t\t\t\t\t\tthis.encoding = Encoding.Unicode;\n\t\t\t\t\t\treturn 2;\n\t\t\t\t\t}\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\t/*if (input_buffer[0] == 0 && input_buffer[1] == 0\n\t\t\t\t\t&& input_buffer[2] == 0xfe && input_buffer[3] == 0xff) {\n\t\t\t\t\tthis.encoding = Encoding.BigEndianUTF32;\n\t\t\t\t\treturn 4;\n\t\t\t\t}\n\n\t\t\t\tif (input_buffer[0] == 0xff && input_buffer[1] == 0xfe) {\n\t\t\t\t\tif (input_buffer[2] == 0 && input_buffer[3] == 0) {\n\t\t\t\t\t\tthis.encoding = Encoding.UTF32;\n\t\t\t\t\t\treturn 4;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.encoding = Encoding.Unicode;\n\t\t\t\t\treturn 2;\n\t\t\t\t}*/\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t}\n\n\t\tpublic void DiscardBufferedData() {\n\t\t\tpos = decoded_count = 0;\n\t\t\tmayBlock = false;\n\t\t\t// Discard internal state of the decoder too.\n\t\t\tdecoder = encoding.GetDecoder();\n\t\t}\n\n\t\t// the buffer is empty, fill it again\n\t\tprivate int ReadBuffer() {\n\t\t\tpos = 0;\n\t\t\tint cbEncoded = 0;\n\n\t\t\t// keep looping until the decoder gives us some chars\n\t\t\tdecoded_count = 0;\n\t\t\tint parse_start = 0;\n\t\t\tdo {\n\t\t\t\tcbEncoded = base_stream.Read(input_buffer, 0, buffer_size);\n\n\t\t\t\tif (cbEncoded <= 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\tmayBlock = (cbEncoded < buffer_size);\n\t\t\t\tif (do_checks > 0) {\n\t\t\t\t\tEncoding old = encoding;\n\t\t\t\t\tparse_start = DoChecks(cbEncoded);\n\t\t\t\t\tif (old != encoding) {\n\t\t\t\t\t\tdecoder = encoding.GetDecoder();\n\t\t\t\t\t}\n\t\t\t\t\tdo_checks = 0;\n\t\t\t\t\tcbEncoded -= parse_start;\n\t\t\t\t}\n\n\t\t\t\tdecoded_count += decoder.GetChars(input_buffer, parse_start, cbEncoded, decoded_buffer, 0);\n\t\t\t\tparse_start = 0;\n\t\t\t} while (decoded_count == 0);\n\n\t\t\treturn decoded_count;\n\t\t}\n\n\t\tpublic override int Peek() {\n\t\t\tif (base_stream == null) {\n\t\t\t\tthrow new ObjectDisposedException(\"StreamReader\", \"Cannot read from a closed StreamReader\");\n\t\t\t}\n\t\t\tif (pos >= decoded_count && (mayBlock || ReadBuffer() == 0)) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\treturn decoded_buffer[pos];\n\t\t}\n\n\t\tpublic override int Read() {\n\t\t\tif (base_stream == null) {\n\t\t\t\tthrow new ObjectDisposedException(\"StreamReader\", \"Cannot read from a closed StreamReader\");\n\t\t\t}\n\t\t\tif (pos >= decoded_count && ReadBuffer() == 0) {\n\t\t\t\treturn -1;\n\t\t\t}\n\n\t\t\treturn decoded_buffer[pos++];\n\t\t}\n\n\t\tpublic override int Read([In, Out] char[] dest_buffer, int index, int count) {\n\t\t\tif (base_stream == null) {\n\t\t\t\tthrow new ObjectDisposedException(\"StreamReader\", \"Cannot read from a closed StreamReader\");\n\t\t\t}\n\t\t\tif (dest_buffer == null) {\n\t\t\t\tthrow new ArgumentNullException(\"dest_buffer\");\n\t\t\t}\n\t\t\tif (index < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"index\", \"< 0\");\n\t\t\t}\n\t\t\tif (count < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"count\", \"< 0\");\n\t\t\t}\n\t\t\t// re-ordered to avoid possible integer overflow\n\t\t\tif (index > dest_buffer.Length - count) {\n\t\t\t\tthrow new ArgumentException(\"index + count > dest_buffer.Length\");\n\t\t\t}\n\n\t\t\tint chars_read = 0;\n\t\t\twhile (count > 0) {\n\t\t\t\tif (pos >= decoded_count && ReadBuffer() == 0) {\n\t\t\t\t\treturn chars_read > 0 ? chars_read : 0;\n\t\t\t\t}\n\n\t\t\t\tint cch = Math.Min(decoded_count - pos, count);\n\t\t\t\tArray.Copy(decoded_buffer, pos, dest_buffer, index, cch);\n\t\t\t\tpos += cch;\n\t\t\t\tindex += cch;\n\t\t\t\tcount -= cch;\n\t\t\t\tchars_read += cch;\n\t\t\t\tif (mayBlock) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn chars_read;\n\t\t}\n\n\t\tbool foundCR;\n\t\tint FindNextEOL() {\n\t\t\tchar c = '\\0';\n\t\t\tfor (; pos < decoded_count; pos++) {\n\t\t\t\tc = decoded_buffer[pos];\n\t\t\t\tif (c == '\\n') {\n\t\t\t\t\tpos++;\n\t\t\t\t\tint res = (foundCR) ? (pos - 2) : (pos - 1);\n\t\t\t\t\tif (res < 0) {\n\t\t\t\t\t\tres = 0; // if a new buffer starts with a \\n and there was a \\r at\n\t\t\t\t\t}\n\t\t\t\t\t// the end of the previous one, we get here.\n\t\t\t\t\tfoundCR = false;\n\t\t\t\t\treturn res;\n\t\t\t\t} else if (foundCR) {\n\t\t\t\t\tfoundCR = false;\n\t\t\t\t\treturn pos - 1;\n\t\t\t\t}\n\n\t\t\t\tfoundCR = (c == '\\r');\n\t\t\t}\n\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic override string ReadLine() {\n\t\t\tif (base_stream == null) {\n\t\t\t\tthrow new ObjectDisposedException(\"StreamReader\", \"Cannot read from a closed StreamReader\");\n\t\t\t}\n\n\t\t\tif (pos >= decoded_count && ReadBuffer() == 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tint begin = pos;\n\t\t\tint end = FindNextEOL();\n\t\t\tif (end < decoded_count && end >= begin) {\n\t\t\t\treturn new string(decoded_buffer, begin, end - begin);\n\t\t\t}\n\n\t\t\tif (line_builder == null) {\n\t\t\t\tline_builder = new StringBuilder();\n\t\t\t} else {\n\t\t\t\tline_builder.Length = 0;\n\t\t\t}\n\n\t\t\twhile (true) {\n\t\t\t\tif (foundCR) { // don't include the trailing CR if present\n\t\t\t\t\tdecoded_count--;\n\t\t\t\t}\n\n\t\t\t\tline_builder.Append(decoded_buffer, begin, decoded_count - begin);\n\t\t\t\tif (ReadBuffer() == 0) {\n\t\t\t\t\tif (line_builder.Capacity > 32768) {\n\t\t\t\t\t\tStringBuilder sb = line_builder;\n\t\t\t\t\t\tline_builder = null;\n\t\t\t\t\t\treturn sb.ToString(0, sb.Length);\n\t\t\t\t\t}\n\t\t\t\t\treturn line_builder.ToString(0, line_builder.Length);\n\t\t\t\t}\n\n\t\t\t\tbegin = pos;\n\t\t\t\tend = FindNextEOL();\n\t\t\t\tif (end < decoded_count && end >= begin) {\n\t\t\t\t\tline_builder.Append(decoded_buffer, begin, end - begin);\n\t\t\t\t\tif (line_builder.Capacity > 32768) {\n\t\t\t\t\t\tStringBuilder sb = line_builder;\n\t\t\t\t\t\tline_builder = null;\n\t\t\t\t\t\treturn sb.ToString(0, sb.Length);\n\t\t\t\t\t}\n\t\t\t\t\treturn line_builder.ToString(0, line_builder.Length);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ReadToEnd() {\n\t\t\tif (base_stream == null) {\n\t\t\t\tthrow new ObjectDisposedException(\"StreamReader\", \"Cannot read from a closed StreamReader\");\n\t\t\t}\n\n\t\t\tStringBuilder text = new StringBuilder();\n\n\t\t\tint size = decoded_buffer.Length;\n\t\t\tchar[] buffer = new char[size];\n\t\t\tint len;\n\n\t\t\twhile ((len = Read(buffer, 0, size)) > 0) {\n\t\t\t\ttext.Append(buffer, 0, len);\n\t\t\t}\n\n\t\t\treturn text.ToString();\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.IO/TextReader.cs",
    "content": "#if !LOCALTEST\n\nusing System;\nusing System.Runtime.InteropServices;\n\nnamespace System.IO {\n\n\tpublic abstract class TextReader : MarshalByRefObject, IDisposable {\n\n\t\tprotected TextReader() { }\n\n\t\tpublic static readonly TextReader Null;\n\n\t\tpublic virtual void Close() {\n\t\t\tDispose(true);\n\t\t}\n\n\t\tpublic void Dispose ()\n\t\t{\n\t\t\tDispose(true);\n\t\t}\n\n\t\tprotected virtual void Dispose(bool disposing) {\n\t\t\treturn;\n\t\t}\n\n\t\tpublic virtual int Peek() {\n\t\t\treturn -1;\n\t\t}\n\n\t\tpublic virtual int Read() {\n\t\t\treturn -1;\n\t\t}\n\n\n\t\tpublic virtual int Read([In, Out] char[] buffer, int index, int count) {\n\t\t\tint c, i;\n\n\t\t\tfor (i = 0; i < count; i++) {\n\t\t\t\tif ((c = Read()) == -1)\n\t\t\t\t\treturn i;\n\t\t\t\tbuffer[index + i] = (char)c;\n\t\t\t}\n\n\t\t\treturn i;\n\t\t}\n\n\t\tpublic virtual int ReadBlock([In, Out] char[] buffer, int index, int count) {\n\t\t\tint total_read_count = 0;\n\t\t\tint current_read_count = 0;\n\n\t\t\tdo {\n\t\t\t\tcurrent_read_count = Read(buffer, index, count);\n\t\t\t\tindex += current_read_count;\n\t\t\t\ttotal_read_count += current_read_count;\n\t\t\t\tcount -= current_read_count;\n\t\t\t} while (current_read_count != 0 && count > 0);\n\n\t\t\treturn total_read_count;\n\t\t}\n\n\t\tpublic virtual string ReadLine() {\n\t\t\treturn String.Empty;\n\t\t}\n\n\t\tpublic virtual string ReadToEnd() {\n\t\t\treturn String.Empty;\n\t\t}\n\n\t\tpublic static TextReader Synchronized(TextReader reader) {\n\t\t\tif (reader == null)\n\t\t\t\tthrow new ArgumentNullException(\"reader is null\");\n\t\t\tif (reader is SynchronizedReader)\n\t\t\t\treturn reader;\n\n\t\t\treturn new SynchronizedReader(reader);\n\t\t}\n\t}\n\n\t//\n\t// Synchronized Reader implementation, used internally.\n\t//\n\tinternal class SynchronizedReader : TextReader {\n\t\tTextReader reader;\n\n\t\tpublic SynchronizedReader(TextReader reader) {\n\t\t\tthis.reader = reader;\n\t\t}\n\n\t\tpublic override void Close() {\n\t\t\tlock (this) {\n\t\t\t\treader.Close();\n\t\t\t}\n\t\t}\n\n\t\tpublic override int Peek() {\n\t\t\tlock (this) {\n\t\t\t\treturn reader.Peek();\n\t\t\t}\n\t\t}\n\n\t\tpublic override int ReadBlock(char[] buffer, int index, int count) {\n\t\t\tlock (this) {\n\t\t\t\treturn reader.ReadBlock(buffer, index, count);\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ReadLine() {\n\t\t\tlock (this) {\n\t\t\t\treturn reader.ReadLine();\n\t\t\t}\n\t\t}\n\n\t\tpublic override string ReadToEnd() {\n\t\t\tlock (this) {\n\t\t\t\treturn reader.ReadToEnd();\n\t\t\t}\n\t\t}\n\n\t\tpublic override int Read() {\n\t\t\tlock (this) {\n\t\t\t\treturn reader.Read();\n\t\t\t}\n\t\t}\n\n\t\tpublic override int Read(char[] buffer, int index, int count) {\n\t\t\tlock (this) {\n\t\t\t\treturn reader.Read(buffer, index, count);\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif"
  },
  {
    "path": "corlib/System.Reflection/DefaultMemberAttribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Reflection {\n\n\t[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface)]\n\tpublic sealed class DefaultMemberAttribute : Attribute {\n\n\t\tprivate string memberName;\n\n\t\tpublic DefaultMemberAttribute(string memberName) {\n\t\t\tthis.memberName = memberName;\n\t\t}\n\n\t\tpublic string MemberName {\n\t\t\tget {\n\t\t\t\treturn this.memberName;\n\t\t\t}\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Reflection/MemberInfo.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace System.Reflection {\n\tpublic abstract class MemberInfo {\n\n\t\tprotected MemberInfo() {\n\t\t}\n\n\t\tpublic abstract string Name { get;}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.CompilerServices/IndexerNameAttribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Runtime.CompilerServices {\n\n\t[AttributeUsage(AttributeTargets.Property, Inherited = true)]\n\tpublic sealed class IndexerNameAttribute : Attribute {\n\n\t\tpublic IndexerNameAttribute(string indexName) {\n\t\t}\n\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.CompilerServices/MethodImplAttribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Runtime.CompilerServices {\n\n\t[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor, Inherited = false)]\n\tpublic sealed class MethodImplAttribute : Attribute {\n\n\t\tprivate MethodImplOptions options;\n\n\t\tpublic MethodImplAttribute() {\n\t\t}\n\n\t\tpublic MethodImplAttribute(MethodImplOptions options) {\n\t\t\tthis.options = options;\n\t\t}\n\n\t\tpublic MethodImplOptions Value {\n\t\t\tget {\n\t\t\t\treturn options;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.CompilerServices/MethodImplOptions.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Runtime.CompilerServices {\n\t[Flags]\n\tpublic enum MethodImplOptions {\n\t\tUnmanaged =\t\t0x0004,\n\t\tForwardRef =\t0x0010,\n\t\tInternalCall =\t0x1000,\n\t\tSynchronized =\t0x0020,\n\t\tNoInlining =\t0x0008,\n\t\tPreserveSig =\t0x0080,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Runtime.CompilerServices {\n\tpublic static class RuntimeHelpers {\n\n\t\t[MethodImplAttribute(MethodImplOptions.InternalCall)]\n\t\textern public static void InitializeArray(Array array, RuntimeFieldHandle fldHandle);\n\n\t}\n}\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.InteropServices/CallingConvention.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Runtime.InteropServices {\n\tpublic enum CallingConvention {\n\t\tWinapi = 1,\n\t\tCdecl = 2,\n\t\tStdCall = 3,\n\t\tThisCall = 4,\n\t\tFastCall = 5,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.InteropServices/CharSet.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Runtime.InteropServices {\n\tpublic enum CharSet {\n\t\tNone = 1,\n\t\tAnsi = 2,\n\t\tUnicode = 3,\n\t\tAuto = 4,\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.InteropServices/DllImportAttribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Runtime.InteropServices {\n\n    [AttributeUsage(AttributeTargets.Method)]\n\tpublic class DllImportAttribute : Attribute {\n\n\t\t// Sync with C code\n\t\tprivate string dllName;\n\t\tpublic bool BestFitMapping;\n\t\tpublic CallingConvention CallingConvention;\n\t\tpublic CharSet CharSet;\n\t\tpublic string EntryPoint;\n\t\tpublic bool ExactSpelling;\n\t\tpublic bool PreserveSig;\n\t\tpublic bool SetLastError;\n\t\tpublic bool ThrowOnUnmappableChar;\n\n\t\tpublic DllImportAttribute(string dllName) {\n\t\t\tthis.dllName = dllName;\n\t\t}\n\n\t\tpublic string Value {\n\t\t\tget {\n\t\t\t\treturn this.dllName;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.InteropServices/ExternalException.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Runtime.InteropServices {\n\tpublic class ExternalException : SystemException {\n\n\t\tpublic ExternalException() : base(\"External exception\") { }\n\n\t\tpublic ExternalException(string msg) : base(msg) { }\n\n\t\tpublic ExternalException(string msg, Exception inner) : base(msg, inner) { }\n\n\t\tpublic ExternalException(string msg, int err)\n\t\t\t: base(msg) {\n\t\t\tbase.HResult = err;\n\t\t}\n\n\t\tpublic virtual int ErrorCode {\n\t\t\tget {\n\t\t\t\treturn base.HResult;\n\t\t\t}\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.InteropServices/InAttribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Runtime.InteropServices {\n\n\t[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]\n\tpublic sealed class InAttribute : Attribute {\n\t\tpublic InAttribute() { }\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Runtime.InteropServices/OutAttribute.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Runtime.InteropServices {\n\n\t[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]\n\tpublic sealed class OutAttribute : Attribute {\n\t\tpublic OutAttribute() { }\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Text/Decoder.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Text {\n\tpublic abstract class Decoder {\n\t\tpublic virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex) {\n\t\t\treturn GetChars(bytes, byteIndex, byteCount, chars, charIndex, false);\n\t\t}\n\n\t\tpublic virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush) {\n\t\t\tif (bytes == null || chars == null) {\n\t\t\t\tthrow new ArgumentNullException();\n\t\t\t}\n\t\t\tif (byteIndex < 0 || byteCount < 0 || charIndex < 0 ||\n\t\t\t\tbyteIndex + byteCount > bytes.Length || charIndex >= chars.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\treturn GetCharsSafe(bytes, byteIndex, byteCount, chars, charIndex, flush);\n\t\t}\n\n\t\tprotected abstract int GetCharsSafe(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush);\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Text/Encoding.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Text {\n\n\tpublic abstract class Encoding : ICloneable {\n\n\t\tprivate static object lockObj = new object();\n\n\t\t#region Static common Encoding properties\n\n\t\tprivate static Encoding unicodeEncoding = null;\n\t\tprivate static Encoding utf8Encoding = null;\n\t\tprivate static Encoding utf8UnmarkedEncoding = null;\n\n\t\tpublic static Encoding Unicode {\n\t\t\tget {\n\t\t\t\tif (unicodeEncoding == null) {\n\t\t\t\t\tlock (lockObj) {\n\t\t\t\t\t\tif (unicodeEncoding == null) {\n\t\t\t\t\t\t\tunicodeEncoding = new UnicodeEncoding(true, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn unicodeEncoding;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Encoding UTF8 {\n\t\t\tget {\n\t\t\t\tif (utf8Encoding == null) {\n\t\t\t\t\tlock (lockObj) {\n\t\t\t\t\t\tif (utf8Encoding == null) {\n\t\t\t\t\t\t\tutf8Encoding = new UTF8Encoding(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn utf8Encoding;\n\t\t\t}\n\t\t}\n\n\t\tpublic static Encoding UTF8Unmarked {\n\t\t\tget {\n\t\t\t\tif (utf8UnmarkedEncoding == null) {\n\t\t\t\t\tlock (lockObj) {\n\t\t\t\t\t\tif (utf8UnmarkedEncoding == null) {\n\t\t\t\t\t\t\tutf8UnmarkedEncoding = new UTF8Encoding(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn utf8UnmarkedEncoding;\n\t\t\t}\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic virtual byte[] GetPreamble() {\n\t\t\treturn new byte[0];\n\t\t}\n\n\t\tpublic abstract int GetMaxCharCount(int byteCount);\n\n\t\tpublic abstract Decoder GetDecoder();\n\n\n\t\t#region ICloneable Members\n\n\t\tpublic object Clone() {\n\t\t\treturn (Encoding)object.Clone(this);\n\t\t}\n\n\t\t#endregion\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Text/StringBuilder.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nusing System;\nusing System.Runtime.CompilerServices;\n\n#if LOCALTEST\nnamespace System_.Text {\n#else\nnamespace System.Text {\n#endif\n\tpublic sealed class StringBuilder {\n\n\t\tprivate const int defaultMaxCapacity = int.MaxValue;\n\t\tprivate const int defaultInitialCapacity = 16;\n\n\t\tprivate int length;\n\t\tprivate int capacity;\n\t\tprivate char[] data;\n\n\t\t#region Constructors\n\n\t\tpublic StringBuilder() : this(defaultInitialCapacity, defaultMaxCapacity) { }\n\n\t\tpublic StringBuilder(int initialCapacity) : this(initialCapacity, defaultMaxCapacity) { }\n\n\t\tpublic StringBuilder(int initialCapacity, int maxCapacity) {\n\t\t\tthis.capacity = Math.Max(initialCapacity, 2);\n\t\t\tthis.length = 0;\n\t\t\tthis.data = new char[this.capacity];\n\t\t}\n\n\t\tpublic StringBuilder(string value)\n\t\t\t: this((value != null) ? value.Length : defaultInitialCapacity, defaultMaxCapacity) {\n\t\t\tif (value != null) {\n\t\t\t\tthis.Append(value);\n\t\t\t}\n\t\t}\n\n\t\tpublic StringBuilder(string value, int initialCapacity)\n\t\t\t: this(initialCapacity, defaultMaxCapacity) {\n\t\t\tif (value != null) {\n\t\t\t\tthis.Append(value);\n\t\t\t}\n\t\t}\n\n\t\tpublic StringBuilder(string value, int startIndex, int length, int initialCapacity)\n\t\t\t: this(initialCapacity, defaultMaxCapacity) {\n\t\t\tif (value == null) {\n\t\t\t\tvalue = string.Empty;\n\t\t\t}\n\t\t\tif (startIndex < 0 || length < 0 || startIndex + length > value.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tthis.Append(value, startIndex, length);\n\t\t}\n\n\t\t#endregion\n\n\t\tpublic override string ToString() {\n\t\t\treturn new string(this.data, 0, this.length);\n\t\t}\n\n\t\tpublic string ToString(int startIndex, int length) {\n\t\t\tif (startIndex < 0 || length < 0 || startIndex + length > this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\treturn new string(this.data, startIndex, length);\n\t\t}\n\n\t\tprivate void EnsureSpace(int space) {\n\t\t\tif (this.length + space > this.capacity) {\n\t\t\t\tdo {\n\t\t\t\t\tthis.capacity <<= 1;\n\t\t\t\t} while (this.capacity < this.length + space);\n\t\t\t\tchar[] newData = new char[capacity];\n\t\t\t\tArray.Copy(this.data, 0, newData, 0, this.length);\n\t\t\t\tthis.data = newData;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Length {\n\t\t\tget {\n\t\t\t\treturn this.length;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value < 0) {\n\t\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t\t}\n\t\t\t\tif (value > this.length) {\n\t\t\t\t\tthis.EnsureSpace(this.length - value);\n\t\t\t\t\tfor (int i = this.length; i < value; i++) {\n\t\t\t\t\t\tthis.data[i] = '\\x0000';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.length = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic int Capacity {\n\t\t\tget {\n\t\t\t\treturn this.capacity;\n\t\t\t}\n\t\t}\n\n\t\t[IndexerName(\"Chars\")]\n\t\tpublic char this[int index] {\n\t\t\tget {\n\t\t\t\tif (index < 0 || index >= this.length) {\n\t\t\t\t\tthrow new IndexOutOfRangeException();\n\t\t\t\t}\n\t\t\t\treturn this.data[index];\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (index < 0 || index >= this.length) {\n\t\t\t\t\tthrow new IndexOutOfRangeException();\n\t\t\t\t}\n\t\t\t\tthis.data[index] = value;\n\t\t\t}\n\t\t}\n\n\t\tpublic void CopyTo(int srcIndex, char[] dst, int dstIndex, int count) {\n\t\t\tif (dst == null) {\n\t\t\t\tthrow new ArgumentNullException(\"destination\");\n\t\t\t}\n\t\t\tif (srcIndex < 0 || count < 0 || dstIndex < 0 ||\n\t\t\t\tsrcIndex + count > this.length || dstIndex + count > dst.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tArray.Copy(this.data, srcIndex, dst, dstIndex, count);\n\t\t}\n\n\t\tpublic void EnsureCapacity(int capacity) {\n\t\t\tif (this.capacity < capacity) {\n\t\t\t\t// This is not quite right, as it will often over-allocate memory\n\t\t\t\tthis.EnsureSpace(capacity - this.capacity);\n\t\t\t}\n\t\t}\n\n\t\tpublic StringBuilder Remove(int startIndex, int length) {\n\t\t\tif (startIndex < 0 || length < 0 || startIndex + length > this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tArray.Copy(this.data, startIndex + length, this.data, startIndex, this.length - length - startIndex);\n\t\t\tthis.length -= length;\n\t\t\treturn this;\n\t\t}\n\n\t\t#region Append Methods\n\n\t\tpublic StringBuilder Append(string value) {\n\t\t\tint len = value.Length;\n\t\t\tthis.EnsureSpace(len);\n\t\t\tfor (int i = 0; i < len; i++) {\n\t\t\t\tthis.data[this.length++] = value[i];\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder Append(string value, int startIndex, int count) {\n\t\t\tif (value == null) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (startIndex < 0 || count < 0 || value.Length < startIndex + count) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tthis.EnsureSpace(count);\n\t\t\tfor (int i = 0; i < count; i++) {\n\t\t\t\tthis.data[this.length++] = value[startIndex + i];\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder Append(char value) {\n\t\t\tEnsureSpace(1);\n\t\t\tdata[length++] = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder Append(char value, int repeatCount) {\n\t\t\tif (repeatCount < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tEnsureSpace(repeatCount);\n\t\t\tfor (int i = 0; i < repeatCount; i++) {\n\t\t\t\tthis.data[this.length++] = value;\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder Append(char[] value) {\n\t\t\tif (value == null) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tint addLen = value.Length;\n\t\t\tthis.EnsureSpace(addLen);\n\t\t\tArray.Copy(value, 0, this.data, this.length, addLen);\n\t\t\tthis.length += addLen;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder Append(char[] value, int startIndex, int charCount) {\n\t\t\tif (value == null) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (charCount < 0 || startIndex < 0 || value.Length < (startIndex + charCount)) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tthis.EnsureSpace(charCount);\n\t\t\tArray.Copy(value, startIndex, this.data, this.length, charCount);\n\t\t\tthis.length += charCount;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder Append(object value) {\n\t\t\tif (value == null) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(bool value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(byte value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(decimal value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(double value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(short value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(int value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(long value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(sbyte value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(float value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(ushort value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(uint value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Append(ulong value) {\n\t\t\treturn Append(value.ToString());\n\t\t}\n\n\t\t#endregion\n\n\t\t#region AppendFormat Methods\n\n\t\tpublic StringBuilder AppendFormat(string format, object obj0) {\n\t\t\tStringHelper.FormatHelper(this, null, format, obj0);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder AppendFormat(string format, object obj0, object obj1) {\n\t\t\tStringHelper.FormatHelper(this, null, format, obj0, obj1);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder AppendFormat(string format, object obj0, object obj1, object obj2) {\n\t\t\tStringHelper.FormatHelper(this, null, format, obj0, obj1, obj2);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder AppendFormat(string format, params object[] objs) {\n\t\t\tStringHelper.FormatHelper(this, null, format, objs);\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder AppendFormat(IFormatProvider provider, string format, params object[] objs) {\n\t\t\tStringHelper.FormatHelper(this, provider, format, objs);\n\t\t\treturn this;\n\t\t}\n\n\t\t#endregion\n\n\t\t#region AppendLine Methods\n\n\t\tpublic StringBuilder AppendLine() {\n\t\t\treturn this.Append(Environment.NewLine);\n\t\t}\n\n\t\tpublic StringBuilder AppendLine(string value) {\n\t\t\treturn this.Append(value).Append(Environment.NewLine);\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Insert Methods\n\n\t\tpublic StringBuilder Insert(int index, string value) {\n\t\t\tif (index < 0 || index > this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tif (string.IsNullOrEmpty(value)) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tint len = value.Length;\n\t\t\tEnsureSpace(len);\n\t\t\tArray.Copy(this.data, index, this.data, index + len, this.length - index);\n\t\t\tfor (int i = 0; i < len; i++) {\n\t\t\t\tthis.data[index + i] = value[i];\n\t\t\t}\n\t\t\tthis.length += len;\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, bool value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, byte value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, char value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, char[] value) {\n\t\t\treturn this.Insert(index, new string(value));\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, decimal value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, double value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, short value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, int value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, long value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, object value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, sbyte value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, float value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, ushort value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, uint value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, ulong value) {\n\t\t\treturn this.Insert(index, value.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, string value, int count) {\n\t\t\tif (count < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tif (count == 0 || string.IsNullOrEmpty(value)) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tStringBuilder toInsert = new StringBuilder(value.Length * count);\n\t\t\tfor (; count > 0; count--) {\n\t\t\t\ttoInsert.Append(value);\n\t\t\t}\n\t\t\treturn this.Insert(index, toInsert.ToString());\n\t\t}\n\n\t\tpublic StringBuilder Insert(int index, char[] value, int startIndex, int charCount) {\n\t\t\tif (value == null && (startIndex != 0 || charCount != 0)) {\n\t\t\t\tthrow new ArgumentNullException(\"value\");\n\t\t\t}\n\t\t\tif (startIndex < 0 || charCount < 0 || startIndex + charCount > value.Length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\treturn this.Insert(index, new string(value, startIndex, charCount));\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Replace Methods\n\n\t\tpublic StringBuilder Replace(char oldChar, char newChar) {\n\t\t\treturn this.Replace(oldChar, newChar, 0, this.length);\n\t\t}\n\n\t\tpublic StringBuilder Replace(string oldValue, string newValue) {\n\t\t\treturn this.Replace(oldValue, newValue, 0, this.length);\n\t\t}\n\n\t\tpublic StringBuilder Replace(char oldChar, char newChar, int startIndex, int count) {\n\t\t\tif (startIndex < 0 || count < 0 || startIndex + count > this.length) {\n\t\t\t\tthrow new ArgumentOutOfRangeException();\n\t\t\t}\n\t\t\tfor (int i = 0; i < count; i++) {\n\t\t\t\tif (this.data[startIndex + i] == oldChar) {\n\t\t\t\t\tthis.data[startIndex + i] = newChar;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tpublic StringBuilder Replace(string oldValue, string newValue, int startIndex, int count) {\n\t\t\tstring subStr = this.ToString(startIndex, count);\n\t\t\tsubStr = subStr.Replace(oldValue, newValue);\n\t\t\tthis.Remove(startIndex, count);\n\t\t\tthis.Insert(startIndex, subStr);\n\t\t\treturn this;\n\t\t}\n\n\t\t#endregion\n\t}\n}\n"
  },
  {
    "path": "corlib/System.Text/UTF8Encoding.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.Text {\n\tpublic class UTF8Encoding : Encoding {\n\n\t\tprivate class UTF8Decoder : Decoder {\n\n\t\t\tprivate byte b0, b1, b2, b3;\n\t\t\tprivate int bufOfs = 0;\n\n\t\t\tprotected override int GetCharsSafe(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush) {\n\t\t\t\tint charIndexOrg = charIndex;\n\t\t\t\tint charsLen = chars.Length;\n\t\t\t\tchar ch = '\\u0000';\n\t\t\t\tbool chSet = false;\n\t\t\t\tfor (int i = 0; i < byteCount; i++) {\n\t\t\t\t\tbyte b = bytes[byteIndex + i];\n\t\t\t\t\tswitch (bufOfs) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tif (b < 0x80) {\n\t\t\t\t\t\t\tch = (char)b;\n\t\t\t\t\t\t\tchSet = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tb0 = b;\n\t\t\t\t\t\t\tbufOfs = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tif ((b0 & 0xe0) == 0xc0) {\n\t\t\t\t\t\t\tch = (char)(((b0 & 0x1f) << 6) | (b & 0x3f));\n\t\t\t\t\t\t\tchSet = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tb1 = b;\n\t\t\t\t\t\t\tbufOfs = 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tif ((b0 & 0xf0) == 0xe0) {\n\t\t\t\t\t\t\tch = (char)(((b0 & 0x0f) << 12) | ((b1 & 0x3f) << 6) | (b & 0x3f));\n\t\t\t\t\t\t\tchSet = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tb2 = b;\n\t\t\t\t\t\t\tbufOfs = 3;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tif ((b0 & 0xf8) == 0xf0) {\n\t\t\t\t\t\t\tch = (char)(((b0 & 0x07) << 18) | ((b1 & 0x3f) << 12) | ((b2 & 0x3f) << 6) | (b & 0x3f));\n\t\t\t\t\t\t\tchSet = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tb3 = b;\n\t\t\t\t\t\t\tbufOfs = 4;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new NotSupportedException(\"Cannot handle UTF8 characters more than 4 bytes\");\n\t\t\t\t\t}\n\t\t\t\t\tif (chSet) {\n\t\t\t\t\t\tif (charIndex >= charsLen) {\n\t\t\t\t\t\t\tthrow new ArgumentException();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tchars[charIndex++] = ch;\n\t\t\t\t\t\tbufOfs = 0;\n\t\t\t\t\t\tchSet = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (flush) {\n\t\t\t\t\tbufOfs = 0;\n\t\t\t\t}\n\t\t\t\treturn charIndex - charIndexOrg;\n\t\t\t}\n\n\t\t}\n\n\t\tprivate bool emitIdentifier;\n\t\tprivate bool throwOnInvalidBytes;\n\n\t\tpublic UTF8Encoding() : this(false, false) { }\n\n\t\tpublic UTF8Encoding(bool encoderShouldEmitUTF8Identifier) : this(encoderShouldEmitUTF8Identifier, false) { }\n\n\t\tpublic UTF8Encoding(bool encoderShouldEmitUTF8Identifier, bool throwOnInvalidBytes) {\n\t\t\tthis.emitIdentifier = encoderShouldEmitUTF8Identifier;\n\t\t\tthis.throwOnInvalidBytes = throwOnInvalidBytes;\n\t\t}\n\n\t\tpublic override byte[] GetPreamble() {\n\t\t\tif (emitIdentifier) {\n\t\t\t\treturn new byte[3] { 0xef, 0xbb, 0xbf };\n\t\t\t} else {\n\t\t\t\treturn new byte[0];\n\t\t\t}\n\t\t}\n\n\t\tpublic override int GetMaxCharCount(int byteCount) {\n\t\t\tif (byteCount < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"byteCount\");\n\t\t\t}\n\t\t\treturn byteCount;\n\t\t}\n\n\t\tpublic override Decoder GetDecoder() {\n\t\t\treturn new UTF8Decoder();\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Text/UnicodeEncoding.cs",
    "content": "#if !LOCALTEST\n\nnamespace System.Text {\n\tpublic class UnicodeEncoding : Encoding {\n\n\t\tprivate class UnicodeDecoder : Decoder {\n\n\t\t\tprivate bool bigEndian;\n\n\t\t\tpublic UnicodeDecoder(bool bigEndian) {\n\t\t\t\tthis.bigEndian = bigEndian;\n\t\t\t}\n\n\t\t\tprotected override int GetCharsSafe(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush) {\n\t\t\t\tthrow new Exception(\"The method or operation is not implemented.\");\n\t\t\t}\n\t\t}\n\n\t\tprivate bool bigEndian;\n\t\tprivate bool byteOrderMark;\n\t\tprivate bool throwOnInvalidBytes;\n\n\t\tpublic UnicodeEncoding() : this(false, true, false) { }\n\n\t\tpublic UnicodeEncoding(bool bigEndian, bool byteOrderMark) : this(bigEndian, byteOrderMark, false) { }\n\n\t\tpublic UnicodeEncoding(bool bigEndian, bool byteOrderMark, bool throwOnInvalidBytes) {\n\t\t\tthis.bigEndian = bigEndian;\n\t\t\tthis.byteOrderMark = byteOrderMark;\n\t\t\tthis.throwOnInvalidBytes = throwOnInvalidBytes;\n\t\t}\n\n\t\tpublic override byte[] GetPreamble() {\n\t\t\tif (byteOrderMark) {\n\t\t\t\tbyte[] preamble = new byte[2] { 0xff, 0xfe };\n\t\t\t\tif (bigEndian) {\n\t\t\t\t\tArray.Reverse(preamble);\n\t\t\t\t}\n\t\t\t\treturn preamble;\n\t\t\t} else {\n\t\t\t\treturn new byte[0];\n\t\t\t}\n\t\t}\n\n\t\tpublic override int GetMaxCharCount(int byteCount) {\n\t\t\tif (byteCount < 0) {\n\t\t\t\tthrow new ArgumentOutOfRangeException(\"byteCount\");\n\t\t\t}\n\t\t\treturn byteCount / 2;\n\t\t}\n\n\t\tpublic override Decoder GetDecoder() {\n\t\t\treturn new UnicodeDecoder(this.bigEndian);\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Threading/Interlocked.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nnamespace System.Threading {\n\tpublic static class Interlocked {\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static int CompareExchange(ref int loc, int value, int comparand);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static int Increment(ref int loc);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static int Decrement(ref int loc);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static int Add(ref int loc, int value);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static int Exchange(ref int loc, int value);\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Threading/Monitor.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\n\nnamespace System.Threading {\n\tpublic static class Monitor {\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static bool Internal_TryEnter(object obj, int msTimeout);\n\n\t\tpublic static void Enter(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\tthrow new ArgumentNullException(\"obj\");\n\t\t\t}\n\t\t\tInternal_TryEnter(obj, -1);\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern private static void Internal_Exit(object obj);\n\n\t\tpublic static void Exit(object obj) {\n\t\t\tif (obj == null) {\n\t\t\t\tthrow new ArgumentNullException(\"obj\");\n\t\t\t}\n\t\t\tInternal_Exit(obj);\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Threading/ParameterizedThreadStart.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Threading {\n\tpublic delegate void ParameterizedThreadStart(object obj);\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Threading/Thread.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System.Runtime.CompilerServices;\nusing System.Globalization;\n\nnamespace System.Threading {\n\tpublic sealed class Thread {\n\n        // These member vars MUST be synced with C code.\n#pragma warning disable 0169, 0649\n        private int managedThreadID = 0;\n\t\tprivate MulticastDelegate threadStart = null;\n#pragma warning restore 0169, 0649\n\t\tprivate object param = null;\n\t\tprivate ThreadState threadState = ThreadState.Unstarted;\n\n\t\tprivate CultureInfo currentCulture;\n\t\t\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public static void Sleep(int millisecondsTimeout);\n\n\t\textern public static Thread CurrentThread {\n\t\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\t\tget;\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public Thread(ThreadStart threadStart);\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public Thread(ParameterizedThreadStart threadStart);\n\n\t\tpublic int ManagedThreadId {\n\t\t\tget {\n\t\t\t\treturn this.managedThreadID;\n\t\t\t}\n\t\t}\n\n\t\tpublic ThreadState ThreadState {\n\t\t\tget {\n\t\t\t\treturn this.threadState;\n\t\t\t}\n\t\t}\n\n\t\tpublic bool IsBackground {\n\t\t\tget {\n\t\t\t\treturn ((this.threadState & ThreadState.Background) != 0);\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value) {\n\t\t\t\t\tthis.threadState |= ThreadState.Background;\n\t\t\t\t} else {\n\t\t\t\t\tthis.threadState &= ~ThreadState.Background;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t[MethodImpl(MethodImplOptions.InternalCall)]\n\t\textern public void Start();\n\n\t\tpublic void Start(object param) {\n\t\t\tthis.param = param;\n\t\t\tthis.Start();\n\t\t}\n\n\t\tpublic CultureInfo CurrentCulture {\n\t\t\tget {\n\t\t\t\tif (this.currentCulture == null) {\n\t\t\t\t\tthis.currentCulture = CultureInfo.InvariantCulture;\n\t\t\t\t}\n\t\t\t\treturn this.currentCulture;\n\t\t\t}\n\t\t\tset {\n\t\t\t\tif (value == null) {\n\t\t\t\t\tthrow new ArgumentNullException();\n\t\t\t\t}\n\t\t\t\tthis.currentCulture = value;\n\t\t\t}\n\t\t}\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Threading/ThreadStart.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Threading {\n\tpublic delegate void ThreadStart();\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Threading/ThreadState.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nnamespace System.Threading {\n\n\t[Flags]\n\tpublic enum ThreadState {\n\t\tRunning = 0x00000000,\n\t\tStopRequested = 0x00000001,\n\t\tSuspendRequested = 0x00000002,\n\t\tBackground = 0x00000004,\n\t\tUnstarted = 0x00000008,\n\t\tStopped = 0x00000010,\n\t\tWaitSleepJoin = 0x00000020,\n\t\tSuspended = 0x00000040,\n\t\tAbortRequested = 0x00000080,\n\t\tAborted = 0x00000100,\n\t}\n\n}\n\n#endif\n"
  },
  {
    "path": "corlib/System.Threading/WaitHandle.cs",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !LOCALTEST\n\nusing System;\n\nnamespace System.Threading {\n\tpublic abstract class WaitHandle : MarshalByRefObject, IDisposable {\n\n\t\tpublic void Dispose() {\n\t\t}\n\n\t}\n}\n\n#endif\n"
  },
  {
    "path": "corlib/corlib.csproj",
    "content": "﻿<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\" ToolsVersion=\"4.0\">\n  <PropertyGroup>\n    <Configuration Condition=\" '$(Configuration)' == '' \">Debug</Configuration>\n    <Platform Condition=\" '$(Platform)' == '' \">AnyCPU</Platform>\n    <ProductVersion>9.0.21022</ProductVersion>\n    <SchemaVersion>2.0</SchemaVersion>\n    <ProjectGuid>{6A77A7C0-FB66-4CAA-94EE-142DBA20655D}</ProjectGuid>\n    <OutputType>Library</OutputType>\n    <AppDesignerFolder>Properties</AppDesignerFolder>\n    <RootNamespace>corlib</RootNamespace>\n    <AssemblyName>corlib</AssemblyName>\n    <FileUpgradeFlags>\n    </FileUpgradeFlags>\n    <UpgradeBackupLocation>\n    </UpgradeBackupLocation>\n    <OldToolsVersion>3.5</OldToolsVersion>\n    <IsWebBootstrapper>false</IsWebBootstrapper>\n    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\n    <PublishUrl>publish\\</PublishUrl>\n    <Install>true</Install>\n    <InstallFrom>Disk</InstallFrom>\n    <UpdateEnabled>false</UpdateEnabled>\n    <UpdateMode>Foreground</UpdateMode>\n    <UpdateInterval>7</UpdateInterval>\n    <UpdateIntervalUnits>Days</UpdateIntervalUnits>\n    <UpdatePeriodically>false</UpdatePeriodically>\n    <UpdateRequired>false</UpdateRequired>\n    <MapFileExtensions>true</MapFileExtensions>\n    <ApplicationRevision>0</ApplicationRevision>\n    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>\n    <UseApplicationTrust>false</UseApplicationTrust>\n    <BootstrapperEnabled>true</BootstrapperEnabled>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <DebugType>full</DebugType>\n    <Optimize>false</Optimize>\n    <OutputPath>bin\\Debug\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <FileAlignment>512</FileAlignment>\n    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>\n    <NoStdLib>true</NoStdLib>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' \">\n    <DebugType>pdbonly</DebugType>\n    <Optimize>true</Optimize>\n    <OutputPath>bin\\Release\\</OutputPath>\n    <DefineConstants>TRACE</DefineConstants>\n    <ErrorReport>prompt</ErrorReport>\n    <WarningLevel>4</WarningLevel>\n    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>\n    <NoStdLib>true</NoStdLib>\n    <FileAlignment>512</FileAlignment>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'LocalTest|AnyCPU' \">\n    <DebugSymbols>true</DebugSymbols>\n    <OutputPath>bin\\LocalTest\\</OutputPath>\n    <DefineConstants>TRACE;DEBUG;LOCALTEST</DefineConstants>\n    <FileAlignment>512</FileAlignment>\n    <NoStdLib>false</NoStdLib>\n    <DebugType>full</DebugType>\n    <PlatformTarget>AnyCPU</PlatformTarget>\n    <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>\n    <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>\n    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>\n    <ErrorReport>prompt</ErrorReport>\n    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>\n  </PropertyGroup>\n  <ItemGroup>\n    <Compile Include=\"System.Collections.Generic\\Comparer.cs\" />\n    <Compile Include=\"System.Collections.Generic\\Dictionary.cs\" />\n    <Compile Include=\"System.Collections.Generic\\EqualityComparer.cs\" />\n    <Compile Include=\"System.Collections.Generic\\GenericEqualityComparer.cs\" />\n    <Compile Include=\"System.Collections.Generic\\ICollection.cs\" />\n    <Compile Include=\"System.Collections.Generic\\IComparer.cs\" />\n    <Compile Include=\"System.Collections.Generic\\IDictionary.cs\" />\n    <Compile Include=\"System.Collections.Generic\\IEnumerable.cs\" />\n    <Compile Include=\"System.Collections.Generic\\IEnumerator.cs\" />\n    <Compile Include=\"System.Collections.Generic\\IEqualityComparer.cs\" />\n    <Compile Include=\"System.Collections.Generic\\IList.cs\" />\n    <Compile Include=\"System.Collections.Generic\\KeyNotFoundException.cs\" />\n    <Compile Include=\"System.Collections.Generic\\KeyValuePair.cs\" />\n    <Compile Include=\"System.Collections.Generic\\List.cs\" />\n    <Compile Include=\"System.Collections\\ArrayList.cs\" />\n    <Compile Include=\"System.Collections\\DictionaryEntry.cs\" />\n    <Compile Include=\"System.Collections\\ICollection.cs\" />\n    <Compile Include=\"System.Collections\\IComparer.cs\" />\n    <Compile Include=\"System.Collections\\IDictionary.cs\" />\n    <Compile Include=\"System.Collections\\IDictionaryEnumerator.cs\" />\n    <Compile Include=\"System.Collections\\IEnumerable.cs\" />\n    <Compile Include=\"System.Collections\\IEnumerator.cs\" />\n    <Compile Include=\"System.Collections\\IEqualityComparer.cs\" />\n    <Compile Include=\"System.Collections\\IList.cs\" />\n    <Compile Include=\"System.Diagnostics\\Debugger.cs\" />\n    <Compile Include=\"System.Globalization\\Calendar.cs\" />\n    <Compile Include=\"System.Globalization\\CalendarWeekRule.cs\" />\n    <Compile Include=\"System.Globalization\\CalendricalCalculations.cs\" />\n    <Compile Include=\"System.Globalization\\CultureInfo.cs\" />\n    <Compile Include=\"System.Globalization\\CultureTypes.cs\" />\n    <Compile Include=\"System.Globalization\\DateTimeFormatInfo.cs\" />\n    <Compile Include=\"System.Globalization\\DigitShapes.cs\" />\n    <Compile Include=\"System.Globalization\\GregorianCalendar.cs\" />\n    <Compile Include=\"System.Globalization\\GregorianCalendarTypes.cs\" />\n    <Compile Include=\"System.Globalization\\NumberFormatInfo.cs\" />\n    <Compile Include=\"System.Globalization\\NumberStyles.cs\" />\n    <Compile Include=\"System.Globalization\\TextInfo.cs\" />\n    <Compile Include=\"System.Globalization\\UnicodeCategory.cs\" />\n    <Compile Include=\"System.IO\\CheckArgument.cs\" />\n    <Compile Include=\"System.IO\\Directory.cs\" />\n    <Compile Include=\"System.IO\\DirectoryInfo.cs\" />\n    <Compile Include=\"System.IO\\DirectoryNotFoundException.cs\" />\n    <Compile Include=\"System.IO\\File.cs\" />\n    <Compile Include=\"System.IO\\FileAccess.cs\" />\n    <Compile Include=\"System.IO\\FileAttributes.cs\" />\n    <Compile Include=\"System.IO\\FileInfo.cs\" />\n    <Compile Include=\"System.IO\\FileInternal.cs\" />\n    <Compile Include=\"System.IO\\FileMode.cs\" />\n    <Compile Include=\"System.IO\\FileNotFoundException.cs\" />\n    <Compile Include=\"System.IO\\FileShare.cs\" />\n    <Compile Include=\"System.IO\\FileStream.cs\" />\n    <Compile Include=\"System.IO\\FileSystemInfo.cs\" />\n    <Compile Include=\"System.IO\\IOException.cs\" />\n    <Compile Include=\"System.IO\\Path.cs\" />\n    <Compile Include=\"System.IO\\SearchPattern.cs\" />\n    <Compile Include=\"System.IO\\SeekOrigin.cs\" />\n    <Compile Include=\"System.IO\\Stream.cs\" />\n    <Compile Include=\"System.IO\\StreamReader.cs\" />\n    <Compile Include=\"System.IO\\TextReader.cs\" />\n    <Compile Include=\"System.Reflection\\DefaultMemberAttribute.cs\" />\n    <Compile Include=\"System.Reflection\\MemberInfo.cs\" />\n    <Compile Include=\"System.Runtime.CompilerServices\\IndexerNameAttribute.cs\" />\n    <Compile Include=\"System.Runtime.CompilerServices\\MethodImplAttribute.cs\" />\n    <Compile Include=\"System.Runtime.CompilerServices\\MethodImplOptions.cs\" />\n    <Compile Include=\"System.Runtime.CompilerServices\\RuntimeHelpers.cs\" />\n    <Compile Include=\"System.Runtime.InteropServices\\CallingConvention.cs\" />\n    <Compile Include=\"System.Runtime.InteropServices\\CharSet.cs\" />\n    <Compile Include=\"System.Runtime.InteropServices\\DllImportAttribute.cs\" />\n    <Compile Include=\"System.Runtime.InteropServices\\ExternalException.cs\" />\n    <Compile Include=\"System.Runtime.InteropServices\\InAttribute.cs\" />\n    <Compile Include=\"System.Runtime.InteropServices\\OutAttribute.cs\" />\n    <Compile Include=\"System.Text\\Decoder.cs\" />\n    <Compile Include=\"System.Text\\Encoding.cs\" />\n    <Compile Include=\"System.Text\\UnicodeEncoding.cs\" />\n    <Compile Include=\"System.Text\\UTF8Encoding.cs\" />\n    <Compile Include=\"System.Threading\\Interlocked.cs\" />\n    <Compile Include=\"System.Threading\\Monitor.cs\" />\n    <Compile Include=\"System.Threading\\ParameterizedThreadStart.cs\" />\n    <Compile Include=\"System.Threading\\Thread.cs\" />\n    <Compile Include=\"System.Threading\\ThreadStart.cs\" />\n    <Compile Include=\"System.Threading\\ThreadState.cs\" />\n    <Compile Include=\"System.Threading\\WaitHandle.cs\" />\n    <Compile Include=\"System\\Action.cs\" />\n    <Compile Include=\"System\\Activator.cs\" />\n    <Compile Include=\"System\\ArgumentException.cs\" />\n    <Compile Include=\"System\\ArgumentNullException.cs\" />\n    <Compile Include=\"System\\ArgumentOutOfRangeException.cs\" />\n    <Compile Include=\"System\\ArithmeticException.cs\" />\n    <Compile Include=\"System\\Array.cs\" />\n    <Compile Include=\"System\\ArrayTypeMismatchException.cs\" />\n    <Compile Include=\"System\\AsyncCallback.cs\" />\n    <Compile Include=\"System\\Attribute.cs\" />\n    <Compile Include=\"System\\AttributeTargets.cs\" />\n    <Compile Include=\"System\\AttributeUsageAttribute.cs\" />\n    <Compile Include=\"System\\BitConverter.cs\" />\n    <Compile Include=\"System\\Boolean.cs\" />\n    <Compile Include=\"System\\Byte.cs\" />\n    <Compile Include=\"System\\Char.cs\" />\n    <Compile Include=\"System\\CharEnumerator.cs\" />\n    <Compile Include=\"System\\Console.cs\" />\n    <Compile Include=\"System\\ConsoleKey.cs\" />\n    <Compile Include=\"System\\ConsoleKeyInfo.cs\" />\n    <Compile Include=\"System\\ConsoleModifiers.cs\" />\n    <Compile Include=\"System\\Converter.cs\" />\n    <Compile Include=\"System\\DateTime.cs\" />\n    <Compile Include=\"System\\DateTimeKind.cs\" />\n    <Compile Include=\"System\\DayOfWeek.cs\" />\n    <Compile Include=\"System\\Decimal.cs\" />\n    <Compile Include=\"System\\Delegate.cs\" />\n    <Compile Include=\"System\\Double.cs\" />\n    <Compile Include=\"System\\Enum.cs\" />\n    <Compile Include=\"System\\Environment.cs\" />\n    <Compile Include=\"System\\Exception.cs\" />\n    <Compile Include=\"System\\FlagsAttribute.cs\" />\n    <Compile Include=\"System\\FormatException.cs\" />\n    <Compile Include=\"System\\GC.cs\" />\n    <Compile Include=\"System\\IAsyncResult.cs\" />\n    <Compile Include=\"System\\ICloneable.cs\" />\n    <Compile Include=\"System\\IComparable.cs\" />\n    <Compile Include=\"System\\ICustomFormatter.cs\" />\n    <Compile Include=\"System\\IDisposable.cs\" />\n    <Compile Include=\"System\\IEquatable.cs\" />\n    <Compile Include=\"System\\IFormatProvider.cs\" />\n    <Compile Include=\"System\\IFormattable.cs\" />\n    <Compile Include=\"System\\IndexOutOfRangeException.cs\" />\n    <Compile Include=\"System\\Int16.cs\" />\n    <Compile Include=\"System\\Int32.cs\" />\n    <Compile Include=\"System\\Int64.cs\" />\n    <Compile Include=\"System\\IntPtr.cs\" />\n    <Compile Include=\"System\\InvalidCastException.cs\" />\n    <Compile Include=\"System\\InvalidOperationException.cs\" />\n    <Compile Include=\"System\\MarshalByRefObject.cs\" />\n    <Compile Include=\"System\\Math.cs\" />\n    <Compile Include=\"System\\MulticastDelegate.cs\" />\n    <Compile Include=\"System\\MulticastNotSupportedException.cs\" />\n    <Compile Include=\"System\\NotImplementedException.cs\" />\n    <Compile Include=\"System\\NotSupportedException.cs\" />\n    <Compile Include=\"System\\Nullable.cs\" />\n    <Compile Include=\"System\\NullReferenceException.cs\" />\n    <Compile Include=\"System\\NumberFormatter.cs\" />\n    <Compile Include=\"System\\Object.cs\" />\n    <Compile Include=\"System\\ObjectDisposedException.cs\" />\n    <Compile Include=\"System\\OperatingSystem.cs\" />\n    <Compile Include=\"System\\OverflowException.cs\" />\n    <Compile Include=\"System\\ParamArrayAttribute.cs\" />\n    <Compile Include=\"System\\ParseHelper.cs\" />\n    <Compile Include=\"System\\PlatformID.cs\" />\n    <Compile Include=\"System\\Predicate.cs\" />\n    <Compile Include=\"System\\Random.cs\" />\n    <Compile Include=\"System\\RuntimeFieldHandle.cs\" />\n    <Compile Include=\"System\\RuntimeMethodHandle.cs\" />\n    <Compile Include=\"System\\RuntimeType.cs\" />\n    <Compile Include=\"System\\RuntimeTypeHandle.cs\" />\n    <Compile Include=\"System\\SByte.cs\" />\n    <Compile Include=\"System\\Single.cs\" />\n    <Compile Include=\"System\\String.cs\" />\n    <Compile Include=\"Properties\\AssemblyInfo.cs\" />\n    <Compile Include=\"System.Text\\StringBuilder.cs\" />\n    <Compile Include=\"System\\StringComparison.cs\" />\n    <Compile Include=\"System\\StringHelper.cs\" />\n    <Compile Include=\"System\\SystemException.cs\" />\n    <Compile Include=\"System\\TimeSpan.cs\" />\n    <Compile Include=\"System\\Type.cs\" />\n    <Compile Include=\"System\\UInt16.cs\" />\n    <Compile Include=\"System\\UInt32.cs\" />\n    <Compile Include=\"System\\UInt64.cs\" />\n    <Compile Include=\"System\\UIntPtr.cs\" />\n    <Compile Include=\"System\\ValueType.cs\" />\n    <Compile Include=\"System\\Version.cs\" />\n    <Compile Include=\"System\\Void.cs\" />\n    <Compile Include=\"System\\WeakReference.cs\" />\n  </ItemGroup>\n  <ItemGroup>\n    <BootstrapperPackage Include=\"Microsoft.Net.Client.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.2.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 2.0 %28x86%29</ProductName>\n      <Install>true</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.0\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.0 %28x86%29</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n    <BootstrapperPackage Include=\"Microsoft.Net.Framework.3.5.SP1\">\n      <Visible>False</Visible>\n      <ProductName>.NET Framework 3.5 SP1</ProductName>\n      <Install>false</Install>\n    </BootstrapperPackage>\n  </ItemGroup>\n  <Import Project=\"$(MSBuildBinPath)\\Microsoft.CSharp.targets\" />\n  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \n       Other similar extension points exist, see Microsoft.Common.targets.\n  <Target Name=\"BeforeBuild\">\n  </Target>\n  <Target Name=\"AfterBuild\">\n  </Target>\n  -->\n  <PropertyGroup>\n    <PostBuildEvent>xcopy $(TargetPath) $(SolutionDir)Builds\\$(ConfigurationName)\\ /Y</PostBuildEvent>\n  </PropertyGroup>\n</Project>"
  },
  {
    "path": "dna/Bugs.txt",
    "content": "Known Bugs that haven't yet been fixed\n--------------------------------------\n\nThere is a memory leak somewhere. Haven't looked into it much yet.\n\nThere is a problem with calling a generic method within a generic interface, when the\ncall-point is within a generic method itself.\nThis bug may have large implications for how the generic system works, so may be quite\na lot of work to fix.\nThis bug means that the LINQ .ThenBy() operator cannot work.\n\nIf a field in a nested class references the containing class then the memory/stack size of the type\nis not yet known, so function calls on the type fail, because the parameters size has been\ncalculated incorrectly.\n\nFinalization currently happens in any thread, when objects are allocated.\nShould probably change this to have a proper finalizer thread, like in the real .NET\n"
  },
  {
    "path": "dna/CIL_OpCodes.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#define CIL_NOP\t\t\t0x00\n\n#define CIL_LDARG_0\t\t0x02\n#define CIL_LDARG_1\t\t0x03\n#define CIL_LDARG_2\t\t0x04\n#define CIL_LDARG_3\t\t0x05\n#define CIL_LDLOC_0\t\t0x06\n#define CIL_LDLOC_1\t\t0x07\n#define CIL_LDLOC_2\t\t0x08\n#define CIL_LDLOC_3\t\t0x09\n#define CIL_STLOC_0\t\t0x0a\n#define CIL_STLOC_1\t\t0x0b\n#define CIL_STLOC_2\t\t0x0c\n#define CIL_STLOC_3\t\t0x0d\n#define CIL_LDARG_S\t\t0x0e\n#define CIL_LDARGA_S\t0x0f\n#define CIL_STARG_S\t\t0x10\n#define CIL_LDLOC_S\t\t0x11\n#define CIL_LDLOCA_S\t0x12\n#define CIL_STLOC_S\t\t0x13\n#define CIL_LDNULL\t\t0x14\n#define CIL_LDC_I4_M1\t0x15\n#define CIL_LDC_I4_0\t0x16\n#define CIL_LDC_I4_1\t0x17\n#define CIL_LDC_I4_2\t0x18\n#define CIL_LDC_I4_3\t0x19\n#define CIL_LDC_I4_4\t0x1a\n#define CIL_LDC_I4_5\t0x1b\n#define CIL_LDC_I4_6\t0x1c\n#define CIL_LDC_I4_7\t0x1d\n#define CIL_LDC_I4_8\t0x1e\n#define CIL_LDC_I4_S\t0x1f\n#define CIL_LDC_I4\t\t0x20\n#define CIL_LDC_I8\t\t0x21\n#define CIL_LDC_R4\t\t0x22\n#define CIL_LDC_R8\t\t0x23\n\n#define CIL_DUP\t\t\t0x25\n#define CIL_POP\t\t\t0x26\n\n#define CIL_CALL\t\t0x28\n\n#define CIL_RET\t\t\t0x2a\n#define CIL_BR_S\t\t0x2b\n#define CIL_BRFALSE_S\t0x2c\n#define CIL_BRTRUE_S\t0x2d\n#define CIL_BEQ_S\t\t0x2e\n#define CIL_BGE_S\t\t0x2f\n#define CIL_BGT_S\t\t0x30\n#define CIL_BLE_S\t\t0x31\n#define CIL_BLT_S\t\t0x32\n#define CIL_BNE_UN_S\t0x33\n#define CIL_BGE_UN_S\t0x34\n#define CIL_BGT_UN_S\t0x35\n#define CIL_BLE_UN_S\t0x36\n#define CIL_BLT_UN_S\t0x37\n#define CIL_BR\t\t\t0x38\n#define CIL_BRFALSE\t\t0x39\n#define CIL_BRTRUE\t\t0x3a\n#define CIL_BEQ\t\t\t0x3b\n#define CIL_BGE\t\t\t0x3c\n#define CIL_BGT\t\t\t0x3d\n#define CIL_BLE\t\t\t0x3e\n#define CIL_BLT\t\t\t0x3f\n#define CIL_BNE_UN\t\t0x40\n#define CIL_BGE_UN\t\t0x41\n#define CIL_BGT_UN\t\t0x42\n#define CIL_BLE_UN\t\t0x43\n#define CIL_BLT_UN\t\t0x44\n#define CIL_SWITCH\t\t0x45\n#define CIL_LDIND_I1\t0x46\n#define CIL_LDIND_U1\t0x47\n#define CIL_LDIND_I2\t0x48\n#define CIL_LDIND_U2\t0x49\n#define CIL_LDIND_I4\t0x4a\n#define CIL_LDIND_U4\t0x4b\n#define CIL_LDIND_I8\t0x4c\n#define CIL_LDIND_I\t\t0x4d\n#define CIL_LDIND_R4\t0x4e\n#define CIL_LDIND_R8\t0x4f\n#define CIL_LDIND_REF\t0x50\n#define CIL_STIND_REF\t0x51\n#define CIL_STIND_I1\t0x52\n#define CIL_STIND_I2\t0x53\n#define CIL_STIND_I4\t0x54\n\n#define CIL_ADD\t\t\t0x58\n#define CIL_SUB\t\t\t0x59\n#define CIL_MUL\t\t\t0x5a\n#define CIL_DIV\t\t\t0x5b\n#define CIL_DIV_UN\t\t0x5c\n#define CIL_REM\t\t\t0x5d\n#define CIL_REM_UN\t\t0x5e\n#define CIL_AND\t\t\t0x5f\n#define CIL_OR\t\t\t0x60\n#define CIL_XOR\t\t\t0x61\n#define CIL_SHL\t\t\t0x62\n#define CIL_SHR\t\t\t0x63\n#define CIL_SHR_UN\t\t0x64\n#define CIL_NEG\t\t\t0x65\n#define CIL_NOT\t\t\t0x66\n#define CIL_CONV_I1\t\t0x67\n#define CIL_CONV_I2\t\t0x68\n#define CIL_CONV_I4\t\t0x69\n#define CIL_CONV_I8\t\t0x6a\n#define CIL_CONV_R4\t\t0x6b\n#define CIL_CONV_R8\t\t0x6c\n#define CIL_CONV_U4\t\t0x6d\n#define CIL_CONV_U8\t\t0x6e\n#define CIL_CALLVIRT\t0x6f\n\n#define CIL_LDOBJ\t\t0x71\n#define CIL_LDSTR\t\t0x72\n#define CIL_NEWOBJ\t\t0x73\n#define CIL_CASTCLASS\t0x74\n#define CIL_ISINST\t\t0x75\n#define CIL_CONV_R_UN\t0x76\n\n#define CIL_THROW\t\t0x7a\n#define CIL_LDFLD\t\t0x7b\n#define CIL_LDFLDA\t\t0x7c\n#define CIL_STFLD\t\t0x7d\n#define CIL_LDSFLD\t\t0x7e\n#define CIL_LDSFLDA\t\t0x7f\n#define CIL_STSFLD\t\t0x80\n#define CIL_STOBJ\t\t0x81\n#define CIL_CONV_OVF_I1_UN\t0x82\n#define CIL_CONV_OVF_I2_UN\t0x83\n#define CIL_CONV_OVF_I4_UN\t0x84\n#define CIL_CONV_OVF_I8_UN\t0x85\n#define CIL_CONV_OVF_U1_UN\t0x86\n#define CIL_CONV_OVF_U2_UN\t0x87\n#define CIL_CONV_OVF_U4_UN\t0x88\n#define CIL_CONV_OVF_U8_UN\t0x89\n#define CIL_CONV_OVF_I_UN\t0x8a\n#define CIL_CONV_OVF_U_UN\t0x8b\n#define CIL_BOX\t\t\t0x8c\n#define CIL_NEWARR\t\t0x8d\n#define CIL_LDLEN\t\t0x8e\n#define CIL_LDELEMA\t\t0x8f\n#define CIL_LDELEM_I1\t0x90\n#define CIL_LDELEM_U1\t0x91\n#define CIL_LDELEM_I2\t0x92\n#define CIL_LDELEM_U2\t0x93\n#define CIL_LDELEM_I4\t0x94\n#define CIL_LDELEM_U4\t0x95\n#define CIL_LDELEM_I8\t0x96\n\n#define CIL_LDELEM_R4\t0x98\n#define CIL_LDELEM_R8\t0x99\n#define CIL_LDELEM_REF\t0x9a\n\n#define CIL_STELEM_I1\t0x9c\n#define CIL_STELEM_I2\t0x9d\n#define CIL_STELEM_I4\t0x9e\n#define CIL_STELEM_I8\t0x9f\n#define CIL_STELEM_R4\t0xa0\n#define CIL_STELEM_R8\t0xa1\n#define CIL_STELEM_REF\t0xa2\n#define CIL_LDELEM_ANY\t0xa3\n#define CIL_STELEM_ANY\t0xa4\n#define CIL_UNBOX_ANY\t0xa5\n\n#define CIL_CONV_OVF_I1\t0xb3\n#define CIL_CONV_OVF_U1\t0xb4\n#define CIL_CONV_OVF_I2\t0xb5\n#define CIL_CONV_OVF_U2\t0xb6\n#define CIL_CONV_OVF_I4\t0xb7\n#define CIL_CONV_OVF_U4\t0xb8\n#define CIL_CONV_OVF_I8\t0xb9\n#define CIL_CONV_OVF_U8\t0xba\n\n#define CIL_LDTOKEN\t\t0xd0\n#define CIL_CONV_U2\t\t0xd1\n#define CIL_CONV_U1\t\t0xd2\n#define CIL_CONV_I\t\t0xd3\n\n#define CIL_ADD_OVF\t\t0xd6\n#define CIL_ADD_OVF_UN\t0xd7\n#define CIL_MUL_OVF\t\t0xd8\n#define CIL_MUL_OVF_UN\t0xd9\n#define CIL_SUB_OVF\t\t0xda\n#define CIL_SUB_OVF_UN\t0xdb\n#define CIL_ENDFINALLY\t0xdc\n#define CIL_LEAVE\t\t0xdd\n#define CIL_LEAVE_S\t\t0xde\n\n#define CIL_CONV_U\t\t0xe0\n\n#define CIL_EXTENDED\t0xfe\n\n\n// Extended op-codes\n\n#define CILX_CEQ\t\t0x01\n#define CILX_CGT\t\t0x02\n#define CILX_CGT_UN\t\t0x03\n#define CILX_CLT\t\t0x04\n#define CILX_CLT_UN\t\t0x05\n#define CILX_LOADFUNCTION 0x06\n\n#define CILX_INITOBJ\t0x15\n#define CILX_CONSTRAINED 0x16\n\n#define CILX_RETHROW\t0x1a\n\n#define CILX_READONLY\t0x1e"
  },
  {
    "path": "dna/CLIFile.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"CLIFile.h\"\n#include \"RVA.h\"\n#include \"MetaData.h\"\n#include \"Thread.h\"\n#include \"MetaDataTables.h\"\n#include \"Type.h\"\n\n#include \"System.Array.h\"\n#include \"System.String.h\"\n\n// Is this exe/dll file for the .NET virtual machine?\n#define DOT_NET_MACHINE 0x14c\n\ntypedef struct tFilesLoaded_ tFilesLoaded;\nstruct tFilesLoaded_ {\n\ttCLIFile *pCLIFile;\n\ttFilesLoaded *pNext;\n};\n\n// Keep track of all the files currently loaded\nstatic tFilesLoaded *pFilesLoaded = NULL;\n\ntMetaData* CLIFile_GetMetaDataForAssembly(unsigned char *pAssemblyName) {\n\ttFilesLoaded *pFiles;\n\n\t// Convert \"mscorlib\" to \"corlib\"\n\tif (strcmp(pAssemblyName, \"mscorlib\") == 0) {\n\t\tpAssemblyName = \"corlib\";\n\t}\n\n\t// Look in already-loaded files first\n\tpFiles = pFilesLoaded;\n\twhile (pFiles != NULL) {\n\t\ttCLIFile *pCLIFile;\n\t\ttMD_Assembly *pThisAssembly;\n\n\t\tpCLIFile = pFiles->pCLIFile;\n\t\t// Get the assembly info - there is only ever one of these in the each file's metadata\n\t\tpThisAssembly = MetaData_GetTableRow(pCLIFile->pMetaData, MAKE_TABLE_INDEX(0x20, 1));\n\t\tif (strcmp(pAssemblyName, pThisAssembly->name) == 0) {\n\t\t\t// Found the correct assembly, so return its meta-data\n\t\t\treturn pCLIFile->pMetaData;\n\t\t}\n\t\tpFiles = pFiles->pNext;\n\t}\n\n\t// Assembly not loaded, so load it if possible\n\t{\n\t\ttCLIFile *pCLIFile;\n\t\tunsigned char fileName[128];\n\t\tsprintf(fileName, \"%s.dll\", pAssemblyName);\n\t\tpCLIFile = CLIFile_Load(fileName);\n\t\tif (pCLIFile == NULL) {\n\t\t\tCrash(\"Cannot load required assembly file: %s\", fileName);\n\t\t}\n\t\treturn pCLIFile->pMetaData;\n\t}\n}\n\nstatic void* LoadFileFromDisk(char *pFileName) {\n\tint f;\n\tvoid *pData = NULL;\n\n\tf = open(pFileName, O_RDONLY|O_BINARY);\n\tif (f >= 0) {\n\t\tint len;\n\t\tlen = lseek(f, 0, SEEK_END);\n\t\tlseek(f, 0, SEEK_SET);\n\t\t// TODO: Change to use mmap() or windows equivilent\n\t\tpData = mallocForever(len);\n\t\tif (pData != NULL) {\n\t\t\tint r = read(f, pData, len);\n\t\t\tif (r != len) {\n\t\t\t\tfree(pData);\n\t\t\t\tpData = NULL;\n\t\t\t}\n\t\t}\n\t\tclose(f);\n\t}\n\n\treturn pData;\n}\n\nstatic tCLIFile* LoadPEFile(void *pData) {\n\ttCLIFile *pRet = TMALLOC(tCLIFile);\n\n\tunsigned char *pMSDOSHeader = (unsigned char*)&(((unsigned char*)pData)[0]);\n\tunsigned char *pPEHeader;\n\tunsigned char *pPEOptionalHeader;\n\tunsigned char *pPESectionHeaders;\n\tunsigned char *pCLIHeader;\n\tunsigned char *pRawMetaData;\n\n\tint i;\n\tunsigned int lfanew;\n\tunsigned short machine;\n\tint numSections;\n\tunsigned int imageBase;\n\tint fileAlignment;\n\tunsigned int cliHeaderRVA, cliHeaderSize;\n\tunsigned int metaDataRVA, metaDataSize;\n\ttMetaData *pMetaData;\n\n\tpRet->pRVA = RVA();\n\tpRet->pMetaData = pMetaData = MetaData();\n\n\tlfanew = *(unsigned int*)&(pMSDOSHeader[0x3c]);\n\tpPEHeader = pMSDOSHeader + lfanew + 4;\n\tpPEOptionalHeader = pPEHeader + 20;\n\tpPESectionHeaders = pPEOptionalHeader + 224;\n\n\tmachine = *(unsigned short*)&(pPEHeader[0]);\n\tif (machine != DOT_NET_MACHINE) {\n\t\treturn NULL;\n\t}\n\tnumSections = *(unsigned short*)&(pPEHeader[2]);\n\n\timageBase = *(unsigned int*)&(pPEOptionalHeader[28]);\n\tfileAlignment = *(int*)&(pPEOptionalHeader[36]);\n\n\tfor (i=0; i<numSections; i++) {\n\t\tunsigned char *pSection = pPESectionHeaders + i * 40;\n\t\tRVA_Create(pRet->pRVA, pData, pSection);\n\t}\n\n\tcliHeaderRVA = *(unsigned int*)&(pPEOptionalHeader[208]);\n\tcliHeaderSize = *(unsigned int*)&(pPEOptionalHeader[212]);\n\n\tpCLIHeader = RVA_FindData(pRet->pRVA, cliHeaderRVA);\n\n\tmetaDataRVA = *(unsigned int*)&(pCLIHeader[8]);\n\tmetaDataSize = *(unsigned int*)&(pCLIHeader[12]);\n\tpRet->entryPoint = *(unsigned int*)&(pCLIHeader[20]);\n\tpRawMetaData = RVA_FindData(pRet->pRVA, metaDataRVA);\n\n\t// Load all metadata\n\t{\n\t\tunsigned int versionLen = *(unsigned int*)&(pRawMetaData[12]);\n\t\tunsigned int ofs, numberOfStreams;\n\t\tvoid *pTableStream = NULL;\n\t\tunsigned int tableStreamSize;\n\t\tpRet->pVersion = &(pRawMetaData[16]);\n\t\tlog_f(1, \"CLI version: %s\\n\", pRet->pVersion);\n\t\tofs = 16 + versionLen;\n\t\tnumberOfStreams = *(unsigned short*)&(pRawMetaData[ofs + 2]);\n\t\tofs += 4;\n\n\t\tfor (i=0; i<(signed)numberOfStreams; i++) {\n\t\t\tunsigned int streamOffset = *(unsigned int*)&pRawMetaData[ofs];\n\t\t\tunsigned int streamSize = *(unsigned int*)&pRawMetaData[ofs+4];\n\t\t\tunsigned char *pStreamName = &pRawMetaData[ofs+8];\n\t\t\tvoid *pStream = pRawMetaData + streamOffset;\n\t\t\tofs += (unsigned int)((strlen(pStreamName)+4) & (~0x3)) + 8;\n\t\t\tif (strcasecmp(pStreamName, \"#Strings\") == 0) {\n\t\t\t\tMetaData_LoadStrings(pMetaData, pStream, streamSize);\n\t\t\t} else if (strcasecmp(pStreamName, \"#US\") == 0) {\n\t\t\t\tMetaData_LoadUserStrings(pMetaData, pStream, streamSize);\n\t\t\t} else if (strcasecmp(pStreamName, \"#Blob\") == 0) {\n\t\t\t\tMetaData_LoadBlobs(pMetaData, pStream, streamSize);\n\t\t\t} else if (strcasecmp(pStreamName, \"#GUID\") == 0) {\n\t\t\t\tMetaData_LoadGUIDs(pMetaData, pStream, streamSize);\n\t\t\t} else if (strcasecmp(pStreamName, \"#~\") == 0) {\n\t\t\t\tpTableStream = pStream;\n\t\t\t\ttableStreamSize = streamSize;\n\t\t\t}\n\t\t}\n\t\t// Must load tables last\n\t\tif (pTableStream != NULL) {\n\t\t\tMetaData_LoadTables(pMetaData, pRet->pRVA, pTableStream, tableStreamSize);\n\t\t}\n\t}\n\n\t// Mark all generic definition types and methods as such\n\tfor (i=pMetaData->tables.numRows[MD_TABLE_GENERICPARAM]; i>0; i--) {\n\t\ttMD_GenericParam *pGenericParam;\n\t\tIDX_TABLE ownerIdx;\n\n\t\tpGenericParam = (tMD_GenericParam*)MetaData_GetTableRow\n\t\t\t(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_GENERICPARAM, i));\n\t\townerIdx = pGenericParam->owner;\n\t\tswitch (TABLE_ID(ownerIdx)) {\n\t\t\tcase MD_TABLE_TYPEDEF:\n\t\t\t\t{\n\t\t\t\t\ttMD_TypeDef *pTypeDef = (tMD_TypeDef*)MetaData_GetTableRow(pMetaData, ownerIdx);\n\t\t\t\t\tpTypeDef->isGenericDefinition = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase MD_TABLE_METHODDEF:\n\t\t\t\t{\n\t\t\t\t\ttMD_MethodDef *pMethodDef = (tMD_MethodDef*)MetaData_GetTableRow(pMetaData, ownerIdx);\n\t\t\t\t\tpMethodDef->isGenericDefinition = 1;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tCrash(\"Wrong generic parameter owner: 0x%08x\", ownerIdx);\n\t\t}\n\t}\n\n\t// Mark all nested classes as such\n\tfor (i=pMetaData->tables.numRows[MD_TABLE_NESTEDCLASS]; i>0; i--) {\n\t\ttMD_NestedClass *pNested;\n\t\ttMD_TypeDef *pParent, *pChild;\n\n\t\tpNested = (tMD_NestedClass*)MetaData_GetTableRow(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_NESTEDCLASS, i));\n\t\tpParent = (tMD_TypeDef*)MetaData_GetTableRow(pMetaData, pNested->enclosingClass);\n\t\tpChild = (tMD_TypeDef*)MetaData_GetTableRow(pMetaData, pNested->nestedClass);\n\t\tpChild->pNestedIn = pParent;\n\t}\n\n\treturn pRet;\n}\n\ntCLIFile* CLIFile_Load(char *pFileName) {\n\tvoid *pRawFile;\n\ttCLIFile *pRet;\n\ttFilesLoaded *pNewFile;\n\n\tpRawFile = LoadFileFromDisk(pFileName);\n\n\tif (pRawFile == NULL) {\n\t\tCrash(\"Cannot load file: %s\", pFileName);\n\t}\n\n\tlog_f(1, \"\\nLoading file: %s\\n\", pFileName);\n\n\tpRet = LoadPEFile(pRawFile);\n\tpRet->pFileName = (char*)mallocForever((U32)strlen(pFileName) + 1);\n\tstrcpy(pRet->pFileName, pFileName);\n\n\t// Record that we've loaded this file\n\tpNewFile = TMALLOCFOREVER(tFilesLoaded);\n\tpNewFile->pCLIFile = pRet;\n\tpNewFile->pNext = pFilesLoaded;\n\tpFilesLoaded = pNewFile;\n\n\treturn pRet;\n}\n\nI32 CLIFile_Execute(tCLIFile *pThis, int argc, char **argp) {\n\ttThread *pThread;\n\tHEAP_PTR args;\n\tint i;\n\n\t// Create a string array for the program arguments\n\t// Don't include the argument that is the program name.\n\targc--;\n\targp++;\n\targs = SystemArray_NewVector(types[TYPE_SYSTEM_ARRAY_STRING], argc);\n\tHeap_MakeUndeletable(args);\n\tfor (i = 0; i < argc; i++) {\n\t\tHEAP_PTR arg = SystemString_FromCharPtrASCII(argp[i]);\n\t\tSystemArray_StoreElement(args, i, (PTR)&arg);\n\t}\n\n\t// Create the main application thread\n\tpThread = Thread();\n\tThread_SetEntryPoint(pThread, pThis->pMetaData, pThis->entryPoint, (PTR)&args, sizeof(void*));\n\n\treturn Thread_Execute();\n}\n\nvoid CLIFile_GetHeapRoots(tHeapRoots *pHeapRoots) {\n\ttFilesLoaded *pFile;\n\n\tpFile = pFilesLoaded;\n\twhile (pFile != NULL) {\n\t\tMetaData_GetHeapRoots(pHeapRoots, pFile->pCLIFile->pMetaData);\n\t\tpFile = pFile->pNext;\n\t}\n}\n"
  },
  {
    "path": "dna/CLIFile.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined (__CLIFILE_H)\n#define __CLIFILE_H\n\n#include \"RVA.h\"\n#include \"Types.h\"\n#include \"MetaData.h\"\n\ntypedef struct tCLIFile_ tCLIFile;\nstruct tCLIFile_ {\n\t// The filename\n\tchar *pFileName;\n\t// The RVA sections of this file\n\ttRVA *pRVA;\n\t// NULL-terminated UTF8 string of file version\n\tunsigned char *pVersion;\n\t// The entry point token if this is executable, 0 if it isn't\n\tIDX_TABLE entryPoint;\n\n\ttMetaData *pMetaData;\n};\n\n// static methods\ntMetaData* CLIFile_GetMetaDataForAssembly(unsigned char *pAssemblyName);\nvoid CLIFile_GetHeapRoots(tHeapRoots *pHeapRoots);\n\n// instance methods\ntCLIFile* CLIFile_Load(char *pFileName);\nI32 CLIFile_Execute(tCLIFile *pThis, int argc, char **argp);\n\n#endif\n"
  },
  {
    "path": "dna/Compat.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined (__COMPAT_H)\n#define __COMPAT_H\n\n#include <stdio.h>\n#include <stdarg.h>\n#include <fcntl.h>\n\n#ifdef WIN32\n#include <winsock2.h> // winsock2.h must be included before windows.h\n#include <io.h>\n#include <windows.h>\n#include <conio.h>\n// Disable warning about deprecated functions\n#pragma warning(disable:4996)\n// Disable warning about converting pointer to int\n#pragma warning(disable:4311)\n// Disable warning about converting int to pointer\n#pragma warning(disable:4312)\n// convert warning to error about not all control paths return value in a function\n#pragma warning(error:4715)\n// convert warning to error about no return value in a function\n#pragma warning(error:4716)\n// convert warning to error about function must return a value\n#pragma warning(error:4033)\n// convert warning to error about no pointer mismatch\n#pragma warning(error:4022)\n// convert warning to error about pointer differs in indirection\n#pragma warning(error:4047)\n// convert warning to error about function undefined\n#pragma warning(error:4013)\n// convert warning to error about too many parameters to function call\n#pragma warning(error:4020)\n// convert warning to error about incompatible types\n#pragma warning(error:4133)\n// convert warning to error about different types for parameters in function call\n#pragma warning(error:4024)\n// convert warning to error about different parameter lists\n#pragma warning(error:4113)\n// convert warning to error about macro not enough parameters\n#pragma warning(error:4003)\n\n#define strcasecmp stricmp\n\n#define LIB_PREFIX \"\"\n#define LIB_SUFFIX \"dll\"\n#define STDCALL __stdcall\n\n#else // WIN32\n\n#include <stdlib.h>\n#include <strings.h>\n#include <sys/types.h>\n#include <sys/uio.h>\n#include <unistd.h>\n#include <termios.h>\n#include <sys/ioctl.h>\n#include <sys/types.h>\n#include <dev/wscons/wsconsio.h>\n#include <dlfcn.h>\n#include <glob.h>\n\n#define O_BINARY 0\n#define LIB_PREFIX \"./\"\n#define LIB_SUFFIX \"so\"\n#define STDCALL\n\n#endif // WIN32\n\n#define TMALLOC(t) (t*)malloc(sizeof(t))\n#define TMALLOCFOREVER(t) (t*)mallocForever(sizeof(t))\n\n#endif\n"
  },
  {
    "path": "dna/Config.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __CONFIG_H\n#define __CONFIG_H\n\n// Diagnostic stuff\n// Some of this will only work on Windows\n// (although could be implemented on other platforms with a little work.\n// The issue is that a very fast time function is needed. It uses the rdtsc\n// instruction on x86 - so the results are in ticks, not seconds)\n\n// Count how many times each .NET method is called\n#undef DIAG_METHOD_CALLS\n\n// Measure how much time is spent in each .NET opcode\n// This only works on Windows\n// This is not currently implemented, after the change to threaded code\n#undef DIAG_OPCODE_TIMES\n\n// Count how many times each .NET opcode is used\n#ifdef _DEBUG\n#undef DIAG_OPCODE_USE\n#endif\n\n// Measure how much time is spent in the garbage collector\n#undef DIAG_GC\n\n// Measure how long the entire .NET programme execution takes\n#define DIAG_TOTAL_TIME\n\n\n\n// Non-diagnostic stuff\n\n// Generate combined (dynamic) .NET opcodes.\n// This does work, but currently has no intellegence about which opcodes\n// are worth combining, so it uses lots of memory and on some platforms\n// will not lead to a performance increase.\n//#define GEN_COMBINED_OPCODES\n#define GEN_COMBINED_OPCODES_MAX_MEMORY 0x4000\n#define GEN_COMBINED_OPCODES_CALL_TRIGGER 20\n\n#endif\n"
  },
  {
    "path": "dna/Cultures/_",
    "content": "\n0x007f\n\nInvariant Language (Invariant Country)\nInvariant Language (Invariant Country)\nInvariant Language (Invariant Country)\niv\nIVL\nIVL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n66\n\nFalse\n1252\n37\nFalse\n,\n10000\n437\n2\n.\n,\n3\n0\n0\n¤\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, dd MMMM yyyy HH:mm:ss\ndddd, dd MMMM yyyy\nHH:mm:ss\nMMMM dd\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nHH:mm:ss\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nMM/dd/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy MMMM\n"
  },
  {
    "path": "dna/Cultures/af",
    "content": "af\n0x0036\n\nAfrikaans\nAfrikaans\nAfrikaans\naf\nafr\nAFK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\naf\nTrue\n1252\n500\nFalse\n,\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/af-ZA",
    "content": "af-ZA\n0x0436\naf\nAfrikaans (South Africa)\nAfrikaans (Suid Afrika)\nAfrikaans (South Africa)\naf\nafr\nAFK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\naf-ZA\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n2\n2\nR\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n1\n1\n%\n‰\nInfinity\n+\nSon,Maan,Dins,Woen,Dond,Vry,Sat\nJan,Feb,Mar,Apr,Mei,Jun,Jul,Aug,Sep,Okt,Nov,Des,\nJan,Feb,Mar,Apr,Mei,Jun,Jul,Aug,Sep,Okt,Nov,Des,\n\n0\n/\nSondag,Maandag,Dinsdag,Woensdag,Donderdag,Vrydag,Saterdag\n0\ndd MMMM yyyy hh:mm:ss tt\ndd MMMM yyyy\nhh:mm:ss tt\ndd MMMM\nJanuarie,Februarie,Maart,April,Mei,Junie,Julie,Augustus,September,Oktober,November,Desember,\nJanuarie,Februarie,Maart,April,Mei,Junie,Julie,Augustus,September,Oktober,November,Desember,\nGregoriaanse kalender\nhh:mm:ss tt\nnm\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/MM/dd\nSo,Ma,Di,Wo,Do,Vr,Sa\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/ar",
    "content": "ar\n0x0001\n\nArabic\nالعربية\nArabic\nar\nara\nARA\nHijriCalendar\nHijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:Localized,GregorianCalendar:TransliteratedFrench\n65\nar\nTrue\n1256\n20420\nTrue\n;\n10004\n720\n"
  },
  {
    "path": "dna/Cultures/ar-AE",
    "content": "ar-AE\n0x3801\nar\nArabic (U.A.E.)\nالعربية (الإمارات العربية المتحدة)\nArabic (U.A.E.)\nar\nara\nARU\nGregorianCalendar:Localized\nGregorianCalendar:Localized,UmAlQuraCalendar,HijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedFrench\n70\nar-AE\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nد.إ.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية إنجليزية)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-BH",
    "content": "ar-BH\n0x3c01\nar\nArabic (Bahrain)\nالعربية (البحرين)\nArabic (Bahrain)\nar\nara\nARH\nGregorianCalendar:Localized\nGregorianCalendar:Localized,UmAlQuraCalendar,HijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedFrench\n70\nar-BH\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n3\n.\n,\n3\n3\n2\nد.ب.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n3\n.\n,\n3\n3\n3\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية إنجليزية)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-DZ",
    "content": "ar-DZ\n0x1401\nar\nArabic (Algeria)\nالعربية (الجزائر)\nArabic (Algeria)\nar\nara\nARG\nGregorianCalendar:Localized\nGregorianCalendar:Localized,HijriCalendar,UmAlQuraCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedEnglish\n70\nar-DZ\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nد.ج.‏\n1\nليس برقم\n0,1,2,3,4,5,6,7,8,9\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nجانفييه,فيفرييه,مارس,أفريل,مي,جوان,جوييه,أوت,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nجانفييه,فيفرييه,مارس,أفريل,مي,جوان,جوييه,أوت,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n-\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy H:mm:ss\ndd MMMM, yyyy\nH:mm:ss\ndd MMMM\nجانفييه,فيفرييه,مارس,أفريل,مي,جوان,جوييه,أوت,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nجانفييه,فيفرييه,مارس,أفريل,مي,جوان,جوييه,أوت,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية فرنسية)‏\nH:mm:ss\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nأ,ا,ث,أ,خ,ج,س\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-EG",
    "content": "ar-EG\n0x0c01\nar\nArabic (Egypt)\nالعربية (مصر)\nArabic (Egypt)\nar\nara\nARE\nGregorianCalendar:Localized\nGregorianCalendar:Localized,UmAlQuraCalendar,HijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedFrench\n70\nar-EG\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n3\n.\n,\n3\n3\n2\nج.م.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n3\n.\n,\n3\n3\n3\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية إنجليزية)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-IQ",
    "content": "ar-IQ\n0x0801\nar\nArabic (Iraq)\nالعربية (العراق)\nArabic (Iraq)\nar\nara\nARI\nGregorianCalendar:Localized\nGregorianCalendar:Localized,UmAlQuraCalendar,HijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:TransliteratedEnglish,GregorianCalendar:TransliteratedFrench\n70\nar-IQ\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nد.ع.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nالتقويم الميلادي (عربي)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-JO",
    "content": "ar-JO\n0x2c01\nar\nArabic (Jordan)\nالعربية (الأردن)\nArabic (Jordan)\nar\nara\nARJ\nGregorianCalendar:Localized\nGregorianCalendar:Localized,UmAlQuraCalendar,HijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:TransliteratedEnglish,GregorianCalendar:TransliteratedFrench\n70\nar-JO\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n3\n.\n,\n3\n3\n2\nد.ا.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n3\n.\n,\n3\n3\n3\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nالتقويم الميلادي (عربي)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-KW",
    "content": "ar-KW\n0x3401\nar\nArabic (Kuwait)\nالعربية (الكويت)\nArabic (Kuwait)\nar\nara\nARK\nGregorianCalendar:Localized\nGregorianCalendar:Localized,HijriCalendar,UmAlQuraCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedFrench\n70\nar-KW\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n3\n.\n,\n3\n3\n2\nد.ك.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n3\n.\n,\n3\n3\n3\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية إنجليزية)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-LB",
    "content": "ar-LB\n0x3001\nar\nArabic (Lebanon)\nالعربية (لبنان)\nArabic (Lebanon)\nar\nara\nARB\nGregorianCalendar:Localized\nGregorianCalendar:Localized,UmAlQuraCalendar,HijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:TransliteratedEnglish,GregorianCalendar:TransliteratedFrench\n70\nar-LB\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nل.ل.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n1\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nالتقويم الميلادي (عربي)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-LY",
    "content": "ar-LY\n0x1001\nar\nArabic (Libya)\nالعربية (ليبيا)\nArabic (Libya)\nar\nara\nARL\nGregorianCalendar:Localized\nGregorianCalendar:Localized,HijriCalendar,UmAlQuraCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedFrench\n70\nar-LY\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nد.ل.‏\n1\nليس برقم\n0,1,2,3,4,5,6,7,8,9\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية إنجليزية)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-MA",
    "content": "ar-MA\n0x1801\nar\nArabic (Morocco)\nالعربية (المملكة المغربية)\nArabic (Morocco)\nar\nara\nARM\nGregorianCalendar:Localized\nGregorianCalendar:Localized,HijriCalendar,UmAlQuraCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedEnglish\n70\nar-MA\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nد.م.‏\n1\nليس برقم\n0,1,2,3,4,5,6,7,8,9\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nيناير,فبراير,مارس,ابريل,ماي,يونيو,يوليوز,غشت,شتنبر,اكتوبر,نونبر,دجنبر,\nيناير,فبراير,مارس,ابريل,ماي,يونيو,يوليوز,غشت,شتنبر,اكتوبر,نونبر,دجنبر,\nص\n0\n-\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n1\ndd MMMM, yyyy H:mm:ss\ndd MMMM, yyyy\nH:mm:ss\ndd MMMM\nيناير,فبراير,مارس,ابريل,ماي,يونيو,يوليوز,غشت,شتنبر,اكتوبر,نونبر,دجنبر,\nيناير,فبراير,مارس,ابريل,ماي,يونيو,يوليوز,غشت,شتنبر,اكتوبر,نونبر,دجنبر,\nالتقويم الميلادي (تسمية فرنسية)‏\nH:mm:ss\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nأ,ا,ث,أ,خ,ج,س\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-OM",
    "content": "ar-OM\n0x2001\nar\nArabic (Oman)\nالعربية (عمان)\nArabic (Oman)\nar\nara\nARO\nGregorianCalendar:Localized\nGregorianCalendar:Localized,HijriCalendar,UmAlQuraCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedFrench\n70\nar-OM\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nر.ع.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية إنجليزية)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-QA",
    "content": "ar-QA\n0x4001\nar\nArabic (Qatar)\nالعربية (قطر)\nArabic (Qatar)\nar\nara\nARQ\nGregorianCalendar:Localized\nGregorianCalendar:Localized,UmAlQuraCalendar,HijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedFrench\n70\nar-QA\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nر.ق.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية إنجليزية)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-SA",
    "content": "ar-SA\n0x0401\nar\nArabic (Saudi Arabia)\nالعربية (المملكة العربية السعودية)\nArabic (Saudi Arabia)\nar\nara\nARA\nHijriCalendar\nHijriCalendar,UmAlQuraCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:Localized,GregorianCalendar:TransliteratedFrench\n70\nar-SA\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nر.س.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nمحرم,صفر,ربيع الاول,ربيع الثاني,جمادى الاولى,جمادى الثانية,رجب,شعبان,رمضان,شوال,ذو القعدة,ذو الحجة,\nمحرم,صفر,ربيع الاول,ربيع الثاني,جمادى الاولى,جمادى الثانية,رجب,شعبان,رمضان,شوال,ذو القعدة,ذو الحجة,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd/MMMM/yyyy hh:mm:ss tt\ndd/MMMM/yyyy\nhh:mm:ss tt\ndd MMMM\nمحرم,صفر,ربيع الأول,ربيع الثاني,جمادى الأولى,جمادى الثانية,رجب,شعبان,رمضان,شوال,ذو القعدة,ذو الحجة,\nمحرم,صفر,ربيع الأول,ربيع الثاني,جمادى الأولى,جمادى الثانية,رجب,شعبان,رمضان,شوال,ذو القعدة,ذو الحجة,\nالتقويم الهجري\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yy\nح,ن,ث,ر,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-SY",
    "content": "ar-SY\n0x2801\nar\nArabic (Syria)\nالعربية (سوريا)\nArabic (Syria)\nar\nara\nARS\nGregorianCalendar:Localized\nGregorianCalendar:Localized,UmAlQuraCalendar,HijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:TransliteratedEnglish,GregorianCalendar:TransliteratedFrench\n70\nar-SY\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nل.س.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nكانون الثاني,شباط,آذار,نيسان,أيار,حزيران,تموز,آب,أيلول,تشرين الأول,تشرين الثاني,كانون الأول,\nالتقويم الميلادي (عربي)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-TN",
    "content": "ar-TN\n0x1c01\nar\nArabic (Tunisia)\nالعربية (تونس)\nArabic (Tunisia)\nar\nara\nART\nGregorianCalendar:Localized\nGregorianCalendar:Localized,HijriCalendar,UmAlQuraCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedEnglish\n70\nar-TN\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n3\n.\n,\n3\n3\n2\nد.ت.‏\n1\nليس برقم\n0,1,2,3,4,5,6,7,8,9\n-لا نهاية\n-\n3\n.\n,\n3\n3\n3\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nجانفي,فيفري,مارس,افريل,ماي,جوان,جويلية,اوت,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nجانفي,فيفري,مارس,افريل,ماي,جوان,جويلية,اوت,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n-\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n1\ndd MMMM, yyyy H:mm:ss\ndd MMMM, yyyy\nH:mm:ss\ndd MMMM\nجانفي,فيفري,مارس,افريل,ماي,جوان,جويلية,اوت,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nجانفي,فيفري,مارس,افريل,ماي,جوان,جويلية,اوت,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية فرنسية)‏\nH:mm:ss\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nأ,ا,ث,أ,خ,ج,س\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ar-YE",
    "content": "ar-YE\n0x2401\nar\nArabic (Yemen)\nالعربية (اليمن)\nArabic (Yemen)\nar\nara\nARY\nGregorianCalendar:Localized\nGregorianCalendar:Localized,UmAlQuraCalendar,HijriCalendar,GregorianCalendar:USEnglish,GregorianCalendar:MiddleEastFrench,GregorianCalendar:Arabic,GregorianCalendar:TransliteratedFrench\n70\nar-YE\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n2\nر.ي.‏\n0\nليس برقم\n٠,١,٢,٣,٤,٥,٦,٧,٨,٩\n-لا نهاية\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\n+لا نهاية\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nص\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nيناير,فبراير,مارس,ابريل,مايو,يونيو,يوليو,اغسطس,سبتمبر,اكتوبر,نوفمبر,ديسمبر,\nالتقويم الميلادي (تسمية إنجليزية)‏\nhh:mm:ss tt\nم\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nأ,ا,ث,أ,خ,ج,س\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/az",
    "content": "az\n0x002c\n\nAzeri\nAzərbaycan­ılı\nAzeri\naz\naze\nAZE\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\naz\nTrue\n1254\n20905\nFalse\n;\n10081\n857\n"
  },
  {
    "path": "dna/Cultures/az-Cyrl-AZ",
    "content": "az-Cyrl-AZ\n0x082c\naz\nAzeri (Cyrillic, Azerbaijan)\nАзәрбајҹан (Азәрбајҹан)\nAzeri (Cyrillic, Azerbaijan)\naz\naze\nAZE\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\naz-Cyrl-AZ\nFalse\n1251\n20880\nFalse\n;\n10007\n866\n2\n,\n \n3\n8\n3\nман.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nInfinity\n+\nБ,Бе,Ча,Ч,Ҹа,Ҹ,Ш\nЈан,Фев,Мар,Апр,мая,ијун,ијул,Авг,Сен,Окт,Ноя,Дек,\nЈан,Фев,Мар,Апр,Мај,Ијун,Ијул,Авг,Сен,Окт,Ноя,Дек,\n\n0\n.\nБазар,Базар ертәси,Чәршәнбә ахшамы,Чәршәнбә,Ҹүмә ахшамы,Ҹүмә,Шәнбә\n1\nd MMMM yyyy H:mm:ss\nd MMMM yyyy\nH:mm:ss\nd MMMM\nјанвар,феврал,март,апрел,мај,ијун,ијул,август,сентјабр,октјабр,нојабр,декабр,\nЈанвар,Феврал,Март,Апрел,Мај,Ијун,Ијул,Август,Сентјабр,Октјабр,Нојабр,Декабр,\nГриуориан\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nБ,Бе,Ча,Ч,Ҹа,Ҹ,Ш\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/az-Latn-AZ",
    "content": "az-Latn-AZ\n0x042c\naz\nAzeri (Latin, Azerbaijan)\nAzərbaycan­ılı (Azərbaycanca)\nAzeri (Latin, Azerbaijan)\naz\naze\nAZE\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\naz-Latn-AZ\nFalse\n1254\n20905\nFalse\n;\n10081\n857\n2\n,\n \n3\n8\n3\nman.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nInfinity\n+\nB,Be,Ça,Ç,Ca,C,Ş\nYan,Fev,Mar,Apr,May,İyun,İyul,Avg,Sen,Okt,Noy,Dek,\nYan,Fev,Mar,Apr,May,İyun,İyul,Avg,Sen,Okt,Noy,Dek,\n\n0\n.\nBazar,Bazar ertəsi,Çərşənbə axşamı,Çərşənbə,Cümə axşamı,Cümə,Şənbə\n1\nd MMMM yyyy H:mm:ss\nd MMMM yyyy\nH:mm:ss\nd MMMM\nyanvar,fevral,mart,aprel,may,iyun,iyul,avgust,sentyabr,oktyabr,noyabr,dekabr,\nYanvar,Fevral,Mart,Aprel,May,İyun,İyul,Avgust,Sentyabr,Oktyabr,Noyabr,Dekabr,\nQriqorian\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nB,Be,Ça,Ç,Ca,C,Ş\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/be",
    "content": "be\n0x0023\n\nBelarusian\nБеларускі\nBelarusian\nbe\nbel\nBEL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nbe\nTrue\n1251\n500\nFalse\n;\n10007\n866\n"
  },
  {
    "path": "dna/Cultures/be-BY",
    "content": "be-BY\n0x0423\nbe\nBelarusian (Belarus)\nБеларускі (Беларусь)\nBelarusian (Belarus)\nbe\nbel\nBEL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nbe-BY\nFalse\n1251\n500\nFalse\n;\n10007\n866\n2\n,\n \n3\n8\n3\nр.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\nнд,пн,аў,ср,чц,пт,сб\nСту,Лют,Сак,Кра,Май,Чэр,Ліп,Жні,Вер,Кас,Ліс,Сне,\nСту,Лют,Сак,Кра,Май,Чэр,Ліп,Жні,Вер,Кас,Ліс,Сне,\n\n0\n.\nнядзеля,панядзелак,аўторак,серада,чацвер,пятніца,субота\n1\nd MMMM yyyy H:mm:ss\nd MMMM yyyy\nH:mm:ss\nd MMMM\nстудзеня,лютага,сакавіка,красавіка,мая,чэрвеня,ліпеня,жніўня,верасня,кастрычніка,лістапада,снежня,\nСтудзень,Люты,Сакавік,Красавік,Май,Чэрвень,Ліпень,Жнівень,Верасень,Кастрычнік,Лістапад,Снежань,\nгригорианский календарь\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nнд,пн,аў,ср,чц,пт,сб\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/bg",
    "content": "bg\n0x0002\n\nBulgarian\nбългарски\nBulgarian\nbg\nbul\nBGR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nbg\nTrue\n1251\n20420\nFalse\n;\n10007\n866\n"
  },
  {
    "path": "dna/Cultures/bg-BG",
    "content": "bg-BG\n0x0402\nbg\nBulgarian (Bulgaria)\nбългарски (България)\nBulgarian (Bulgaria)\nbg\nbul\nBGR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nbg-BG\nFalse\n1251\n20420\nFalse\n;\n10007\n866\n2\n,\n \n3\n8\n3\nлв\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\nНд,Пн,Вт,Ср,Чт,Пт,Сб\nЯнуари,Февруари,Март,Април,Май,Юни,Юли,Август,Септември,Октомври,Ноември,Декември,\nЯнуари,Февруари,Март,Април,Май,Юни,Юли,Август,Септември,Октомври,Ноември,Декември,\n\n0\n.\nнеделя,понеделник,вторник,сряда,четвъртък,петък,събота\n1\ndd MMMM yyyy 'г.' HH:mm:ss\ndd MMMM yyyy 'г.'\nHH:mm:ss\ndd MMMM\nЯнуари,Февруари,Март,Април,Май,Юни,Юли,Август,Септември,Октомври,Ноември,Декември,\nЯнуари,Февруари,Март,Април,Май,Юни,Юли,Август,Септември,Октомври,Ноември,Декември,\nГрегориански календар\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.M.yyyy 'г.'\nне,по,вт,ср,че,пе,съ\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy 'г.'\n"
  },
  {
    "path": "dna/Cultures/bn-IN",
    "content": "bn-IN\n0x0445\n\nBengali (India)\nবাঢলা (ভারত)\nBengali (India)\nbn\nbn\nBNG\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nbn-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nটা\n1\nNaN\n০,১,২,৩,৪,৫,৬,৭,৮,৯\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nরবি.,সোম.,মঙ্গল.,বুধ.,বৃহস্পতি.,শুক্র.,শফি.\nজানু.,ফেব্রু.,মার্চ,এপ্রিল,মে,জুন,জুলাই,আগ.,সেপ্টে.,অক্টো.,নভে.,ডিসে.,\nজানু.,ফেব্রু.,মার্চ,এপ্রিল,মে,জুন,জুলাই,আগ.,সেপ্টে.,অক্টো.,নভে.,ডিসে.,\nপুর্বাহ্ফ\n0\n-\nরবিবার,সোমবার,মঙ্গলবার,বুধবার,বৃহস্পতিবার,শুক্রবার,শফিবার\n1\ndd MMMM yyyy HH.mm.ss\ndd MMMM yyyy\nHH.mm.ss\nMMMM dd\nজানুয়ারী,ফেব্রুয়ারী,মার্চ,এপ্রিল,মে,জুন,জুলাই,আগস্ট,সেপ্টেম্বর,অক্টোবর,নভেম্বর,ডিসেম্বর,\nজানুয়ারী,ফেব্রুয়ারী,মার্চ,এপ্রিল,মে,জুন,জুলাই,আগস্ট,সেপ্টেম্বর,অক্টোবর,নভেম্বর,ডিসেম্বর,\nইঙ্গ্রজী ক্য়ালেণ্ডর\nHH.mm.ss\nঅপরাহ্ফ\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yy\nরবি.,সোম.,মঙ্গল.,বুধ.,বৃহস্পতি.,শুক্র.,শফি.\nHH.mm.ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n.\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/bs-Latn-BA",
    "content": "bs-Latn-BA\n0x141a\n\nBosnian (Bosnia and Herzegovina)\nbosanski (Bosna i Hercegovina)\nBosnian (Latin, Bosnia and Herzegovina)\nbs\nbs\nBSB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nbs-Latn-BA\nFalse\n1250\n870\nFalse\n;\n10082\n852\n2\n,\n.\n3\n8\n3\nKM\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nned,pon,uto,sri,čet,pet,sub\njan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec,\njan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec,\n\n0\n.\nnedjelja,ponedjeljak,utorak,srijeda,četvrtak,petak,subota\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\nMMMM dd\njanuar,februar,mart,april,maj,jun,jul,avgust,septembar,oktobar,novembar,decembar,\njanuar,februar,mart,april,maj,jun,jul,avgust,septembar,oktobar,novembar,decembar,\ngregorijanski kalendar\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nned,pon,uto,sri,čet,pet,sub\nH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/ca",
    "content": "ca\n0x0003\n\nCatalan\ncatalà\nCatalan\nca\ncat\nCAT\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nca\nTrue\n1252\n500\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/ca-ES",
    "content": "ca-ES\n0x0403\nca\nCatalan (Catalan)\ncatalà (català)\nCatalan (Catalan)\nca\ncat\nCAT\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nca-ES\nFalse\n1252\n500\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\n€\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinit\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinit\n+\ndg.,dl.,dt.,dc.,dj.,dv.,ds.\ngen,feb,març,abr,maig,juny,jul,ag,set,oct,nov,des,\ngen,feb,març,abr,maig,juny,jul,ag,set,oct,nov,des,\n\n0\n/\ndiumenge,dilluns,dimarts,dimecres,dijous,divendres,dissabte\n1\ndddd, d' / 'MMMM' / 'yyyy HH:mm:ss\ndddd, d' / 'MMMM' / 'yyyy\nHH:mm:ss\ndd MMMM\ngener,febrer,març,abril,maig,juny,juliol,agost,setembre,octubre,novembre,desembre,\ngener,febrer,març,abril,maig,juny,juliol,agost,setembre,octubre,novembre,desembre,\ncalendari gregorià\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndg,dl,dt,dc,dj,dv,ds\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' / 'yyyy\n"
  },
  {
    "path": "dna/Cultures/cs",
    "content": "cs\n0x0005\n\nCzech\nčeština\nCzech\ncs\nces\nCSY\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\ncs\nTrue\n1250\n500\nFalse\n;\n10029\n852\n"
  },
  {
    "path": "dna/Cultures/cs-CZ",
    "content": "cs-CZ\n0x0405\ncs\nCzech (Czech Republic)\nčeština (Česká republika)\nCzech (Czech Republic)\ncs\nces\nCSY\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\ncs-CZ\nFalse\n1250\n500\nFalse\n;\n10029\n852\n2\n,\n \n3\n8\n3\nKč\n1\nNení číslo\n0,1,2,3,4,5,6,7,8,9\n-nekonečno\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\n+nekonečno\n+\nne,po,út,st,čt,pá,so\nI,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII,\nI,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII,\ndop.\n0\n.\nneděle,pondělí,úterý,středa,čtvrtek,pátek,sobota\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\ndd MMMM\nledna,února,března,dubna,května,června,července,srpna,září,října,listopadu,prosince,\nleden,únor,březen,duben,květen,červen,červenec,srpen,září,říjen,listopad,prosinec,\ngregoriánský kalendář\nH:mm:ss\nodp.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nne,po,út,st,čt,pá,so\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/cy-GB",
    "content": "cy-GB\n0x0452\n\nWelsh (United Kingdom)\nCymraeg (y Deyrnas Unedig)\nWelsh\ncy\ncy\nCYM\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\ncy-GB\nFalse\n1252\n20285\nFalse\n,\n10000\n850\n2\n.\n,\n3\n1\n0\n£\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSul,Llun,Maw,Mer,Iau,Gwe,Sad\nIon,Chwe,Maw,Ebr,Mai,Meh,Gor,Aws,Med,Hyd,Tach,Rhag,\nIon,Chwe,Maw,Ebr,Mai,Meh,Gor,Aws,Med,Hyd,Tach,Rhag,\na.m.\n0\n/\nDydd Sul,Dydd Llun,Dydd Mawrth,Dydd Mercher,Dydd Iau,Dydd Gwener,Dydd Sadwrn\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\nMMMM dd\nIonawr,Chwefror,Mawrth,Ebrill,Mai,Mehefin,Gorffennaf,Awst,Medi,Hydref,Tachwedd,Rhagfyr,\nIonawr,Chwefror,Mawrth,Ebrill,Mai,Mehefin,Gorffennaf,Awst,Medi,Hydref,Tachwedd,Rhagfyr,\ncalendr Gregori\nHH:mm:ss\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nSul,Llun,Maw,Mer,Iau,Gwe,Sad\nHH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/da",
    "content": "da\n0x0006\n\nDanish\ndansk\nDanish\nda\ndan\nDAN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nda\nTrue\n1252\n20277\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/da-DK",
    "content": "da-DK\n0x0406\nda\nDanish (Denmark)\ndansk (Danmark)\nDanish (Denmark)\nda\ndan\nDAN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nda-DK\nFalse\n1252\n20277\nFalse\n;\n10000\n850\n2\n,\n.\n3\n12\n2\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-INF\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nINF\n+\nsø,ma,ti,on,to,fr,lø\njan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec,\njan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec,\n\n2\n-\nsøndag,mandag,tirsdag,onsdag,torsdag,fredag,lørdag\n1\nd. MMMM yyyy HH:mm:ss\nd. MMMM yyyy\nHH:mm:ss\nd. MMMM\njanuar,februar,marts,april,maj,juni,juli,august,september,oktober,november,december,\njanuar,februar,marts,april,maj,juni,juli,august,september,oktober,november,december,\nDen gregorianske kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nsø,ma,ti,on,to,fr,lø\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/de",
    "content": "de\n0x0007\n\nGerman\nDeutsch\nGerman\nde\ndeu\nDEU\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nde\nTrue\n1252\n20273\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/de-AT",
    "content": "de-AT\n0x0c07\nde\nGerman (Austria)\nDeutsch (Österreich)\nGerman (Austria)\nde\ndeu\nDEA\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nde-AT\nFalse\n1252\n20273\nFalse\n;\n10000\n850\n2\n,\n.\n3\n9\n2\n€\n1\nn. def.\n0,1,2,3,4,5,6,7,8,9\n-unendlich\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\n+unendlich\n+\nSo,Mo,Di,Mi,Do,Fr,Sa\nJän,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\nJän,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\n\n0\n.\nSonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag\n1\ndddd, dd. MMMM yyyy HH:mm:ss\ndddd, dd. MMMM yyyy\nHH:mm:ss\ndd MMMM\nJänner,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nJänner,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nGregorianischer Kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nSo,Mo,Di,Mi,Do,Fr,Sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/de-CH",
    "content": "de-CH\n0x0807\nde\nGerman (Switzerland)\nDeutsch (Schweiz)\nGerman (Switzerland)\nde\ndeu\nDES\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nde-CH\nFalse\n1252\n20273\nFalse\n;\n10000\n850\n2\n.\n'\n3\n2\n2\nSFr.\n1\nn. def.\n0,1,2,3,4,5,6,7,8,9\n-unendlich\n-\n2\n.\n'\n3\n1\n2\n.\n'\n3\n1\n1\n%\n‰\n+unendlich\n+\nSo,Mo,Di,Mi,Do,Fr,Sa\nJan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\nJan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\n\n2\n.\nSonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag\n1\ndddd, d. MMMM yyyy HH:mm:ss\ndddd, d. MMMM yyyy\nHH:mm:ss\ndd MMMM\nJanuar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nJanuar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nGregorianischer Kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nSo,Mo,Di,Mi,Do,Fr,Sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/de-DE",
    "content": "de-DE\n0x0407\nde\nGerman (Germany)\nDeutsch (Deutschland)\nGerman (Germany)\nde\ndeu\nDEU\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nde-DE\nFalse\n1252\n20273\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\n€\n1\nn. def.\n0,1,2,3,4,5,6,7,8,9\n-unendlich\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\n+unendlich\n+\nSo,Mo,Di,Mi,Do,Fr,Sa\nJan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\nJan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\n\n2\n.\nSonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag\n1\ndddd, d. MMMM yyyy HH:mm:ss\ndddd, d. MMMM yyyy\nHH:mm:ss\ndd MMMM\nJanuar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nJanuar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nGregorianischer Kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nSo,Mo,Di,Mi,Do,Fr,Sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/de-LI",
    "content": "de-LI\n0x1407\nde\nGerman (Liechtenstein)\nDeutsch (Liechtenstein)\nGerman (Liechtenstein)\nde\ndeu\nDEC\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nde-LI\nFalse\n1252\n20273\nFalse\n;\n10000\n850\n2\n.\n'\n3\n2\n2\nCHF\n1\nn. def.\n0,1,2,3,4,5,6,7,8,9\n-unendlich\n-\n2\n.\n'\n3\n1\n2\n.\n'\n3\n1\n1\n%\n‰\n+unendlich\n+\nSo,Mo,Di,Mi,Do,Fr,Sa\nJan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\nJan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\n\n2\n.\nSonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag\n1\ndddd, d. MMMM yyyy HH:mm:ss\ndddd, d. MMMM yyyy\nHH:mm:ss\ndd MMMM\nJanuar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nJanuar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nGregorianischer Kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nSo,Mo,Di,Mi,Do,Fr,Sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/de-LU",
    "content": "de-LU\n0x1007\nde\nGerman (Luxembourg)\nDeutsch (Luxemburg)\nGerman (Luxembourg)\nde\ndeu\nDEL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nde-LU\nFalse\n1252\n20273\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\n€\n1\nn. def.\n0,1,2,3,4,5,6,7,8,9\n-unendlich\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\n+unendlich\n+\nSo,Mo,Di,Mi,Do,Fr,Sa\nJan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\nJan,Feb,Mrz,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez,\n\n2\n.\nSonntag,Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag\n1\ndddd, d. MMMM yyyy HH:mm:ss\ndddd, d. MMMM yyyy\nHH:mm:ss\ndd MMMM\nJanuar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nJanuar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember,\nGregorianischer Kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nSo,Mo,Di,Mi,Do,Fr,Sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/dv",
    "content": "dv\n0x0065\n\nDivehi\nދިވެހިބަސް\nDivehi\ndv\ndiv\nDIV\nHijriCalendar\nHijriCalendar,GregorianCalendar:Localized\n65\ndv\nTrue\n0\n500\nTrue\n،\n2\n1\n"
  },
  {
    "path": "dna/Cultures/dv-MV",
    "content": "dv-MV\n0x0465\ndv\nDivehi (Maldives)\nދިވެހިބަސް (ދިވެހި ރާއްޖެ)\nDivehi (Maldives)\ndv\ndiv\nDIV\nHijriCalendar\nHijriCalendar,GregorianCalendar:Localized\n70\ndv-MV\nFalse\n0\n500\nTrue\n،\n2\n1\n2\n.\n,\n3\n10\n3\nރ.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\nمحرم,صفر,ربيع الاول,ربيع الثاني,جمادى الاولى,جمادى الثانية,رجب,شعبان,رمضان,شوال,ذو القعدة,ذو الحجة,\nمحرم,صفر,ربيع الاول,ربيع الثاني,جمادى الاولى,جمادى الثانية,رجب,شعبان,رمضان,شوال,ذو القعدة,ذو الحجة,\nމކ\n0\n/\nالاحد,الاثنين,الثلاثاء,الاربعاء,الخميس,الجمعة,السبت\n0\ndd/MMMM/yyyy HH:mm:ss\ndd/MMMM/yyyy\nHH:mm:ss\ndd MMMM\nمحرم,صفر,ربيع الأول,ربيع الثاني,جمادى الأولى,جمادى الثانية,رجب,شعبان,رمضان,شوال,ذو القعدة,ذو الحجة,\nمحرم,صفر,ربيع الأول,ربيع الثاني,جمادى الأولى,جمادى الثانية,رجب,شعبان,رمضان,شوال,ذو القعدة,ذو الحجة,\nހިޖްރީ ކަލަންޑަރު\nHH:mm:ss\nމފ\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yy\nح,ن,ث,ر,خ,ج,س\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/el",
    "content": "el\n0x0008\n\nGreek\nελληνικά\nGreek\nel\nell\nELL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nel\nTrue\n1253\n20273\nFalse\n;\n10006\n737\n"
  },
  {
    "path": "dna/Cultures/el-GR",
    "content": "el-GR\n0x0408\nel\nGreek (Greece)\nελληνικά (Ελλάδα)\nGreek (Greece)\nel\nell\nELL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nel-GR\nFalse\n1253\n20273\nFalse\n;\n10006\n737\n2\n,\n.\n3\n8\n3\n€\n1\nμη αριθμός\n0,1,2,3,4,5,6,7,8,9\n-Άπειρο\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\nΆπειρο\n+\nΚυρ,Δευ,Τρι,Τετ,Πεμ,Παρ,Σαβ\nΙαν,Φεβ,Μαρ,Απρ,Μαϊ,Ιουν,Ιουλ,Αυγ,Σεπ,Οκτ,Νοε,Δεκ,\nΙαν,Φεβ,Μαρ,Απρ,Μαϊ,Ιουν,Ιουλ,Αυγ,Σεπ,Οκτ,Νοε,Δεκ,\nπμ\n0\n/\nΚυριακή,Δευτέρα,Τρίτη,Τετάρτη,Πέμπτη,Παρασκευή,Σάββατο\n1\ndddd, d MMMM yyyy h:mm:ss tt\ndddd, d MMMM yyyy\nh:mm:ss tt\ndd MMMM\nΙανουαρίου,Φεβρουαρίου,Μαρτίου,Απριλίου,Μαΐου,Ιουνίου,Ιουλίου,Αυγούστου,Σεπτεμβρίου,Οκτωβρίου,Νοεμβρίου,Δεκεμβρίου,\nΙανουάριος,Φεβρουάριος,Μάρτιος,Απρίλιος,Μάιος,Ιούνιος,Ιούλιος,Αύγουστος,Σεπτέμβριος,Οκτώβριος,Νοέμβριος,Δεκέμβριος,\nΓρηγοριανό Ημερολόγιο\nh:mm:ss tt\nμμ\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/M/yyyy\nΚυ,Δε,Τρ,Τε,Πε,Πα,Σά\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/en",
    "content": "en\n0x0009\n\nEnglish\nEnglish\nEnglish\nen\neng\nENU\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n65\nen\nTrue\n1252\n37\nFalse\n,\n10000\n437\n"
  },
  {
    "path": "dna/Cultures/en-029",
    "content": "en-029\n0x2409\nen\nEnglish (Caribbean)\nEnglish (Caribbean)\nEnglish (Caribbean)\nen\neng\nENB\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-029\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n1\n0\n$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n1\ndddd, MMMM dd, yyyy h:mm:ss tt\ndddd, MMMM dd, yyyy\nh:mm:ss tt\nMMMM dd\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nMM/dd/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/en-AU",
    "content": "en-AU\n0x0c09\nen\nEnglish (Australia)\nEnglish (Australia)\nEnglish (Australia)\nen\neng\nENA\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-AU\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n1\n0\n$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n1\ndddd, d MMMM yyyy h:mm:ss tt\ndddd, d MMMM yyyy\nh:mm:ss tt\ndd MMMM\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/MM/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/en-BZ",
    "content": "en-BZ\n0x2809\nen\nEnglish (Belize)\nEnglish (Belize)\nEnglish (Belize)\nen\neng\nENL\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-BZ\nFalse\n1252\n500\nFalse\n;\n10000\n850\n2\n.\n,\n3,0\n0\n0\nBZ$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, dd MMMM yyyy hh:mm:ss tt\ndddd, dd MMMM yyyy\nhh:mm:ss tt\ndd MMMM\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nhh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/en-CA",
    "content": "en-CA\n0x1009\nen\nEnglish (Canada)\nEnglish (Canada)\nEnglish (Canada)\nen\neng\nENC\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-CA\nFalse\n1252\n37\nFalse\n,\n10000\n850\n2\n.\n,\n3\n1\n0\n$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\nMMMM d, yyyy h:mm:ss tt\nMMMM d, yyyy\nh:mm:ss tt\nMMMM dd\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/en-GB",
    "content": "en-GB\n0x0809\nen\nEnglish (United Kingdom)\nEnglish (United Kingdom)\nEnglish (United Kingdom)\nen\neng\nENG\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-GB\nFalse\n1252\n20285\nFalse\n,\n10000\n850\n2\n.\n,\n3\n1\n0\n£\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\ndd MMMM\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nHH:mm:ss\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/en-IE",
    "content": "en-IE\n0x1809\nen\nEnglish (Ireland)\nEnglish (Eire)\nEnglish (Ireland)\nen\neng\nENI\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-IE\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n1\n0\n€\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\n\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\ndd MMMM\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/en-JM",
    "content": "en-JM\n0x2009\nen\nEnglish (Jamaica)\nEnglish (Jamaica)\nEnglish (Jamaica)\nen\neng\nENJ\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-JM\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n1\n0\nJ$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, MMMM dd, yyyy hh:mm:ss tt\ndddd, MMMM dd, yyyy\nhh:mm:ss tt\nMMMM dd\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nhh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/en-NZ",
    "content": "en-NZ\n0x1409\nen\nEnglish (New Zealand)\nEnglish (New Zealand)\nEnglish (New Zealand)\nen\neng\nENZ\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-NZ\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n1\n0\n$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\na.m.\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n1\ndddd, d MMMM yyyy h:mm:ss tt\ndddd, d MMMM yyyy\nh:mm:ss tt\ndd MMMM\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/MM/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/en-PH",
    "content": "en-PH\n0x3409\nen\nEnglish (Republic of the Philippines)\nEnglish (Philippines)\nEnglish (Republic of the Philippines)\nen\neng\nENP\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-PH\nFalse\n1252\n500\nFalse\n,\n10000\n437\n2\n.\n,\n3\n0\n0\nPhp\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, MMMM dd, yyyy h:mm:ss tt\ndddd, MMMM dd, yyyy\nh:mm:ss tt\nMMMM dd\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nM/d/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/en-TT",
    "content": "en-TT\n0x2c09\nen\nEnglish (Trinidad and Tobago)\nEnglish (Trinidad y Tobago)\nEnglish (Trinidad and Tobago)\nen\neng\nENT\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-TT\nFalse\n1252\n500\nFalse\n;\n10000\n850\n2\n.\n,\n3,0\n0\n0\nTT$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, dd MMMM yyyy hh:mm:ss tt\ndddd, dd MMMM yyyy\nhh:mm:ss tt\ndd MMMM\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nhh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/en-US",
    "content": "en-US\n0x0409\nen\nEnglish (United States)\nEnglish (United States)\nEnglish (United States)\nen\neng\nENU\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-US\nFalse\n1252\n37\nFalse\n,\n10000\n437\n2\n.\n,\n3\n0\n0\n$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, MMMM dd, yyyy h:mm:ss tt\ndddd, MMMM dd, yyyy\nh:mm:ss tt\nMMMM dd\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nM/d/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/en-ZA",
    "content": "en-ZA\n0x1c09\nen\nEnglish (South Africa)\nEnglish (South Africa)\nEnglish (South Africa)\nen\neng\nENS\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-ZA\nFalse\n1252\n500\nFalse\n,\n10000\n437\n2\n.\n,\n3\n2\n2\nR\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n1\n1\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndd MMMM yyyy hh:mm:ss tt\ndd MMMM yyyy\nhh:mm:ss tt\ndd MMMM\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nhh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/MM/dd\nSu,Mo,Tu,We,Th,Fr,Sa\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/en-ZW",
    "content": "en-ZW\n0x3009\nen\nEnglish (Zimbabwe)\nEnglish (Zimbabwe)\nEnglish (Zimbabwe)\nen\neng\nENW\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n70\nen-ZW\nFalse\n1252\n500\nFalse\n,\n10000\n437\n2\n.\n,\n3\n0\n0\nZ$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, MMMM dd, yyyy h:mm:ss tt\ndddd, MMMM dd, yyyy\nh:mm:ss tt\nMMMM dd\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nM/d/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/es",
    "content": "es\n0x000a\n\nSpanish\nespañol\nSpanish\nes\nspa\nESP\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nes\nTrue\n1252\n20284\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/es-AR",
    "content": "es-AR\n0x2c0a\nes\nSpanish (Argentina)\nEspañol (Argentina)\nSpanish (Argentina)\nes\nspa\nESS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-AR\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n2\n2\n$\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-BO",
    "content": "es-BO\n0x400a\nes\nSpanish (Bolivia)\nEspañol (Bolivia)\nSpanish (Bolivia)\nes\nspa\nESB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-BO\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n14\n2\n$b\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-CL",
    "content": "es-CL\n0x340a\nes\nSpanish (Chile)\nEspañol (Chile)\nSpanish (Chile)\nes\nspa\nESL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-CL\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n9\n2\n$\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\n\n0\n-\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy H:mm:ss\ndddd, dd' de 'MMMM' de 'yyyy\nH:mm:ss\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\ndo,lu,ma,mi,ju,vi,sá\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-CO",
    "content": "es-CO\n0x240a\nes\nSpanish (Colombia)\nEspañol (Colombia)\nSpanish (Colombia)\nes\nspa\nESO\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-CO\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n14\n2\n$\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-CR",
    "content": "es-CR\n0x140a\nes\nSpanish (Costa Rica)\nEspañol (Costa Rica)\nSpanish (Costa Rica)\nes\nspa\nESC\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-CR\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n0\n0\n₡\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-DO",
    "content": "es-DO\n0x1c0a\nes\nSpanish (Dominican Republic)\nEspañol (República Dominicana)\nSpanish (Dominican Republic)\nes\nspa\nESD\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-DO\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3\n0\n0\nRD$\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-EC",
    "content": "es-EC\n0x300a\nes\nSpanish (Ecuador)\nEspañol (Ecuador)\nSpanish (Ecuador)\nes\nspa\nESF\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-EC\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n14\n2\n$\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\n\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy H:mm:ss\ndddd, dd' de 'MMMM' de 'yyyy\nH:mm:ss\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-ES",
    "content": "es-ES\n0x0c0a\nes\nSpanish (Spain)\nespañol (España)\nSpanish (Spain)\nes\nspa\nESN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-ES\nFalse\n1252\n20284\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\n€\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\n\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n1\ndddd, dd' de 'MMMM' de 'yyyy H:mm:ss\ndddd, dd' de 'MMMM' de 'yyyy\nH:mm:ss\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-GT",
    "content": "es-GT\n0x100a\nes\nSpanish (Guatemala)\nEspañol (Guatemala)\nSpanish (Guatemala)\nes\nspa\nESG\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-GT\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3\n0\n0\nQ\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-HN",
    "content": "es-HN\n0x480a\nes\nSpanish (Honduras)\nEspañol (Honduras)\nSpanish (Honduras)\nes\nspa\nESH\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-HN\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3,0\n12\n2\nL.\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-MX",
    "content": "es-MX\n0x080a\nes\nSpanish (Mexico)\nEspañol (México)\nSpanish (Mexico)\nes\nspa\nESM\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-MX\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3\n1\n0\n$\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-NI",
    "content": "es-NI\n0x4c0a\nes\nSpanish (Nicaragua)\nEspañol (Nicaragua)\nSpanish (Nicaragua)\nes\nspa\nESI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-NI\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3,0\n14\n2\nC$\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-PA",
    "content": "es-PA\n0x180a\nes\nSpanish (Panama)\nEspañol (Panamá)\nSpanish (Panama)\nes\nspa\nESA\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-PA\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3\n14\n2\nB/.\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nMM/dd/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-PE",
    "content": "es-PE\n0x280a\nes\nSpanish (Peru)\nEspañol (Perú)\nSpanish (Peru)\nes\nspa\nESR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-PE\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3\n12\n2\nS/.\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-PR",
    "content": "es-PR\n0x500a\nes\nSpanish (Puerto Rico)\nEspañol (Puerto Rico)\nSpanish (Puerto Rico)\nes\nspa\nESU\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-PR\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3,0\n14\n2\n$\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-PY",
    "content": "es-PY\n0x3c0a\nes\nSpanish (Paraguay)\nEspañol (Paraguay)\nSpanish (Paraguay)\nes\nspa\nESZ\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-PY\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n14\n2\nGs\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n1\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-SV",
    "content": "es-SV\n0x440a\nes\nSpanish (El Salvador)\nEspañol (El Salvador)\nSpanish (El Salvador)\nes\nspa\nESE\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-SV\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3,0\n0\n0\n$\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-UY",
    "content": "es-UY\n0x380a\nes\nSpanish (Uruguay)\nEspañol (Uruguay)\nSpanish (Uruguay)\nes\nspa\nESY\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-UY\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n14\n2\n$U\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n1\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/es-VE",
    "content": "es-VE\n0x200a\nes\nSpanish (Venezuela)\nEspañol (Republica Bolivariana de Venezuela)\nSpanish (Venezuela)\nes\nspa\nESV\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nes-VE\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n12\n2\nBs\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,lun,mar,mié,jue,vie,sáb\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\nene,feb,mar,abr,may,jun,jul,ago,sep,oct,nov,dic,\na.m.\n0\n/\ndomingo,lunes,martes,miércoles,jueves,viernes,sábado\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\ndd MMMM\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\nenero,febrero,marzo,abril,mayo,junio,julio,agosto,septiembre,octubre,noviembre,diciembre,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,mi,ju,vi,sá\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/et",
    "content": "et\n0x0025\n\nEstonian\neesti\nEstonian\net\nest\nETI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\net\nTrue\n1257\n500\nFalse\n;\n10029\n775\n"
  },
  {
    "path": "dna/Cultures/et-EE",
    "content": "et-EE\n0x0425\net\nEstonian (Estonia)\neesti (Eesti)\nEstonian (Estonia)\net\nest\nETI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\net-EE\nFalse\n1257\n500\nFalse\n;\n10029\n775\n2\n.\n \n3\n8\n3\nkr\n1\navaldamatu\n0,1,2,3,4,5,6,7,8,9\nmiinuslõpmatus\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nplusslõpmatus\n+\nP,E,T,K,N,R,L\njaan,veebr,märts,apr,mai,juuni,juuli,aug,sept,okt,nov,dets,\njaan,veebr,märts,apr,mai,juuni,juuli,aug,sept,okt,nov,dets,\nEL\n2\n.\npühapäev,esmaspäev,teisipäev,kolmapäev,neljapäev,reede,laupäev\n1\nd. MMMM yyyy'. a.' H:mm:ss\nd. MMMM yyyy'. a.'\nH:mm:ss\nd. MMMM\njaanuar,veebruar,märts,aprill,mai,juuni,juuli,august,september,oktoober,november,detsember,\njaanuar,veebruar,märts,aprill,mai,juuni,juuli,august,september,oktoober,november,detsember,\nGregoriuse kalender\nH:mm:ss\nPL\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.MM.yyyy\nP,E,T,K,N,R,L\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy'. a.'\n"
  },
  {
    "path": "dna/Cultures/eu",
    "content": "eu\n0x002d\n\nBasque\neuskara\nBasque\neu\neus\nEUQ\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\neu\nTrue\n1252\n500\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/eu-ES",
    "content": "eu-ES\n0x042d\neu\nBasque (Basque)\neuskara (euskara)\nBasque (Basque)\neu\neus\nEUQ\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\neu-ES\nFalse\n1252\n500\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\n€\n1\nEdZ\n0,1,2,3,4,5,6,7,8,9\n-Infinitu\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinitu\n+\nig.,al.,as.,az.,og.,or.,lr.\nurt.,ots.,mar.,api.,mai.,eka.,uzt.,abu.,ira.,urr.,aza.,abe.,\nurt.,ots.,mar.,api.,mai.,eka.,uzt.,abu.,ira.,urr.,aza.,abe.,\n\n0\n/\nigandea,astelehena,asteartea,asteazkena,osteguna,ostirala,larunbata\n1\ndddd, yyyy.'eko' MMMM'k 'd HH:mm:ss\ndddd, yyyy.'eko' MMMM'k 'd\nHH:mm:ss\nMMMM dd\nurtarrila,otsaila,martxoa,apirila,maiatza,ekaina,uztaila,abuztua,iraila,urria,azaroa,abendua,\nurtarrila,otsaila,martxoa,apirila,maiatza,ekaina,uztaila,abuztua,iraila,urria,azaroa,abendua,\negutegi gregoriotarra\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/MM/dd\nig,al,as,az,og,or,lr\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy.'eko' MMMM\n"
  },
  {
    "path": "dna/Cultures/fa",
    "content": "fa\n0x0029\n\nPersian\nفارسى\nPersian\nfa\nfas\nFAR\nGregorianCalendar:USEnglish\nGregorianCalendar:TransliteratedFrench,GregorianCalendar:USEnglish,GregorianCalendar:Localized,HijriCalendar,GregorianCalendar:TransliteratedEnglish\n65\nfa\nTrue\n1256\n20420\nTrue\n;\n10004\n720\n"
  },
  {
    "path": "dna/Cultures/fa-IR",
    "content": "fa-IR\n0x0429\nfa\nPersian (Iran)\nفارسى (ايران)\nPersian (Iran)\nfa\nfas\nFAR\nGregorianCalendar:USEnglish\nGregorianCalendar:TransliteratedFrench,GregorianCalendar:USEnglish,GregorianCalendar:Localized,HijriCalendar,GregorianCalendar:TransliteratedEnglish\n70\nfa-IR\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n/\n,\n3\n3\n2\nريال\n0\nNaN\n۰,۱,۲,۳,۴,۵,۶,۷,۸,۹\n-Infinity\n-\n2\n.\n,\n3\n3\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nق.ظ\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, MMMM dd, yyyy hh:mm:ss tt\ndddd, MMMM dd, yyyy\nhh:mm:ss tt\nMMMM dd\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar (English)\nhh:mm:ss tt\nب.ظ\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nM/d/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/fi",
    "content": "fi\n0x000b\n\nFinnish\nsuomi\nFinnish\nfi\nfin\nFIN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nfi\nTrue\n1252\n20278\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/fi-FI",
    "content": "fi-FI\n0x040b\nfi\nFinnish (Finland)\nsuomi (Suomi)\nFinnish (Finland)\nfi\nfin\nFIN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nfi-FI\nFalse\n1252\n20278\nFalse\n;\n10000\n850\n2\n,\n \n3\n8\n3\n€\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-INF\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nINF\n+\nsu,ma,ti,ke,to,pe,la\ntammi,helmi,maalis,huhti,touko,kesä,heinä,elo,syys,loka,marras,joulu,\ntammi,helmi,maalis,huhti,touko,kesä,heinä,elo,syys,loka,marras,joulu,\n\n2\n.\nsunnuntai,maanantai,tiistai,keskiviikko,torstai,perjantai,lauantai\n1\nd. MMMM'ta 'yyyy H:mm:ss\nd. MMMM'ta 'yyyy\nH:mm:ss\nd. MMMM'ta'\ntammikuu,helmikuu,maaliskuu,huhtikuu,toukokuu,kesäkuu,heinäkuu,elokuu,syyskuu,lokakuu,marraskuu,joulukuu,\ntammikuu,helmikuu,maaliskuu,huhtikuu,toukokuu,kesäkuu,heinäkuu,elokuu,syyskuu,lokakuu,marraskuu,joulukuu,\ngregoriaaninen kalenteri\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nsu,ma,ti,ke,to,pe,la\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/fo",
    "content": "fo\n0x0038\n\nFaroese\nføroyskt\nFaroese\nfo\nfao\nFOS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nfo\nTrue\n1252\n20277\nFalse\n;\n10079\n850\n"
  },
  {
    "path": "dna/Cultures/fo-FO",
    "content": "fo-FO\n0x0438\nfo\nFaroese (Faroe Islands)\nføroyskt (Føroyar)\nFaroese (Faroe Islands)\nfo\nfao\nFOS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nfo-FO\nFalse\n1252\n20277\nFalse\n;\n10079\n850\n2\n,\n.\n3\n12\n2\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-INF\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\nINF\n+\nsun,mán,týs,mik,hós,frí,leyg\njan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des,\njan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des,\n\n2\n-\nsunnudagur,mánadagur,týsdagur,mikudagur,hósdagur,fríggjadagur,leygardagur\n1\nd. MMMM yyyy HH.mm.ss\nd. MMMM yyyy\nHH.mm.ss\nd. MMMM\njanuar,februar,mars,apríl,mai,juni,juli,august,september,oktober,november,desember,\njanuar,februar,mars,apríl,mai,juni,juli,august,september,oktober,november,desember,\nGregorianski álmanakkin\nHH.mm.ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nsu,má,tý,mi,hó,fr,ley\nHH.mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n.\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/fr",
    "content": "fr\n0x000c\n\nFrench\nfrançais\nFrench\nfr\nfra\nFRA\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nfr\nTrue\n1252\n20297\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/fr-BE",
    "content": "fr-BE\n0x080c\nfr\nFrench (Belgium)\nfrançais (Belgique)\nFrench (Belgium)\nfr\nfra\nFRB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nfr-BE\nFalse\n1252\n20297\nFalse\n;\n10000\n850\n2\n,\n.\n3\n12\n2\n€\n1\nNon Numérique\n0,1,2,3,4,5,6,7,8,9\n-Infini\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\n+Infini\n+\ndim.,lun.,mar.,mer.,jeu.,ven.,sam.\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\n\n0\n/\ndimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi\n1\ndddd d MMMM yyyy H:mm:ss\ndddd d MMMM yyyy\nH:mm:ss\nd MMMM\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\ncalendrier grégorien\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/MM/yyyy\ndi,lu,ma,me,je,ve,sa\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/fr-CA",
    "content": "fr-CA\n0x0c0c\nfr\nFrench (Canada)\nfrançais (Canada)\nFrench (Canada)\nfr\nfra\nFRC\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nfr-CA\nFalse\n1252\n20297\nFalse\n;\n10000\n850\n2\n,\n \n3\n15\n3\n$\n1\nNon Numérique\n0,1,2,3,4,5,6,7,8,9\n-Infini\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\n+Infini\n+\ndim.,lun.,mar.,mer.,jeu.,ven.,sam.\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\n\n0\n-\ndimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi\n0\nd MMMM yyyy HH:mm:ss\nd MMMM yyyy\nHH:mm:ss\nd MMMM\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\ncalendrier grégorien\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy-MM-dd\ndi,lu,ma,me,je,ve,sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/fr-CH",
    "content": "fr-CH\n0x100c\nfr\nFrench (Switzerland)\nfrançais (Suisse)\nFrench (Switzerland)\nfr\nfra\nFRS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nfr-CH\nFalse\n1252\n20297\nFalse\n;\n10000\n850\n2\n.\n'\n3\n2\n2\nSFr.\n1\nNon Numérique\n0,1,2,3,4,5,6,7,8,9\n-Infini\n-\n2\n.\n'\n3\n1\n2\n.\n'\n3\n0\n0\n%\n‰\n+Infini\n+\ndim.,lun.,mar.,mer.,jeu.,ven.,sam.\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\n\n2\n.\ndimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi\n1\ndddd, d. MMMM yyyy HH:mm:ss\ndddd, d. MMMM yyyy\nHH:mm:ss\nd MMMM\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\ncalendrier grégorien\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\ndi,lu,ma,me,je,ve,sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/fr-FR",
    "content": "fr-FR\n0x040c\nfr\nFrench (France)\nfrançais (France)\nFrench (France)\nfr\nfra\nFRA\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nfr-FR\nFalse\n1252\n20297\nFalse\n;\n10000\n850\n2\n,\n \n3\n8\n3\n€\n1\nNon Numérique\n0,1,2,3,4,5,6,7,8,9\n-Infini\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\n+Infini\n+\ndim.,lun.,mar.,mer.,jeu.,ven.,sam.\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\n\n0\n/\ndimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi\n1\ndddd d MMMM yyyy HH:mm:ss\ndddd d MMMM yyyy\nHH:mm:ss\nd MMMM\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\ncalendrier grégorien\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndi,lu,ma,me,je,ve,sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/fr-LU",
    "content": "fr-LU\n0x140c\nfr\nFrench (Luxembourg)\nfrançais (Luxembourg)\nFrench (Luxembourg)\nfr\nfra\nFRL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nfr-LU\nFalse\n1252\n20297\nFalse\n;\n10000\n850\n2\n,\n \n3\n8\n3\n€\n1\nNon Numérique\n0,1,2,3,4,5,6,7,8,9\n-Infini\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\n+Infini\n+\ndim.,lun.,mar.,mer.,jeu.,ven.,sam.\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\n\n0\n/\ndimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi\n1\ndddd d MMMM yyyy HH:mm:ss\ndddd d MMMM yyyy\nHH:mm:ss\nd MMMM\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\ncalendrier grégorien\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndi,lu,ma,me,je,ve,sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/fr-MC",
    "content": "fr-MC\n0x180c\nfr\nFrench (Principality of Monaco)\nfrançais (Principauté de Monaco)\nFrench (Principality of Monaco)\nfr\nfra\nFRM\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nfr-MC\nFalse\n1252\n20297\nFalse\n;\n10000\n850\n2\n,\n \n3\n8\n3\n€\n1\nNon Numérique\n0,1,2,3,4,5,6,7,8,9\n-Infini\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\n+Infini\n+\ndim.,lun.,mar.,mer.,jeu.,ven.,sam.\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\njanv.,févr.,mars,avr.,mai,juin,juil.,août,sept.,oct.,nov.,déc.,\n\n0\n/\ndimanche,lundi,mardi,mercredi,jeudi,vendredi,samedi\n1\ndddd d MMMM yyyy HH:mm:ss\ndddd d MMMM yyyy\nHH:mm:ss\nd MMMM\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\njanvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre,\ncalendrier grégorien\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndi,lu,ma,me,je,ve,sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/gl",
    "content": "gl\n0x0056\n\nGalician\ngalego\nGalician\ngl\nglg\nGLC\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\ngl\nTrue\n1252\n500\nFalse\n,\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/gl-ES",
    "content": "gl-ES\n0x0456\ngl\nGalician (Galician)\ngalego (galego)\nGalician (Galician)\ngl\nglg\nGLC\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\ngl-ES\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n,\n.\n3\n8\n3\n€\n1\nNeuN\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinito\n+\ndom,luns,mar,mér,xov,ven,sab\nxan,feb,mar,abr,maio,xuñ,xull,ago,set,out,nov,dec,\nxan,feb,mar,abr,maio,xuñ,xull,ago,set,out,nov,dec,\na.m.\n0\n/\ndomingo,luns,martes,mércores,xoves,venres,sábado\n1\ndddd, dd' de 'MMMM' de 'yyyy H:mm:ss\ndddd, dd' de 'MMMM' de 'yyyy\nH:mm:ss\ndd MMMM\nxaneiro,febreiro,marzo,abril,maio,xuño,xullo,agosto,setembro,outubro,novembro,decembro,\nxaneiro,febreiro,marzo,abril,maio,xuño,xullo,agosto,setembro,outubro,novembro,decembro,\nCalendario Gregoriano\nH:mm:ss\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yy\ndo,lu,ma,mé,xo,ve,sa\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/gu",
    "content": "gu\n0x0047\n\nGujarati\nગુજરાતી\nGujarati\ngu\nguj\nGUJ\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\ngu\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/gu-IN",
    "content": "gu-IN\n0x0447\ngu\nGujarati (India)\nગુજરાતી (ભારત)\nGujarati (India)\ngu\nguj\nGUJ\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\ngu-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nરૂ\n1\nNaN\n૦,૧,૨,૩,૪,૫,૬,૭,૮,૯\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nરવિ,સોમ,મંગળ,બુધ,ગુરુ,શુક્ર,શનિ\nજાન્યુ,ફેબ્રુ,માર્ચ,એપ્રિલ,મે,જૂન,જુલાઈ,ઑગસ્ટ,સપ્ટે,ઑક્ટો,નવે,ડિસે,\nજાન્યુ,ફેબ્રુ,માર્ચ,એપ્રિલ,મે,જૂન,જુલાઈ,ઑગસ્ટ,સપ્ટે,ઑક્ટો,નવે,ડિસે,\nપૂર્વ મધ્યાહ્ન\n0\n-\nરવિવાર,સોમવાર,મંગળવાર,બુધવાર,ગુરુવાર,શુક્રવાર,શનિવાર\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\ndd MMMM\nજાન્યુઆરી,ફેબ્રુઆરી,માર્ચ,એપ્રિલ,મે,જૂન,જુલાઈ,ઑગસ્ટ,સપ્ટેમ્બર,ઑક્ટ્બર,નવેમ્બર,ડિસેમ્બર,\nજાન્યુઆરી,ફેબ્રુઆરી,માર્ચ,એપ્રિલ,મે,જૂન,જુલાઈ,ઑગસ્ટ,સપ્ટેમ્બર,ઑક્ટ્બર,નવેમ્બર,ડિસેમ્બર,\nઅંગ્રેજી કૅલેન્ડર\nHH:mm:ss\nઉત્તર મધ્યાહ્ન\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yy\nર,સ,મ,બ,ગ,શ,શ\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/he",
    "content": "he\n0x000d\n\nHebrew\nעברית\nHebrew\nhe\nheb\nHEB\nGregorianCalendar:Localized\nGregorianCalendar:Localized,HebrewCalendar\n65\nhe\nTrue\n1255\n500\nTrue\n,\n10005\n862\n"
  },
  {
    "path": "dna/Cultures/he-IL",
    "content": "he-IL\n0x040d\nhe\nHebrew (Israel)\nעברית (ישראל)\nHebrew (Israel)\nhe\nheb\nHEB\nGregorianCalendar:Localized\nGregorianCalendar:Localized,HebrewCalendar\n70\nhe-IL\nFalse\n1255\n500\nTrue\n,\n10005\n862\n2\n.\n,\n3\n2\n2\n₪\n1\nלא מספר\n0,1,2,3,4,5,6,7,8,9\nאינסוף שלילי\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n1\n1\n%\n‰\nאינסוף חיובי\n+\nיום א,יום ב,יום ג,יום ד,יום ה,יום ו,שבת\nינו,פבר,מרץ,אפר,מאי,יונ,יול,אוג,ספט,אוק,נוב,דצמ,\nינו,פבר,מרץ,אפר,מאי,יונ,יול,אוג,ספט,אוק,נוב,דצמ,\nAM\n0\n/\nיום ראשון,יום שני,יום שלישי,יום רביעי,יום חמישי,יום שישי,שבת\n0\ndddd dd MMMM yyyy HH:mm:ss\ndddd dd MMMM yyyy\nHH:mm:ss\ndd MMMM\nינואר,פברואר,מרץ,אפריל,מאי,יוני,יולי,אוגוסט,ספטמבר,אוקטובר,נובמבר,דצמבר,\nינואר,פברואר,מרץ,אפריל,מאי,יוני,יולי,אוגוסט,ספטמבר,אוקטובר,נובמבר,דצמבר,\nלוח שנה גרגוריאני\nHH:mm:ss\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nא,ב,ג,ד,ה,ו,ש\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/hi",
    "content": "hi\n0x0039\n\nHindi\nहिंदी\nHindi\nhi\nhin\nHIN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nhi\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/hi-IN",
    "content": "hi-IN\n0x0439\nhi\nHindi (India)\nहिंदी (भारत)\nHindi (India)\nhi\nhin\nHIN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nhi-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nरु\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nरवि.,सोम.,मंगल.,बुध.,गुरु.,शुक्र.,शनि.\nजनवरी,फरवरी,मार्च,अप्रैल,मई,जून,जुलाई,अगस्त,सितम्बर,अक्तूबर,नवम्बर,दिसम्बर,\nजनवरी,फरवरी,मार्च,अप्रैल,मई,जून,जुलाई,अगस्त,सितम्बर,अक्तूबर,नवम्बर,दिसम्बर,\nपूर्वाह्न\n0\n-\nरविवार,सोमवार,मंगलवार,बुधवार,गुरुवार,शुक्रवार,शनिवार\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\ndd MMMM\nजनवरी,फरवरी,मार्च,अप्रैल,मई,जून,जुलाई,अगस्त,सितम्बर,अक्तूबर,नवम्बर,दिसम्बर,\nजनवरी,फरवरी,मार्च,अप्रैल,मई,जून,जुलाई,अगस्त,सितम्बर,अक्तूबर,नवम्बर,दिसम्बर,\nअंग्रेज़ी कैलेन्डर\nHH:mm:ss\nअपराह्न\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nर,स,म,ब,ग,श,श\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/hr",
    "content": "hr\n0x001a\n\nCroatian\nhrvatski\nCroatian\nhr\nhrv\nHRV\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nhr\nTrue\n1250\n500\nFalse\n;\n10082\n852\n"
  },
  {
    "path": "dna/Cultures/hr-BA",
    "content": "hr-BA\n0x101a\n\nCroatian (Bosnia and Herzegovina)\nhrvatski (Bosna i Hercegovina)\nCroatian (Bosnia and Herzegovina)\nhr\nhr\nHRB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nhr-BA\nFalse\n1250\n870\nFalse\n;\n10082\n852\n2\n,\n.\n3\n8\n3\nKM\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n2\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nned,pon,uto,sri,čet,pet,sub\nsij,vlj,ožu,tra,svi,lip,srp,kol,ruj,lis,stu,pro,\nsij,vlj,ožu,tra,svi,lip,srp,kol,ruj,lis,stu,pro,\n\n0\n.\nnedjelja,ponedjeljak,utorak,srijeda,četvrtak,petak,subota\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\nMMMM dd\nsiječanj,veljača,ožujak,travanj,svibanj,lipanj,srpanj,kolovoz,rujan,listopad,studeni,prosinac,\nsiječanj,veljača,ožujak,travanj,svibanj,lipanj,srpanj,kolovoz,rujan,listopad,studeni,prosinac,\ngregorijanski kalendar\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nned,pon,uto,sri,čet,pet,sub\nH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/hr-HR",
    "content": "hr-HR\n0x041a\nhr\nCroatian (Croatia)\nhrvatski (Hrvatska)\nCroatian (Croatia)\nhr\nhrv\nHRV\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nhr-HR\nFalse\n1250\n500\nFalse\n;\n10082\n852\n2\n,\n.\n3\n8\n3\nkn\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n2\n2\n,\n.\n3\n1\n1\n%\n‰\nInfinity\n+\nned,pon,uto,sri,čet,pet,sub\nsij,vlj,ožu,tra,svi,lip,srp,kol,ruj,lis,stu,pro,\nsij,vlj,ožu,tra,svi,lip,srp,kol,ruj,lis,stu,pro,\n\n0\n.\nnedjelja,ponedjeljak,utorak,srijeda,četvrtak,petak,subota\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\nd. MMMM\nsiječanj,veljača,ožujak,travanj,svibanj,lipanj,srpanj,kolovoz,rujan,listopad,studeni,prosinac,\nsiječanj,veljača,ožujak,travanj,svibanj,lipanj,srpanj,kolovoz,rujan,listopad,studeni,prosinac,\ngregorijanski kalendar\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nne,po,ut,sr,če,pe,su\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/hu",
    "content": "hu\n0x000e\n\nHungarian\nmagyar\nHungarian\nhu\nhun\nHUN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nhu\nTrue\n1250\n500\nFalse\n;\n10029\n852\n"
  },
  {
    "path": "dna/Cultures/hu-HU",
    "content": "hu-HU\n0x040e\nhu\nHungarian (Hungary)\nmagyar (Magyarország)\nHungarian (Hungary)\nhu\nhun\nHUN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nhu-HU\nFalse\n1250\n500\nFalse\n;\n10029\n852\n2\n,\n \n3\n8\n3\nFt\n1\nnem szám\n0,1,2,3,4,5,6,7,8,9\nnegatív végtelen\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nvégtelen\n+\nV,H,K,Sze,Cs,P,Szo\njan.,febr.,márc.,ápr.,máj.,jún.,júl.,aug.,szept.,okt.,nov.,dec.,\njan.,febr.,márc.,ápr.,máj.,jún.,júl.,aug.,szept.,okt.,nov.,dec.,\nde.\n0\n. \nvasárnap,hétfő,kedd,szerda,csütörtök,péntek,szombat\n1\nyyyy. MMMM d. H:mm:ss\nyyyy. MMMM d.\nH:mm:ss\nMMMM d.\njanuár,február,március,április,május,június,július,augusztus,szeptember,október,november,december,\njanuár,február,március,április,május,június,július,augusztus,szeptember,október,november,december,\nGergely-naptár\nH:mm:ss\ndu.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy. MM. dd.\nV,H,K,Sze,Cs,P,Szo\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy. MMMM\n"
  },
  {
    "path": "dna/Cultures/hy",
    "content": "hy\n0x002b\n\nArmenian\nՀայերեն\nArmenian\nhy\nhye\nHYE\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nhy\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/hy-AM",
    "content": "hy-AM\n0x042b\nhy\nArmenian (Armenia)\nՀայերեն (Հայաստան)\nArmenian (Armenia)\nhy\nhye\nHYE\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nhy-AM\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3\n8\n3\nդր.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nԿիր,Երկ,Երք,Չրք,Հնգ,ՈՒր,Շբթ\nՀՆՎ,ՓՏՎ,ՄՐՏ,ԱՊՐ,ՄՅՍ,ՀՆՍ,ՀԼՍ,ՕԳՍ,ՍԵՊ,ՀՈԿ,ՆՈՅ,ԴԵԿ,\nՀՆՎ,ՓՏՎ,ՄՐՏ,ԱՊՐ,ՄՅՍ,ՀՆՍ,ՀԼՍ,ՕԳՍ,ՍԵՊ,ՀՈԿ,ՆՈՅ,ԴԵԿ,\n\n0\n.\nԿիրակի,Երկուշաբթի,Երեքշաբթի,Չորեքշաբթի,Հինգշաբթի,ՈՒրբաթ,Շաբաթ\n1\nd MMMM, yyyy H:mm:ss\nd MMMM, yyyy\nH:mm:ss\nd MMMM\nՀունվար,Փետրվար,Մարտ,Ապրիլ,Մայիս,Հունիս,Հուլիս,Օգոստոս,Սեպտեմբեր,Հոկտեմբեր,Նոյեմբեր,Դեկտեմբեր,\nՀունվար,Փետրվար,Մարտ,Ապրիլ,Մայիս,Հունիս,Հուլիս,Օգոստոս,Սեպտեմբեր,Հոկտեմբեր,Նոյեմբեր,Դեկտեմբեր,\nՕրացույց\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nԿ,Ե,Ե,Չ,Հ,Ո,Շ\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/id",
    "content": "id\n0x0021\n\nIndonesian\nBahasa Indonesia\nIndonesian\nid\nind\nIND\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nid\nTrue\n1252\n500\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/id-ID",
    "content": "id-ID\n0x0421\nid\nIndonesian (Indonesia)\nBahasa Indonesia (Indonesia)\nIndonesian (Indonesia)\nid\nind\nIND\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nid-ID\nFalse\n1252\n500\nFalse\n;\n10000\n850\n0\n,\n.\n3\n0\n0\nRp\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nMinggu,Sen,Sel,Rabu,Kamis,Jumat,Sabtu\nJan,Feb,Mar,Apr,Mei,Jun,Jul,Agust,Sep,Okt,Nop,Des,\nJan,Feb,Mar,Apr,Mei,Jun,Jul,Agust,Sep,Okt,Nop,Des,\n\n0\n/\nMinggu,Senin,Selasa,Rabu,Kamis,Jumat,Sabtu\n1\ndd MMMM yyyy H:mm:ss\ndd MMMM yyyy\nH:mm:ss\ndd MMMM\nJanuari,Februari,Maret,April,Mei,Juni,Juli,Agustus,September,Oktober,Nopember,Desember,\nJanuari,Februari,Maret,April,Mei,Juni,Juli,Agustus,September,Oktober,Nopember,Desember,\nkalendar Masehi\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nM,S,S,R,K,J,S\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/is",
    "content": "is\n0x000f\n\nIcelandic\níslenska\nIcelandic\nis\nisl\nISL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nis\nTrue\n1252\n20871\nFalse\n;\n10079\n850\n"
  },
  {
    "path": "dna/Cultures/is-IS",
    "content": "is-IS\n0x040f\nis\nIcelandic (Iceland)\níslenska (Ísland)\nIcelandic (Iceland)\nis\nisl\nISL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nis-IS\nFalse\n1252\n20871\nFalse\n;\n10079\n850\n0\n,\n.\n3\n8\n3\nkr.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-INF\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\nINF\n+\nsun.,mán.,þri.,mið.,fim.,fös.,lau.\njan.,feb.,mar.,apr.,maí,jún.,júl.,ágú.,sep.,okt.,nóv.,des.,\njan.,feb.,mar.,apr.,maí,jún.,júl.,ágú.,sep.,okt.,nóv.,des.,\n\n2\n.\nsunnudagur,mánudagur,þriðjudagur,miðvikudagur,fimmtudagur,föstudagur,laugardagur\n1\nd. MMMM yyyy HH:mm:ss\nd. MMMM yyyy\nHH:mm:ss\nd. MMMM\njanúar,febrúar,mars,apríl,maí,júní,júlí,ágúst,september,október,nóvember,desember,\njanúar,febrúar,mars,apríl,maí,júní,júlí,ágúst,september,október,nóvember,desember,\ngregorískt tímatal\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nsu,má,þr,mi,fi,fö,la\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/it",
    "content": "it\n0x0010\n\nItalian\nitaliano\nItalian\nit\nita\nITA\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nit\nTrue\n1252\n20280\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/it-CH",
    "content": "it-CH\n0x0810\nit\nItalian (Switzerland)\nitaliano (Svizzera)\nItalian (Switzerland)\nit\nita\nITS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nit-CH\nFalse\n1252\n500\nFalse\n;\n10000\n850\n2\n.\n'\n3\n2\n2\nSFr.\n1\nNon un numero reale\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n.\n'\n3\n1\n2\n.\n'\n3\n1\n1\n%\n‰\n+Infinito\n+\ndom,lun,mar,mer,gio,ven,sab\ngen,feb,mar,apr,mag,gio,lug,ago,set,ott,nov,dic,\ngen,feb,mar,apr,mag,gio,lug,ago,set,ott,nov,dic,\n\n2\n.\ndomenica,lunedì,martedì,mercoledì,giovedì,venerdì,sabato\n1\ndddd, d. MMMM yyyy HH:mm:ss\ndddd, d. MMMM yyyy\nHH:mm:ss\nd. MMMM\ngennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre,\ngennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre,\ncalendario gregoriano\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\ndo,lu,ma,me,gi,ve,sa\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/it-IT",
    "content": "it-IT\n0x0410\nit\nItalian (Italy)\nitaliano (Italia)\nItalian (Italy)\nit\nita\nITA\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nit-IT\nFalse\n1252\n20280\nFalse\n;\n10000\n850\n2\n,\n.\n3\n9\n2\n€\n1\nNon un numero reale\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\n+Infinito\n+\ndom,lun,mar,mer,gio,ven,sab\ngen,feb,mar,apr,mag,giu,lug,ago,set,ott,nov,dic,\ngen,feb,mar,apr,mag,giu,lug,ago,set,ott,nov,dic,\n\n2\n/\ndomenica,lunedì,martedì,mercoledì,giovedì,venerdì,sabato\n1\ndddd d MMMM yyyy H.mm.ss\ndddd d MMMM yyyy\nH.mm.ss\ndd MMMM\ngennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre,\ngennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre,\ncalendario gregoriano\nH.mm.ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\ndo,lu,ma,me,gi,ve,sa\nH.mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n.\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/ja",
    "content": "ja\n0x0011\n\nJapanese\n日本語\nJapanese\nja\njpn\nJPN\nGregorianCalendar:Localized\nGregorianCalendar:Localized,JapaneseCalendar,GregorianCalendar:USEnglish\n65\nja\nTrue\n932\n20290\nFalse\n,\n10001\n932\n"
  },
  {
    "path": "dna/Cultures/ja-JP",
    "content": "ja-JP\n0x0411\nja\nJapanese (Japan)\n日本語 (日本)\nJapanese (Japan)\nja\njpn\nJPN\nGregorianCalendar:Localized\nGregorianCalendar:Localized,JapaneseCalendar,GregorianCalendar:USEnglish\n70\nja-JP\nFalse\n932\n20290\nFalse\n,\n10001\n932\n0\n.\n,\n3\n1\n0\n¥\n1\nNaN (非数値)\n0,1,2,3,4,5,6,7,8,9\n-∞\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n1\n1\n%\n‰\n+∞\n+\n日,月,火,水,木,金,土\n1,2,3,4,5,6,7,8,9,10,11,12,\n1,2,3,4,5,6,7,8,9,10,11,12,\n午前\n0\n/\n日曜日,月曜日,火曜日,水曜日,木曜日,金曜日,土曜日\n0\nyyyy'年'M'月'd'日' H:mm:ss\nyyyy'年'M'月'd'日'\nH:mm:ss\nM'月'd'日'\n1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月,\n1月,2月,3月,4月,5月,6月,7月,8月,9月,10月,11月,12月,\n西暦 (日本語)\nH:mm:ss\n午後\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/MM/dd\n日,月,火,水,木,金,土\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy'年'M'月'\n"
  },
  {
    "path": "dna/Cultures/ka",
    "content": "ka\n0x0037\n\nGeorgian\nქართული\nGeorgian\nka\nkat\nKAT\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nka\nTrue\n0\n500\nFalse\n;\n2\n1\n"
  },
  {
    "path": "dna/Cultures/ka-GE",
    "content": "ka-GE\n0x0437\nka\nGeorgian (Georgia)\nქართული (საქართველო)\nGeorgian (Georgia)\nka\nkat\nKAT\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nka-GE\nFalse\n0\n500\nFalse\n;\n2\n1\n2\n,\n \n3\n8\n3\nLari\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\nკვირა,ორშაბათი,სამშაბათი,ოთხშაბათი,ხუთშაბათი,პარასკევი,შაბათი\nიან,თებ,მარ,აპრ,მაის,ივნ,ივლ,აგვ,სექ,ოქტ,ნოემ,დეკ,\nიან,თებ,მარ,აპრ,მაის,ივნ,ივლ,აგვ,სექ,ოქტ,ნოემ,დეკ,\n\n0\n.\nკვირა,ორშაბათი,სამშაბათი,ოთხშაბათი,ხუთშაბათი,პარასკევი,შაბათი\n1\nyyyy 'წლის' dd MM, dddd H:mm:ss\nyyyy 'წლის' dd MM, dddd\nH:mm:ss\ndd MM\nიანვარი,თებერვალი,მარტი,აპრილი,მაისი,ივნისი,ივლისი,აგვისტო,სექტემბერი,ოქტომბერი,ნოემბერი,დეკემბერი,\nიანვარი,თებერვალი,მარტი,აპრილი,მაისი,ივნისი,ივლისი,აგვისტო,სექტემბერი,ოქტომბერი,ნოემბერი,დეკემბერი,\nგრიგორიანული კალენდარი\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nკ,ო,ს,ო,ხ,პ,შ\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/kk",
    "content": "kk\n0x003f\n\nKazakh\nҚазащb\nKazakh\nkk\nkaz\nKKZ\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nkk\nTrue\n1251\n20880\nFalse\n;\n10007\n866\n"
  },
  {
    "path": "dna/Cultures/kk-KZ",
    "content": "kk-KZ\n0x043f\nkk\nKazakh (Kazakhstan)\nҚазақ (Қазақстан)\nKazakh (Kazakhstan)\nkk\nkaz\nKKZ\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nkk-KZ\nFalse\n1251\n20880\nFalse\n;\n10007\n866\n2\n-\n \n3\n1\n0\nТ\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nInfinity\n+\nЖк,Дс,Сс,Ср,Бс,Жм,Сн\nҚаң,Ақп,Нау,Сәу,Мам,Мау,Шіл,Там,Қыр,Қаз,Қар,Жел,\nҚаң,Ақп,Нау,Сәу,Мам,Мау,Шіл,Там,Қыр,Қаз,Қар,Жел,\n\n0\n.\nЖексенбі,Дүйсенбі,Сейсенбі,Сәрсенбі,Бейсенбі,Жұма,Сенбі\n1\nd MMMM yyyy 'ж.' H:mm:ss\nd MMMM yyyy 'ж.'\nH:mm:ss\nd MMMM\nқаңтар,ақпан,наурыз,сәуір,мамыр,маусым,шілде,тамыз,қыркүйек,қазан,қараша,желтоқсан,\nқаңтар,ақпан,наурыз,сәуір,мамыр,маусым,шілде,тамыз,қыркүйек,қазан,қараша,желтоқсан,\nгригорианкүнтізбек\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nЖк,Дс,Сс,Ср,Бс,Жм,Сн\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/kn",
    "content": "kn\n0x004b\n\nKannada\nಕನ್ನಡ\nKannada\nkn\nkan\nKDI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nkn\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/kn-IN",
    "content": "kn-IN\n0x044b\nkn\nKannada (India)\nಕನ್ನಡ (ಭಾರತ)\nKannada (India)\nkn\nkan\nKDI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nkn-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nರೂ\n1\nNaN\n೦,೧,೨,೩,೪,೫,೬,೭,೮,೯\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nಭಾನು.,ಸೋಮ.,ಮಂಗಳ.,ಬುಧ.,ಗುರು.,ಶುಕ್ರ.,ಶನಿ.\nಜನವರಿ,ಫೆಬ್ರವರಿ,ಮಾರ್ಚ್,ಎಪ್ರಿಲ್,ಮೇ,ಜೂನ್,ಜುಲೈ,ಆಗಸ್ಟ್,ಸೆಪ್ಟಂಬರ್,ಅಕ್ಟೋಬರ್,ನವೆಂಬರ್,ಡಿಸೆಂಬರ್,\nಜನವರಿ,ಫೆಬ್ರವರಿ,ಮಾರ್ಚ್,ಎಪ್ರಿಲ್,ಮೇ,ಜೂನ್,ಜುಲೈ,ಆಗಸ್ಟ್,ಸೆಪ್ಟಂಬರ್,ಅಕ್ಟೋಬರ್,ನವೆಂಬರ್,ಡಿಸೆಂಬರ್,\nಪೂರ್ವಾಹ್ನ\n0\n-\nಭಾನುವಾರ,ಸೋಮವಾರ,ಮಂಗಳವಾರ,ಬುಧವಾರ,ಗುರುವಾರ,ಶುಕ್ರವಾರ,ಶನಿವಾರ\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\ndd MMMM\nಜನವರಿ,ಫೆಬ್ರವರಿ,ಮಾರ್ಚ್,ಎಪ್ರಿಲ್,ಮೇ,ಜೂನ್,ಜುಲೈ,ಆಗಸ್ಟ್,ಸೆಪ್ಟಂಬರ್,ಅಕ್ಟೋಬರ್,ನವೆಂಬರ್,ಡಿಸೆಂಬರ್,\nಜನವರಿ,ಫೆಬ್ರವರಿ,ಮಾರ್ಚ್,ಎಪ್ರಿಲ್,ಮೇ,ಜೂನ್,ಜುಲೈ,ಆಗಸ್ಟ್,ಸೆಪ್ಟಂಬರ್,ಅಕ್ಟೋಬರ್,ನವೆಂಬರ್,ಡಿಸೆಂಬರ್,\nಇಂಗ್ಲಿಷ್ ಕ್ಯಾಲೆಂಡರ್\nHH:mm:ss\nಅಪರಾಹ್ನ\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yy\nರ,ಸ,ಮ,ಬ,ಗ,ಶ,ಶ\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ko",
    "content": "ko\n0x0012\n\nKorean\n한국어\nKorean\nko\nkor\nKOR\nGregorianCalendar:Localized\nGregorianCalendar:Localized,KoreanCalendar,GregorianCalendar:USEnglish\n65\nko\nTrue\n949\n20833\nFalse\n,\n10003\n949\n"
  },
  {
    "path": "dna/Cultures/ko-KR",
    "content": "ko-KR\n0x0412\nko\nKorean (Korea)\n한국어 (대한민국)\nKorean (Korea)\nko\nkor\nKOR\nGregorianCalendar:Localized\nGregorianCalendar:Localized,KoreanCalendar,GregorianCalendar:USEnglish\n70\nko-KR\nFalse\n949\n20833\nFalse\n,\n10003\n949\n0\n.\n,\n3\n1\n0\n₩\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\n일,월,화,수,목,금,토\n1,2,3,4,5,6,7,8,9,10,11,12,\n1,2,3,4,5,6,7,8,9,10,11,12,\n오전\n0\n-\n일요일,월요일,화요일,수요일,목요일,금요일,토요일\n0\nyyyy'년' M'월' d'일' dddd tt h:mm:ss\nyyyy'년' M'월' d'일' dddd\ntt h:mm:ss\nM'월' d'일'\n1월,2월,3월,4월,5월,6월,7월,8월,9월,10월,11월,12월,\n1월,2월,3월,4월,5월,6월,7월,8월,9월,10월,11월,12월,\n서기 (한글)\ntt h:mm:ss\n오후\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy-MM-dd\n일,월,화,수,목,금,토\ntt h:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy'년' M'월'\n"
  },
  {
    "path": "dna/Cultures/kok",
    "content": "kok\n0x0057\n\nKonkani\nकोंकणी\nKonkani\nkok\nkok\nKNK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nkok\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/kok-IN",
    "content": "kok-IN\n0x0457\nkok\nKonkani (India)\nकोंकणी (भारत)\nKonkani (India)\nkok\nkok\nKNK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nkok-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nरु\n1\nNaN\n०,१,२,३,४,५,६,७,८,९\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nआय.,सोम.,मंगळ.,बुध.,बिरे.,सुक्र.,शेन.\nजानेवारी,फेब्रुवारी,मार्च,एप्रिल,मे,जून,जुलै,ऑगस्ट,सप्टेंबर,ऑक्टोबर,नोवेम्बर,डिसेंबर,\nजानेवारी,फेब्रुवारी,मार्च,एप्रिल,मे,जून,जुलै,ऑगस्ट,सप्टेंबर,ऑक्टोबर,नोवेम्बर,डिसेंबर,\nम.पू.\n0\n-\nआयतार,सोमार,मंगळार,बुधवार,बिरेस्तार,सुक्रार,शेनवार\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\ndd MMMM\nजानेवारी,फेब्रुवारी,मार्च,एप्रिल,मे,जून,जुलै,ऑगस्ट,सप्टेंबर,ऑक्टोबर,नोवेम्बर,डिसेंबर,\nजानेवारी,फेब्रुवारी,मार्च,एप्रिल,मे,जून,जुलै,ऑगस्ट,सप्टेंबर,ऑक्टोबर,नोवेम्बर,डिसेंबर,\nइंग्रजी कॅलेन्डर\nHH:mm:ss\nम.नं.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nआ,स,म,ब,ब,स,श\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ky",
    "content": "ky\n0x0040\n\nKyrgyz\nКыргыз\nKyrgyz\nky\nkir\nKYR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nky\nTrue\n1251\n20880\nFalse\n;\n10007\n866\n"
  },
  {
    "path": "dna/Cultures/ky-KG",
    "content": "ky-KG\n0x0440\nky\nKyrgyz (Kyrgyzstan)\nКыргыз (Кыргызстан)\nKyrgyz (Kyrgyzstan)\nky\nkir\nKYR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nky-KG\nFalse\n1251\n20880\nFalse\n;\n10007\n866\n2\n-\n \n3\n8\n3\nсом\n0\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nInfinity\n+\nЖш,Дш,Шш,Шр,Бш,Жм,Иш\nЯнв,Фев,Мар,Апр,Май,Июн,Июл,Авг,Сен,Окт,Ноя,Дек,\nЯнв,Фев,Мар,Апр,Май,Июн,Июл,Авг,Сен,Окт,Ноя,Дек,\n\n0\n.\nЖекшемби,Дүйшөмбү,Шейшемби,Шаршемби,Бейшемби,Жума,Ишемби\n1\nd'-'MMMM yyyy'-ж.' H:mm:ss\nd'-'MMMM yyyy'-ж.'\nH:mm:ss\nd MMMM\nЯнварь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь,\nЯнварь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь,\nгригориан календары\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yy\nЖш,Дш,Шш,Шр,Бш,Жм,Иш\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy'-ж.'\n"
  },
  {
    "path": "dna/Cultures/lt",
    "content": "lt\n0x0027\n\nLithuanian\nlietuvių\nLithuanian\nlt\nlit\nLTH\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nlt\nTrue\n1257\n500\nFalse\n;\n10029\n775\n"
  },
  {
    "path": "dna/Cultures/lt-LT",
    "content": "lt-LT\n0x0427\nlt\nLithuanian (Lithuania)\nlietuvių (Lietuva)\nLithuanian (Lithuania)\nlt\nlit\nLTH\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nlt-LT\nFalse\n1257\n500\nFalse\n;\n10029\n775\n2\n,\n.\n3\n8\n3\nLt\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-begalybė\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\nbegalybė\n+\nSk,Pr,An,Tr,Kt,Pn,Št\nSau,Vas,Kov,Bal,Geg,Bir,Lie,Rgp,Rgs,Spl,Lap,Grd,\nSau,Vas,Kov,Bal,Geg,Bir,Lie,Rgp,Rgs,Spl,Lap,Grd,\n\n0\n.\nsekmadienis,pirmadienis,antradienis,trečiadienis,ketvirtadienis,penktadienis,šeštadienis\n1\nyyyy 'm.' MMMM d 'd.' HH:mm:ss\nyyyy 'm.' MMMM d 'd.'\nHH:mm:ss\nMMMM d 'd.'\nsausio,vasario,kovo,balandžio,gegužės,birželio,liepos,rugpjūčio,rugsėjo,spalio,lapkričio,gruodžio,\nsausis,vasaris,kovas,balandis,gegužė,birželis,liepa,rugpjūtis,rugsėjis,spalis,lapkritis,gruodis,\nGrigaliaus kalendorius\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy.MM.dd\nS,P,A,T,K,Pn,Š\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy 'm.' MMMM\n"
  },
  {
    "path": "dna/Cultures/lv",
    "content": "lv\n0x0026\n\nLatvian\nlatviešu\nLatvian\nlv\nlav\nLVI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nlv\nTrue\n1257\n500\nFalse\n;\n10029\n775\n"
  },
  {
    "path": "dna/Cultures/lv-LV",
    "content": "lv-LV\n0x0426\nlv\nLatvian (Latvia)\nlatviešu (Latvija)\nLatvian (Latvia)\nlv\nlav\nLVI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nlv-LV\nFalse\n1257\n500\nFalse\n;\n10029\n775\n2\n,\n \n3\n9\n2\nLs\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-bezgalība\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nbezgalība\n+\nSv,Pr,Ot,Tr,Ce,Pk,Se\nJan,Feb,Mar,Apr,Mai,Jūn,Jūl,Aug,Sep,Okt,Nov,Dec,\nJan,Feb,Mar,Apr,Mai,Jūn,Jūl,Aug,Sep,Okt,Nov,Dec,\n\n2\n.\nsvētdiena,pirmdiena,otrdiena,trešdiena,ceturtdiena,piektdiena,sestdiena\n1\ndddd, yyyy'. gada 'd. MMMM H:mm:ss\ndddd, yyyy'. gada 'd. MMMM\nH:mm:ss\nd. MMMM\njanvārī,februārī,martā,aprīlī,maijā,jūnijā,jūlijā,augustā,septembrī,oktobrī,novembrī,decembrī,\njanvāris,februāris,marts,aprīlis,maijs,jūnijs,jūlijs,augusts,septembris,oktobris,novembris,decembris,\nGregora kalendārs\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy.MM.dd.\nSv,Pr,Ot,Tr,Ce,Pk,Se\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy. MMMM\n"
  },
  {
    "path": "dna/Cultures/mi-NZ",
    "content": "mi-NZ\n0x0481\n\nMaori (New Zealand)\nReo Māori (Aotearoa)\nMaori\nmi\nmi\nMRI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nmi-NZ\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3\n1\n0\n$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nTa,Ma,Tū,We,Tāi,Pa,Hā\nKohi,Hui,Pou,Pae,Hara,Pipi,Hōngoi,Here,Mahu,Whi-nu,Whi-ra,Haki,\nKohi,Hui,Pou,Pae,Hara,Pipi,Hōngoi,Here,Mahu,Whi-nu,Whi-ra,Haki,\na.m.\n0\n/\nRātapu,Mane,Tūrei,Wenerei,Tāite,Paraire,Hātarei\n1\ndddd, d MMMM yyyy h:mm:ss tt\ndddd, d MMMM yyyy\nh:mm:ss tt\nMMMM dd\nKohi-tātea,Hui-tanguru,Poutū-te-rangi,Paenga-whāwhā,Haratua,Pipiri,Hōngoingoi,Here-turi-kōkā,Mahuru,Whiringa-ā-nuku,Whiringa-ā-rangi,Hakihea,\nKohi-tātea,Hui-tanguru,Poutū-te-rangi,Paenga-whāwhā,Haratua,Pipiri,Hōngoingoi,Here-turi-kōkā,Mahuru,Whiringa-ā-nuku,Whiringa-ā-rangi,Hakihea,\nGregorian Calendar\nh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/MM/yyyy\nTa,Ma,Tū,We,Tāi,Pa,Hā\nh:mm:ss tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/mk",
    "content": "mk\n0x002f\n\nMacedonian\nмакедонски јазик\nMacedonian\nmk\nmkd\nMKI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nmk\nTrue\n1251\n500\nFalse\n;\n10007\n866\n"
  },
  {
    "path": "dna/Cultures/mk-MK",
    "content": "mk-MK\n0x042f\nmk\nMacedonian (Former Yugoslav Republic of Macedonia)\nмакедонски јазик (Македонија)\nMacedonian (Former Yugoslav Republic of Macedonia)\nmk\nmkd\nMKI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nmk-MK\nFalse\n1251\n500\nFalse\n;\n10007\n866\n2\n,\n.\n3\n8\n3\nден.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nнед,пон,втр,срд,чет,пет,саб\nјан,фев,мар,апр,мај,јун,јул,авг,сеп,окт,ное,дек,\nјан,фев,мар,апр,мај,јун,јул,авг,сеп,окт,ное,дек,\n\n2\n.\nнедела,понеделник,вторник,среда,четврток,петок,сабота\n1\ndddd, dd MMMM yyyy HH:mm:ss\ndddd, dd MMMM yyyy\nHH:mm:ss\ndd MMMM\nјануари,февруари,март,април,мај,јуни,јули,август,септември,октомври,ноември,декември,\nјануари,февруари,март,април,мај,јуни,јули,август,септември,октомври,ноември,декември,\nгрегоријански календар\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nне,по,вт,ср,че,пе,са\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/ml-IN",
    "content": "ml-IN\n0x044c\n\nMalayalam (India)\nമലയാളം (ഭാരതം)\nMalayalam (India)\nml\nml\nMYM\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nml-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nക\n1\nNaN\n൦,൧,൨,൩,൪,൫,൬,൭,൮,൯\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nഞായറ്.,തിങ്കള്.,ചൊവ്വ.,ബുധന്.,വ്യാഴം.,വെളോളി.,ശനി.\nജനുവരി,ഫെബ്റുവരി,മാറ്ച്ച്,ഏപ്റില്,മെയ്,ജൂണ്,ജൂലൈ,ഓഗസ്ററ്,സെപ്ററംബറ്,ഒക്ടോബറ്,നവംബറ്,ഡിസംബറ്,\nജനുവരി,ഫെബ്റുവരി,മാറ്ച്ച്,ഏപ്റില്,മെയ്,ജൂണ്,ജൂലൈ,ഓഗസ്ററ്,സെപ്ററംബറ്,ഒക്ടോബറ്,നവംബറ്,ഡിസംബറ്,\nAM\n0\n-\nഞായറാഴ്ച,തിങ്കളാഴ്ച,ചൊവ്വാഴ്ച,ബുധനാഴ്ച,വ്യാഴാഴ്ച,വെള്ളിയാഴ്ച,ശനിയാഴ്ച\n1\ndd MMMM yyyy HH.mm.ss\ndd MMMM yyyy\nHH.mm.ss\nMMMM dd\nജനുവരി,ഫെബ്റുവരി,മാറ്ച്ച്,ഏപ്റില്,മെയ്,ജൂണ്,ജൂലൈ,ഓഗസ്ററ്,സെപ്ററംബറ്,ഒക്ടോബറ്,നവംബറ്,ഡിസംബറ്,\nജനുവരി,ഫെബ്റുവരി,മാറ്ച്ച്,ഏപ്റില്,മെയ്,ജൂണ്,ജൂലൈ,ഓഗസ്ററ്,സെപ്ററംബറ്,ഒക്ടോബറ്,നവംബറ്,ഡിസംബറ്,\nഇംഗ്ളീഷ് കലണ്ടറ്\nHH.mm.ss\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yy\nഞായറ്.,തിങ്കള്.,ചൊവ്വ.,ബുധന്.,വ്യാഴം.,വെളോളി.,ശനി.\nHH.mm.ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n.\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/mn",
    "content": "mn\n0x0050\n\nMongolian\nМонгол хэл\nMongolian\nmn\nmon\nMON\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nmn\nTrue\n1251\n20880\nFalse\n;\n10007\n866\n"
  },
  {
    "path": "dna/Cultures/mn-MN",
    "content": "mn-MN\n0x0450\nmn\nMongolian (Cyrillic, Mongolia)\nМонгол хэл (Монгол улс)\nMongolian (Cyrillic, Mongolia)\nmn\nmon\nMON\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nmn-MN\nFalse\n1251\n20880\nFalse\n;\n10007\n866\n2\n,\n \n3\n5\n1\n₮\n0\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\nНя,Да,Мя,Лх,Пү,Ба,Бя\nI,II,III,IV,V,VI,VII,VШ,IX,X,XI,XII,\nI,II,III,IV,V,VI,VII,VШ,IX,X,XI,XII,\n\n0\n.\nНям,Даваа,Мягмар,Лхагва,Пүрэв,Баасан,Бямба\n1\nyyyy 'оны' MMMM d H:mm:ss\nyyyy 'оны' MMMM d\nH:mm:ss\nd MMMM\n1 дүгээр сарын,2 дугаар сарын,3 дугаар сарын,4 дүгээр сарын,5 дугаар сарын,6 дугаар сарын,7 дугаар сарын,8 дугаар сарын,9 дүгээр сарын,10 дугаар сарын,11 дүгээр сарын,12 дугаар сарын,\n1 дүгээр сар,2 дугаар сар,3 дугаар сар,4 дүгээр сар,5 дугаар сар,6 дугаар сар,7 дугаар сар,8 дугаар сар,9 дүгээр сар,10 дугаар сар,11 дүгээр сар,12 дугаар сар,\nГрегорийн он тоолол\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyy.MM.dd\nНя,Да,Мя,Лх,Пү,Ба,Бя\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy 'он' MMMM\n"
  },
  {
    "path": "dna/Cultures/mr",
    "content": "mr\n0x004e\n\nMarathi\nमराठी\nMarathi\nmr\nmar\nMAR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nmr\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/mr-IN",
    "content": "mr-IN\n0x044e\nmr\nMarathi (India)\nमराठी (भारत)\nMarathi (India)\nmr\nmar\nMAR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nmr-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nरु\n1\nNaN\n०,१,२,३,४,५,६,७,८,९\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nरवि.,सोम.,मंगळ.,बुध.,गुरु.,शुक्र.,शनि.\nजाने.,फेब्रु.,मार्च,एप्रिल,मे,जून,जुलै,ऑगस्ट,सप्टें.,ऑक्टो.,नोव्हें.,डिसें.,\nजाने.,फेब्रु.,मार्च,एप्रिल,मे,जून,जुलै,ऑगस्ट,सप्टें.,ऑक्टो.,नोव्हें.,डिसें.,\nम.पू.\n0\n-\nरविवार,सोमवार,मंगळवार,बुधवार,गुरुवार,शुक्रवार,शनिवार\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\ndd MMMM\nजानेवारी,फेब्रुवारी,मार्च,एप्रिल,मे,जून,जुलै,ऑगस्ट,सप्टेंबर,ऑक्टोबर,नोव्हेंबर,डिसेंबर,\nजानेवारी,फेब्रुवारी,मार्च,एप्रिल,मे,जून,जुलै,ऑगस्ट,सप्टेंबर,ऑक्टोबर,नोव्हेंबर,डिसेंबर,\nइंग्रजी कॅलेन्डर\nHH:mm:ss\nम.नं.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nर,स,म,ब,ग,श,श\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ms",
    "content": "ms\n0x003e\n\nMalay\nBahasa Malaysia\nMalay\nms\nmsa\nMSL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nms\nTrue\n1252\n500\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/ms-BN",
    "content": "ms-BN\n0x083e\nms\nMalay (Brunei Darussalam)\nBahasa Malaysia (Brunei Darussalam)\nMalay (Brunei Darussalam)\nms\nmsa\nMSB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nms-BN\nFalse\n1252\n500\nFalse\n;\n10000\n850\n0\n,\n.\n3\n0\n0\n$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nAhad,Isnin,Sel,Rabu,Khamis,Jumaat,Sabtu\nJan,Feb,Mac,Apr,Mei,Jun,Jul,Ogos,Sept,Okt,Nov,Dis,\nJan,Feb,Mac,Apr,Mei,Jun,Jul,Ogos,Sept,Okt,Nov,Dis,\n\n0\n/\nAhad,Isnin,Selasa,Rabu,Khamis,Jumaat,Sabtu\n1\ndd MMMM yyyy H:mm:ss\ndd MMMM yyyy\nH:mm:ss\ndd MMMM\nJanuari,Februari,Mac,April,Mei,Jun,Julai,Ogos,September,Oktober,November,Disember,\nJanuari,Februari,Mac,April,Mei,Jun,Julai,Ogos,September,Oktober,November,Disember,\nkalendar Masehi\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nA,I,S,R,K,J,S\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/ms-MY",
    "content": "ms-MY\n0x043e\nms\nMalay (Malaysia)\nBahasa Malaysia (Malaysia)\nMalay (Malaysia)\nms\nmsa\nMSL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nms-MY\nFalse\n1252\n500\nFalse\n;\n10000\n850\n0\n,\n.\n3\n0\n0\nR\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nAhad,Isnin,Sel,Rabu,Khamis,Jumaat,Sabtu\nJan,Feb,Mac,Apr,Mei,Jun,Jul,Ogos,Sept,Okt,Nov,Dis,\nJan,Feb,Mac,Apr,Mei,Jun,Jul,Ogos,Sept,Okt,Nov,Dis,\n\n0\n/\nAhad,Isnin,Selasa,Rabu,Khamis,Jumaat,Sabtu\n1\ndd MMMM yyyy H:mm:ss\ndd MMMM yyyy\nH:mm:ss\ndd MMMM\nJanuari,Februari,Mac,April,Mei,Jun,Julai,Ogos,September,Oktober,November,Disember,\nJanuari,Februari,Mac,April,Mei,Jun,Julai,Ogos,September,Oktober,November,Disember,\nkalendar Masehi\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nA,I,S,R,K,J,S\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/mt-MT",
    "content": "mt-MT\n0x043a\n\nMaltese (Malta)\nMalti (Malta)\nMaltese\nmt\nmt\nMLT\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nmt-MT\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3\n1\n0\nLm\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nĦad,Tne,Tli,Erb,Ħam,Ġim,Sib\nJan,Fra,Mar,Apr,Mej,Ġun,Lul,Awi,Set,Ott,Nov,Diċ,\nJan,Fra,Mar,Apr,Mej,Ġun,Lul,Awi,Set,Ott,Nov,Diċ,\nAM\n0\n/\nIl-Ħadd,It-Tnejn,It-Tlieta,L-Erbgħa,Il-Ħamis,Il-Ġimgħa,Is-Sibt\n1\ndddd, d' ta\\' 'MMMM yyyy HH:mm:ss\ndddd, d' ta\\' 'MMMM yyyy\nHH:mm:ss\nMMMM dd\nJannar,Frar,Marzu,April,Mejju,Ġunju,Lulju,Awissu,Settembru,Ottubru,Novembru,Diċembru,\nJannar,Frar,Marzu,April,Mejju,Ġunju,Lulju,Awissu,Settembru,Ottubru,Novembru,Diċembru,\nKalendarju\nHH:mm:ss\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nĦad,Tne,Tli,Erb,Ħam,Ġim,Sib\nHH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/nb-NO",
    "content": "nb-NO\n0x0414\nno\nNorwegian, Bokmål (Norway)\nnorsk, bokmål (Norge)\nNorwegian, Bokmål (Norway)\nnb\nnob\nNOR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nnb-NO\nFalse\n1252\n20277\nFalse\n;\n10000\n850\n2\n,\n \n3\n12\n2\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-INF\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nINF\n+\nsø,ma,ti,on,to,fr,lø\njan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des,\njan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des,\n\n2\n.\nsøndag,mandag,tirsdag,onsdag,torsdag,fredag,lørdag\n1\nd. MMMM yyyy HH:mm:ss\nd. MMMM yyyy\nHH:mm:ss\nd. MMMM\njanuar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember,\njanuar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nsø,ma,ti,on,to,fr,lø\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/nl",
    "content": "nl\n0x0013\n\nDutch\nNederlands\nDutch\nnl\nnld\nNLD\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nnl\nTrue\n1252\n500\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/nl-BE",
    "content": "nl-BE\n0x0813\nnl\nDutch (Belgium)\nNederlands (België)\nDutch (Belgium)\nnl\nnld\nNLB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nnl-BE\nFalse\n1252\n500\nFalse\n;\n10000\n850\n2\n,\n.\n3\n12\n2\n€\n1\nNaN (Niet-een-getal)\n0,1,2,3,4,5,6,7,8,9\n-oneindig\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\noneindig\n+\nzo,ma,di,wo,do,vr,za\njan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec,\njan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec,\n\n0\n/\nzondag,maandag,dinsdag,woensdag,donderdag,vrijdag,zaterdag\n1\ndddd d MMMM yyyy H:mm:ss\ndddd d MMMM yyyy\nH:mm:ss\ndd MMMM\njanuari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december,\njanuari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december,\nGregoriaanse kalender\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/MM/yyyy\nzo,ma,di,wo,do,vr,za\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/nl-NL",
    "content": "nl-NL\n0x0413\nnl\nDutch (Netherlands)\nNederlands (Nederland)\nDutch (Netherlands)\nnl\nnld\nNLD\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nnl-NL\nFalse\n1252\n500\nFalse\n;\n10000\n850\n2\n,\n.\n3\n12\n2\n€\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nzo,ma,di,wo,do,vr,za\njan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec,\njan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec,\n\n2\n-\nzondag,maandag,dinsdag,woensdag,donderdag,vrijdag,zaterdag\n1\ndddd d MMMM yyyy H:mm:ss\ndddd d MMMM yyyy\nH:mm:ss\ndd MMMM\njanuari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december,\njanuari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december,\nGregoriaanse kalender\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd-M-yyyy\nzo,ma,di,wo,do,vr,za\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/nn-NO",
    "content": "nn-NO\n0x0814\nno\nNorwegian, Nynorsk (Norway)\nnorsk, nynorsk (Noreg)\nNorwegian, Nynorsk (Norway)\nnn\nnno\nNON\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nnn-NO\nFalse\n1252\n20277\nFalse\n;\n10000\n850\n2\n,\n \n3\n12\n2\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-INF\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nINF\n+\nsø,må,ty,on,to,fr,la\njan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des,\njan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des,\n\n2\n.\nsøndag,måndag,tysdag,onsdag,torsdag,fredag,laurdag\n1\nd. MMMM yyyy HH:mm:ss\nd. MMMM yyyy\nHH:mm:ss\nd. MMMM\njanuar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember,\njanuar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nsø,må,ty,on,to,fr,la\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/no",
    "content": "no\n0x0014\n\nNorwegian\nnorsk\nNorwegian\nno\nnor\nNOR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nno\nTrue\n1252\n20277\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/ns-ZA",
    "content": "ns-ZA\n0x046c\n\nNorthern Sotho (South Africa)\nSesotho sa Leboa (Afrika Borwa)\nNorthern Sotho\nns\nns\nNSO\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nns-ZA\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n2\n2\nR\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nLamorena,Mošupologo,Labobedi,Laboraro,Labone,Labohlano,Mokibelo\n0\ndd MMMM yyyy hh:mm:ss tt\ndd MMMM yyyy\nhh:mm:ss tt\nMMMM dd\nPherekgong,Hlakola,Mopitlo,Moranang,Mosegamanye,Ngoatobošego,Phuphu,Phato,Lewedi,Diphalana,Dibatsela,Manthole,\nPherekgong,Hlakola,Mopitlo,Moranang,Mosegamanye,Ngoatobošego,Phuphu,Phato,Lewedi,Diphalana,Dibatsela,Manthole,\nGregorian Calendar\nhh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/MM/dd\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nhh:mm:ss tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/pa",
    "content": "pa\n0x0046\n\nPunjabi\nਪੰਜਾਬੀ\nPunjabi\npa\npan\nPAN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\npa\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/pa-IN",
    "content": "pa-IN\n0x0446\npa\nPunjabi (India)\nਪੰਜਾਬੀ (ਭਾਰਤ)\nPunjabi (India)\npa\npan\nPAN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\npa-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nਰੁ\n1\nNaN\n੦,੧,੨,੩,੪,੫,੬,੭,੮,੯\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nਐਤ.,ਸੋਮ.,ਮੰਗਲ.,ਬੁਧ.,ਵੀਰ.,ਸ਼ੁਕਰ.,ਸ਼ਨੀ.\nਜਨਵਰੀ,ਫ਼ਰਵਰੀ,ਮਾਰਚ,ਅਪ੍ਰੈਲ,ਮਈ,ਜੂਨ,ਜੁਲਾਈ,ਅਗਸਤ,ਸਤੰਬਰ,ਅਕਤੂਬਰ,ਨਵੰਬਰ,ਦਸੰਬਰ,\nਜਨਵਰੀ,ਫ਼ਰਵਰੀ,ਮਾਰਚ,ਅਪ੍ਰੈਲ,ਮਈ,ਜੂਨ,ਜੁਲਾਈ,ਅਗਸਤ,ਸਤੰਬਰ,ਅਕਤੂਬਰ,ਨਵੰਬਰ,ਦਸੰਬਰ,\nਸਵੇਰੇ\n0\n-\nਐਤਵਾਰ,ਸੋਮਵਾਰ,ਮੰਗਲਵਾਰ,ਬੁਧਵਾਰ,ਵੀਰਵਾਰ,ਸ਼ੁੱਕਰਵਾਰ,ਸ਼ਨੀਚਰਵਾਰ\n1\ndd MMMM yyyy dddd tt hh:mm:ss\ndd MMMM yyyy dddd\ntt hh:mm:ss\ndd MMMM\nਜਨਵਰੀ,ਫ਼ਰਵਰੀ,ਮਾਰਚ,ਅਪ੍ਰੈਲ,ਮਈ,ਜੂਨ,ਜੁਲਾਈ,ਅਗਸਤ,ਸਤੰਬਰ,ਅਕਤੂਬਰ,ਨਵੰਬਰ,ਦਸੰਬਰ,\nਜਨਵਰੀ,ਫ਼ਰਵਰੀ,ਮਾਰਚ,ਅਪ੍ਰੈਲ,ਮਈ,ਜੂਨ,ਜੁਲਾਈ,ਅਗਸਤ,ਸਤੰਬਰ,ਅਕਤੂਬਰ,ਨਵੰਬਰ,ਦਸੰਬਰ,\nਅੰਗ੍ਰੇਜ਼ੀ ਕਲੰਡਰ\ntt hh:mm:ss\nਸ਼ਾਮ\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yy\nਐ,ਸ,ਮ,ਬ,ਵ,ਸ਼,ਸ਼\ntt hh:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/pl",
    "content": "pl\n0x0015\n\nPolish\npolski\nPolish\npl\npol\nPLK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\npl\nTrue\n1250\n20880\nFalse\n;\n10029\n852\n"
  },
  {
    "path": "dna/Cultures/pl-PL",
    "content": "pl-PL\n0x0415\npl\nPolish (Poland)\npolski (Polska)\nPolish (Poland)\npl\npol\nPLK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\npl-PL\nFalse\n1250\n20880\nFalse\n;\n10029\n852\n2\n,\n \n3\n8\n3\nzł\n1\nnie jest liczbą\n0,1,2,3,4,5,6,7,8,9\n-nieskończoność\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\n+nieskończoność\n+\nN,Pn,Wt,Śr,Cz,Pt,So\nsty,lut,mar,kwi,maj,cze,lip,sie,wrz,paź,lis,gru,\nsty,lut,mar,kwi,maj,cze,lip,sie,wrz,paź,lis,gru,\n\n2\n-\nniedziela,poniedziałek,wtorek,środa,czwartek,piątek,sobota\n1\nd MMMM yyyy HH:mm:ss\nd MMMM yyyy\nHH:mm:ss\nd MMMM\nstycznia,lutego,marca,kwietnia,maja,czerwca,lipca,sierpnia,września,października,listopada,grudnia,\nstyczeń,luty,marzec,kwiecień,maj,czerwiec,lipiec,sierpień,wrzesień,październik,listopad,grudzień,\nKalendarz gregoriański\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy-MM-dd\nN,Pn,Wt,Śr,Cz,Pt,So\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/pt",
    "content": "pt\n0x0016\n\nPortuguese\nPortuguês\nPortuguese\npt\npor\nPTB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\npt\nTrue\n1252\n500\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/pt-BR",
    "content": "pt-BR\n0x0416\npt\nPortuguese (Brazil)\nPortuguês (Brasil)\nPortuguese (Brazil)\npt\npor\nPTB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\npt-BR\nFalse\n1252\n500\nFalse\n;\n10000\n850\n2\n,\n.\n3\n9\n2\nR$\n1\nNaN (Não é um número)\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\n+Infinito\n+\ndom,seg,ter,qua,qui,sex,sáb\njan,fev,mar,abr,mai,jun,jul,ago,set,out,nov,dez,\njan,fev,mar,abr,mai,jun,jul,ago,set,out,nov,dez,\n\n0\n/\ndomingo,segunda-feira,terça-feira,quarta-feira,quinta-feira,sexta-feira,sábado\n0\ndddd, d' de 'MMMM' de 'yyyy H:mm:ss\ndddd, d' de 'MMMM' de 'yyyy\nH:mm:ss\ndd' de 'MMMM\njaneiro,fevereiro,março,abril,maio,junho,julho,agosto,setembro,outubro,novembro,dezembro,\njaneiro,fevereiro,março,abril,maio,junho,julho,agosto,setembro,outubro,novembro,dezembro,\nCalendário gregoriano\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/M/yyyy\ndom,seg,ter,qua,qui,sex,sáb\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/pt-PT",
    "content": "pt-PT\n0x0816\npt\nPortuguese (Portugal)\nportuguês (Portugal)\nPortuguese (Portugal)\npt\npor\nPTG\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\npt-PT\nFalse\n1252\n500\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\n€\n1\nNaN (Não é um número)\n0,1,2,3,4,5,6,7,8,9\n-Infinito\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\n+Infinito\n+\ndom,seg,ter,qua,qui,sex,sáb\nJan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez,\nJan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez,\n\n0\n-\ndomingo,segunda-feira,terça-feira,quarta-feira,quinta-feira,sexta-feira,sábado\n1\ndddd, d' de 'MMMM' de 'yyyy H:mm:ss\ndddd, d' de 'MMMM' de 'yyyy\nH:mm:ss\nd/M\nJaneiro,Fevereiro,Março,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro,\nJaneiro,Fevereiro,Março,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro,\nCalendário gregoriano\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\ndom,seg,ter,qua,qui,sex,sáb\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/quz-BO",
    "content": "quz-BO\n0x046b\n\nQuechua (Bolivia)\nrunasimi (Bolivia Suyu)\nQuechua (Bolivia)\nquz\nquz\nQUB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nquz-BO\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n14\n2\n$b\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nint,kil,ati,quy,Ch,Ill,k'u\nQul,Hat,Pau,ayr,Aym,Int,Ant,Qha,Uma,Kan,Aya,Kap,\nQul,Hat,Pau,ayr,Aym,Int,Ant,Qha,Uma,Kan,Aya,Kap,\na.m.\n0\n/\nintichaw,killachaw,atipachaw,quyllurchaw,Ch' askachaw,Illapachaw,k'uychichaw\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\nMMMM dd\nQulla puquy,Hatun puquy,Pauqar waray,ayriwa,Aymuray,Inti raymi,Anta Sitwa,Qhapaq Sitwa,Uma raymi,Kantaray,Ayamarq'a,Kapaq Raymi,\nQulla puquy,Hatun puquy,Pauqar waray,ayriwa,Aymuray,Inti raymi,Anta Sitwa,Qhapaq Sitwa,Uma raymi,Kantaray,Ayamarq'a,Kapaq Raymi,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nint,kil,ati,quy,Ch,Ill,k'u\nhh:mm:ss tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/quz-EC",
    "content": "quz-EC\n0x086b\n\nQuechua (Ecuador)\nrunasimi (Ecuador Suyu)\nQuechua (Ecuador)\nquz\nquz\nQUE\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nquz-EC\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n,\n.\n3\n14\n2\n$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nint,kil,ati,quy,Ch,Ill,k'u\nQul,Hat,Pau,ayr,Aym,Int,Ant,Qha,Uma,Kan,Aya,Kap,\nQul,Hat,Pau,ayr,Aym,Int,Ant,Qha,Uma,Kan,Aya,Kap,\n\n0\n/\nintichaw,killachaw,atipachaw,quyllurchaw,Ch' askachaw,Illapachaw,k'uychichaw\n0\ndddd, dd' de 'MMMM' de 'yyyy H:mm:ss\ndddd, dd' de 'MMMM' de 'yyyy\nH:mm:ss\nMMMM dd\nQulla puquy,Hatun puquy,Pauqar waray,ayriwa,Aymuray,Inti raymi,Anta Sitwa,Qhapaq Sitwa,Uma raymi,Kantaray,Ayamarq'a,Kapaq Raymi,\nQulla puquy,Hatun puquy,Pauqar waray,ayriwa,Aymuray,Inti raymi,Anta Sitwa,Qhapaq Sitwa,Uma raymi,Kantaray,Ayamarq'a,Kapaq Raymi,\ncalendario gregoriano\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nint,kil,ati,quy,Ch,Ill,k'u\nH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/quz-PE",
    "content": "quz-PE\n0x0c6b\n\nQuechua (Peru)\nrunasimi (Peru Suyu)\nQuechua (Peru)\nquz\nquz\nQUP\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nquz-PE\nFalse\n1252\n20284\nFalse\n,\n10000\n850\n2\n.\n,\n3\n12\n2\nS/.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nint,kil,ati,quy,Ch,Ill,k'u\nQul,Hat,Pau,ayr,Aym,Int,Ant,Qha,Uma,Kan,Aya,Kap,\nQul,Hat,Pau,ayr,Aym,Int,Ant,Qha,Uma,Kan,Aya,Kap,\na.m.\n0\n/\nintichaw,killachaw,atipachaw,quyllurchaw,Ch' askachaw,Illapachaw,k'uychichaw\n0\ndddd, dd' de 'MMMM' de 'yyyy hh:mm:ss tt\ndddd, dd' de 'MMMM' de 'yyyy\nhh:mm:ss tt\nMMMM dd\nQulla puquy,Hatun puquy,Pauqar waray,ayriwa,Aymuray,Inti raymi,Anta Sitwa,Qhapaq Sitwa,Uma raymi,Kantaray,Ayamarq'a,Kapaq Raymi,\nQulla puquy,Hatun puquy,Pauqar waray,ayriwa,Aymuray,Inti raymi,Anta Sitwa,Qhapaq Sitwa,Uma raymi,Kantaray,Ayamarq'a,Kapaq Raymi,\ncalendario gregoriano\nhh:mm:ss tt\np.m.\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nint,kil,ati,quy,Ch,Ill,k'u\nhh:mm:ss tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM' de 'yyyy\n"
  },
  {
    "path": "dna/Cultures/ro",
    "content": "ro\n0x0018\n\nRomanian\nromână\nRomanian\nro\nron\nROM\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nro\nTrue\n1250\n20880\nFalse\n;\n10029\n852\n"
  },
  {
    "path": "dna/Cultures/ro-RO",
    "content": "ro-RO\n0x0418\nro\nRomanian (Romania)\nromână (România)\nRomanian (Romania)\nro\nron\nROM\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nro-RO\nFalse\n1250\n20880\nFalse\n;\n10029\n852\n2\n,\n.\n3\n8\n3\nlei\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\nInfinity\n+\nD,L,Ma,Mi,J,V,S\nian.,feb.,mar.,apr.,mai.,iun.,iul.,aug.,sep.,oct.,nov.,dec.,\nian.,feb.,mar.,apr.,mai.,iun.,iul.,aug.,sep.,oct.,nov.,dec.,\n\n0\n.\nduminică,luni,marţi,miercuri,joi,vineri,sâmbătă\n1\nd MMMM yyyy HH:mm:ss\nd MMMM yyyy\nHH:mm:ss\nd MMMM\nianuarie,februarie,martie,aprilie,mai,iunie,iulie,august,septembrie,octombrie,noiembrie,decembrie,\nianuarie,februarie,martie,aprilie,mai,iunie,iulie,august,septembrie,octombrie,noiembrie,decembrie,\ncalendar Gregorian\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nD,L,Ma,Mi,J,V,S\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/ru",
    "content": "ru\n0x0019\n\nRussian\nрусский\nRussian\nru\nrus\nRUS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nru\nTrue\n1251\n20880\nFalse\n;\n10007\n866\n"
  },
  {
    "path": "dna/Cultures/ru-RU",
    "content": "ru-RU\n0x0419\nru\nRussian (Russia)\nрусский (Россия)\nRussian (Russia)\nru\nrus\nRUS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nru-RU\nFalse\n1251\n20880\nFalse\n;\n10007\n866\n2\n,\n \n3\n5\n1\nр.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-бесконечность\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nбесконечность\n+\nВс,Пн,Вт,Ср,Чт,Пт,Сб\nянв,фев,мар,апр,май,июн,июл,авг,сен,окт,ноя,дек,\nянв,фев,мар,апр,май,июн,июл,авг,сен,окт,ноя,дек,\n\n0\n.\nвоскресенье,понедельник,вторник,среда,четверг,пятница,суббота\n1\nd MMMM yyyy 'г.' H:mm:ss\nd MMMM yyyy 'г.'\nH:mm:ss\nMMMM dd\nянваря,февраля,марта,апреля,мая,июня,июля,августа,сентября,октября,ноября,декабря,\nЯнварь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь,\nгригорианский календарь\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nВс,Пн,Вт,Ср,Чт,Пт,Сб\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy 'г.'\n"
  },
  {
    "path": "dna/Cultures/sa",
    "content": "sa\n0x004f\n\nSanskrit\nसंस्कृत\nSanskrit\nsa\nsan\nSAN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nsa\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/sa-IN",
    "content": "sa-IN\n0x044f\nsa\nSanskrit (India)\nसंस्कृत (भारतम्)\nSanskrit (India)\nsa\nsan\nSAN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsa-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nरु\n1\nNaN\n०,१,२,३,४,५,६,७,८,९\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nरविवासरः,सोमवासरः,मङ्गलवासरः,बुधवासरः,गुरुवासरः,शुक्रवासरः,शनिवासरः\nजनवरी,फरवरी,मार्च,अप्रैल,मई,जून,जुलाई,अगस्त,सितम्बर,अक्तूबर,नवम्बर,दिसम्बर,\nजनवरी,फरवरी,मार्च,अप्रैल,मई,जून,जुलाई,अगस्त,सितम्बर,अक्तूबर,नवम्बर,दिसम्बर,\nपूर्वाह्न\n0\n-\nरविवासरः,सोमवासरः,मङ्गलवासरः,बुधवासरः,गुरुवासरः,शुक्रवासरः,शनिवासरः\n0\ndd MMMM yyyy dddd HH:mm:ss\ndd MMMM yyyy dddd\nHH:mm:ss\ndd MMMM\nजनवरी,फरवरी,मार्च,अप्रैल,मई,जून,जुलाई,अगस्त,सितम्बर,अक्तूबर,नवम्बर,दिसम्बर,\nजनवरी,फरवरी,मार्च,अप्रैल,मई,जून,जुलाई,अगस्त,सितम्बर,अक्तूबर,नवम्बर,दिसम्बर,\nख्रिस्ताब्द पञ्जिका\nHH:mm:ss\nअपराह्न\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nर,स,म,ब,ग,श,श\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/se-FI",
    "content": "se-FI\n0x0c3b\n\nSami (Northern) (Finland)\ndavvisámegiella (Suopma)\nSami, Northern (Finland)\nse\nse\nSMG\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nse-FI\nFalse\n1252\n20278\nFalse\n;\n10000\n850\n2\n,\n \n3\n8\n3\n€\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\nsotn,vuos,maŋ,gask,duor,bear,láv\nođđj,guov,njuk,cuo,mies,geas,suoi,borg,čakč,golg,skáb,juov,\nođđj,guov,njuk,cuo,mies,geas,suoi,borg,čakč,golg,skáb,juov,\n\n2\n.\nsotnabeaivi,vuossárga,maŋŋebárga,gaskavahkku,duorastat,bearjadat,lávvardat\n1\nMMMM d'. b. 'yyyy H:mm:ss\nMMMM d'. b. 'yyyy\nH:mm:ss\nMMMM dd\nođđajagemánu,guovvamánu,njukčamánu,cuoŋománu,miessemánu,geassemánu,suoidnemánu,borgemánu,čakčamánu,golggotmánu,skábmamánu,juovlamánu,\nođđajagemánnu,guovvamánnu,njukčamánnu,cuoŋománnu,miessemánnu,geassemánnu,suoidnemánnu,borgemánnu,čakčamánnu,golggotmánnu,skábmamánnu,juovlamánnu,\ngregoriaaninen kalenteri\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nsotn,vuos,maŋ,gask,duor,bear,láv\nH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/se-NO",
    "content": "se-NO\n0x043b\n\nSami (Northern) (Norway)\ndavvisámegiella (Norga)\nSami, Northern (Norway)\nse\nse\nSME\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nse-NO\nFalse\n1252\n20277\nFalse\n;\n10000\n850\n2\n,\n \n3\n12\n2\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\nsotn,vuos,maŋ,gask,duor,bear,láv\nođđj,guov,njuk,cuo,mies,geas,suoi,borg,čakč,golg,skáb,juov,\nođđj,guov,njuk,cuo,mies,geas,suoi,borg,čakč,golg,skáb,juov,\n\n2\n.\nsotnabeaivi,vuossárga,maŋŋebárga,gaskavahkku,duorastat,bearjadat,lávvardat\n1\nMMMM d'. b. 'yyyy HH:mm:ss\nMMMM d'. b. 'yyyy\nHH:mm:ss\nMMMM dd\nođđajagemánu,guovvamánu,njukčamánu,cuoŋománu,miessemánu,geassemánu,suoidnemánu,borgemánu,čakčamánu,golggotmánu,skábmamánu,juovlamánu,\nođđajagemánnu,guovvamánnu,njukčamánnu,cuoŋománnu,miessemánnu,geassemánnu,suoidnemánnu,borgemánnu,čakčamánnu,golggotmánnu,skábmamánnu,juovlamánnu,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nsotn,vuos,maŋ,gask,duor,bear,láv\nHH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/se-SE",
    "content": "se-SE\n0x083b\n\nSami (Northern) (Sweden)\ndavvisámegiella (Ruoŧŧa)\nSami, Northern (Sweden)\nse\nse\nSMF\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nse-SE\nFalse\n1252\n20278\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\nsotn,mán,dis,gask,duor,bear,láv\nođđj,guov,njuk,cuo,mies,geas,suoi,borg,čakč,golg,skáb,juov,\nođđj,guov,njuk,cuo,mies,geas,suoi,borg,čakč,golg,skáb,juov,\n\n2\n-\nsotnabeaivi,mánnodat,disdat,gaskavahkku,duorastat,bearjadat,lávvardat\n1\nMMMM d'. b. 'yyyy HH:mm:ss\nMMMM d'. b. 'yyyy\nHH:mm:ss\nMMMM dd\nođđajagemánu,guovvamánu,njukčamánu,cuoŋománu,miessemánu,geassemánu,suoidnemánu,borgemánu,čakčamánu,golggotmánu,skábmamánu,juovlamánu,\nođđajagemánnu,guovvamánnu,njukčamánnu,cuoŋománnu,miessemánnu,geassemánnu,suoidnemánnu,borgemánnu,čakčamánnu,golggotmánnu,skábmamánnu,juovlamánnu,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy-MM-dd\nsotn,mán,dis,gask,duor,bear,láv\nHH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sk",
    "content": "sk\n0x001b\n\nSlovak\nslovenčina\nSlovak\nsk\nslk\nSKY\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nsk\nTrue\n1250\n20880\nFalse\n;\n10029\n852\n"
  },
  {
    "path": "dna/Cultures/sk-SK",
    "content": "sk-SK\n0x041b\nsk\nSlovak (Slovakia)\nslovenčina (Slovenská republika)\nSlovak (Slovakia)\nsk\nslk\nSKY\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsk-SK\nFalse\n1250\n20880\nFalse\n;\n10029\n852\n2\n,\n \n3\n8\n3\nSk\n1\nNie je číslo\n0,1,2,3,4,5,6,7,8,9\n-nekonečno\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\n+nekonečno\n+\nne,po,ut,st,št,pi,so\nI,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII,\nI,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII,\n\n0\n. \nnedeľa,pondelok,utorok,streda,štvrtok,piatok,sobota\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\ndd MMMM\njanuára,februára,marca,apríla,mája,júna,júla,augusta,septembra,októbra,novembra,decembra,\njanuár,február,marec,apríl,máj,jún,júl,august,september,október,november,december,\ngregoriánsky kalendár\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd. M. yyyy\nne,po,ut,st,št,pi,so\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sl",
    "content": "sl\n0x0024\n\nSlovenian\nslovenski\nSlovenian\nsl\nslv\nSLV\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nsl\nTrue\n1250\n20880\nFalse\n;\n10029\n852\n"
  },
  {
    "path": "dna/Cultures/sl-SI",
    "content": "sl-SI\n0x0424\nsl\nSlovenian (Slovenia)\nslovenski (Slovenija)\nSlovenian (Slovenia)\nsl\nslv\nSLV\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsl-SI\nFalse\n1250\n20880\nFalse\n;\n10029\n852\n2\n,\n.\n3\n8\n3\nSIT\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-neskončnost\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\nneskončnost\n+\nned,pon,tor,sre,čet,pet,sob\njan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec,\njan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec,\n\n0\n.\nnedelja,ponedeljek,torek,sreda,četrtek,petek,sobota\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\nd. MMMM\njanuar,februar,marec,april,maj,junij,julij,avgust,september,oktober,november,december,\njanuar,februar,marec,april,maj,junij,julij,avgust,september,oktober,november,december,\ngregorijanski koledar\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nne,po,to,sr,če,pe,so\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sma-NO",
    "content": "sma-NO\n0x183b\n\nSami (Southern) (Norway)\nåarjelsaemiengiele (Nöörje)\nSami, Southern (Norway)\nsma\nsma\nSMA\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nsma-NO\nFalse\n1252\n20277\nFalse\n;\n10000\n850\n2\n,\n \n3\n12\n2\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\naej,måa,dæj,gask,duar,bearj,laav\ntsïen,goevt,njok,voer,sueh,ruff,snja,mïet,skïer,golk,rahk,goev,\ntsïen,goevt,njok,voer,sueh,ruff,snja,mïet,skïer,golk,rahk,goev,\n\n2\n.\naejlege,måanta,dæjsta,gaskevåhkoe,duarsta,bearjadahke,laavvardahke\n1\nMMMM d'. b. 'yyyy HH:mm:ss\nMMMM d'. b. 'yyyy\nHH:mm:ss\nMMMM dd\ntsïengelen,goevten,njoktjen,voerhtjen,suehpeden,ruffien,snjaltjen,mïetsken,skïereden,golken,rahkan,goeven,\ntsïengele,goevte,njoktje,voerhtje,suehpede,ruffie,snjaltje,mïetske,skïerede,golke,rahka,goeve,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\naej,måa,dæj,gask,duar,bearj,laav\nHH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sma-SE",
    "content": "sma-SE\n0x1c3b\n\nSami (Southern) (Sweden)\nåarjelsaemiengiele (Sveerje)\nSami, Southern (Sweden)\nsma\nsma\nSMB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nsma-SE\nFalse\n1252\n20278\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\naej,måa,dæj,gask,duar,bearj,laav\ntsïen,goevt,njok,voer,sueh,ruff,snja,mïet,skïer,golk,rahk,goev,\ntsïen,goevt,njok,voer,sueh,ruff,snja,mïet,skïer,golk,rahk,goev,\n\n2\n-\naejlege,måanta,dæjsta,gaskevåhkoe,duarsta,bearjadahke,laavvardahke\n1\nMMMM d'. b. 'yyyy HH:mm:ss\nMMMM d'. b. 'yyyy\nHH:mm:ss\nMMMM dd\ntsïengelen,goevten,njoktjen,voerhtjen,suehpeden,ruffien,snjaltjen,mïetsken,skïereden,golken,rahkan,goeven,\ntsïengele,goevte,njoktje,voerhtje,suehpede,ruffie,snjaltje,mïetske,skïerede,golke,rahka,goeve,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy-MM-dd\naej,måa,dæj,gask,duar,bearj,laav\nHH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/smj-NO",
    "content": "smj-NO\n0x103b\n\nSami (Lule) (Norway)\njulevusámegiella (Vuodna)\nSami, Lule (Norway)\nsmj\nsmj\nSMJ\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nsmj-NO\nFalse\n1252\n20277\nFalse\n;\n10000\n850\n2\n,\n \n3\n12\n2\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\nsåd,mán,dis,gas,duor,bier,láv\nådåj,guov,snju,vuor,moar,bieh,snji,bårg,ragá,gålg,basá,javl,\nådåj,guov,snju,vuor,moar,bieh,snji,bårg,ragá,gålg,basá,javl,\n\n2\n.\nsådnåbiejvve,mánnodahka,dijstahka,gasskavahkko,duorastahka,bierjjedahka,lávvodahka\n1\nMMMM d'. b. 'yyyy HH:mm:ss\nMMMM d'. b. 'yyyy\nHH:mm:ss\nMMMM dd\nådåjakmáno,guovvamáno,sjnjuktjamáno,vuoratjismáno,moarmesmáno,biehtsemáno,sjnjilltjamáno,bårggemáno,ragátmáno,gålgådismáno,basádismáno,javllamáno,\nådåjakmánno,guovvamánno,sjnjuktjamánno,vuoratjismánno,moarmesmánno,biehtsemánno,sjnjilltjamánno,bårggemánno,ragátmánno,gålgådismánno,basádismánno,javllamánno,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nsåd,mán,dis,gas,duor,bier,láv\nHH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/smj-SE",
    "content": "smj-SE\n0x143b\n\nSami (Lule) (Sweden)\njulevusámegiella (Svierik)\nSami, Lule (Sweden)\nsmj\nsmj\nSMK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nsmj-SE\nFalse\n1252\n20278\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\nájl,mán,dis,gas,duor,bier,láv\nådåj,guov,snju,vuor,moar,bieh,snji,bårg,ragá,gålg,basá,javl,\nådåj,guov,snju,vuor,moar,bieh,snji,bårg,ragá,gålg,basá,javl,\n\n2\n-\nájllek,mánnodahka,dijstahka,gasskavahkko,duorastahka,bierjjedahka,lávvodahka\n1\nMMMM d'. b. 'yyyy HH:mm:ss\nMMMM d'. b. 'yyyy\nHH:mm:ss\nMMMM dd\nådåjakmáno,guovvamáno,sjnjuktjamáno,vuoratjismáno,moarmesmáno,biehtsemáno,sjnjilltjamáno,bårggemáno,ragátmáno,gålgådismáno,basádismáno,javllamáno,\nådåjakmánno,guovvamánno,sjnjuktjamánno,vuoratjismánno,moarmesmánno,biehtsemánno,sjnjilltjamánno,bårggemánno,ragátmánno,gålgådismánno,basádismánno,javllamánno,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy-MM-dd\nájl,mán,dis,gas,duor,bier,láv\nHH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/smn-FI",
    "content": "smn-FI\n0x243b\n\nSami (Inari) (Finland)\nsämikielâ (Suomâ)\nSami, Inari (Finland)\nsmn\nsmn\nSMN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nsmn-FI\nFalse\n1252\n20278\nFalse\n;\n10000\n850\n2\n,\n \n3\n8\n3\n€\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\npa,vu,ma,ko,tu,vá,lá\nuđiv,kuov,njuh,cuoŋ,vyes,kesi,syei,porg,čoh,roov,ska,juov,\nuđiv,kuov,njuh,cuoŋ,vyes,kesi,syei,porg,čoh,roov,ska,juov,\n\n2\n.\npasepeivi,vuossargâ,majebargâ,koskokko,tuorâstâh,vástuppeivi,lávárdâh\n1\nMMMM d'. p. 'yyyy H:mm:ss\nMMMM d'. p. 'yyyy\nH:mm:ss\nMMMM dd\nuđđâivemáánu,kuovâmáánu,njuhčâmáánu,cuáŋuimáánu,vyesimáánu,kesimáánu,syeinimáánu,porgemáánu,čohčâmáánu,roovvâdmáánu,skammâmáánu,juovlâmáánu,\nuđđâivemáánu,kuovâmáánu,njuhčâmáánu,cuáŋuimáánu,vyesimáánu,kesimáánu,syeinimáánu,porgemáánu,čohčâmáánu,roovvâdmáánu,skammâmáánu,juovlâmáánu,\ngregoriaaninen kalenteri\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\npa,vu,ma,ko,tu,vá,lá\nH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sms-FI",
    "content": "sms-FI\n0x203b\n\nSami (Skolt) (Finland)\nsääm´ǩiõll (Lää´ddjânnam)\nSami, Skolt (Finland)\nsms\nsms\nSMS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nsms-FI\nFalse\n1252\n20278\nFalse\n;\n10000\n850\n2\n,\n \n3\n8\n3\n€\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nInfinity\n+\npâ,vu,mâ,se,ne,pi,su\nođjm,tä´lvv,pâzl,njuh,vue,ǩie,suei,på´r,čõh,kålg,ska,rost,\nođjm,tä´lvv,pâzl,njuh,vue,ǩie,suei,på´r,čõh,kålg,ska,rost,\n\n2\n.\npâ´sspei´vv,vuõssargg,mââibargg,seärad,nelljdpei´vv,piâtnâc,sue´vet\n1\nMMMM d'. p. 'yyyy H:mm:ss\nMMMM d'. p. 'yyyy\nH:mm:ss\nMMMM dd\nođđee´jjmannu,tä´lvvmannu,pâ´zzlâšttammannu,njuhččmannu,vue´ssmannu,ǩie´ssmannu,suei´nnmannu,på´rǧǧmannu,čõhččmannu,kålggmannu,skamm´mannu,rosttovmannu,\nođđee´jjmään,tä´lvvmään,pâ´zzlâšttammään,njuhččmään,vue´ssmään,ǩie´ssmään,suei´nnmään,på´rǧǧmään,čõhččmään,kålggmään,skamm´mään,rosttovmään,\ngregoriaaninen kalenteri\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\npâ,vu,mâ,se,ne,pi,su\nH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sq",
    "content": "sq\n0x001c\n\nAlbanian\nshqipe\nAlbanian\nsq\nsqi\nSQI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nsq\nTrue\n1250\n20880\nFalse\n;\n10029\n852\n"
  },
  {
    "path": "dna/Cultures/sq-AL",
    "content": "sq-AL\n0x041c\nsq\nAlbanian (Albania)\nshqipe (Shqipëria)\nAlbanian (Albania)\nsq\nsqi\nSQI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsq-AL\nFalse\n1250\n20880\nFalse\n;\n10029\n852\n2\n,\n.\n3\n5\n1\nLek\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nDie,Hën,Mar,Mër,Enj,Pre,Sht\nJan,Shk,Mar,Pri,Maj,Qer,Kor,Gsh,Sht,Tet,Nën,Dhj,\nJan,Shk,Mar,Pri,Maj,Qer,Kor,Gsh,Sht,Tet,Nën,Dhj,\nPD\n0\n-\ne diel,e hënë,e martë,e mërkurë,e enjte,e premte,e shtunë\n1\nyyyy-MM-dd h:mm:ss.tt\nyyyy-MM-dd\nh:mm:ss.tt\nMMMM dd\njanar,shkurt,mars,prill,maj,qershor,korrik,gusht,shtator,tetor,nëntor,dhjetor,\njanar,shkurt,mars,prill,maj,qershor,korrik,gusht,shtator,tetor,nëntor,dhjetor,\nGregorian Calendar\nh:mm:ss.tt\nMD\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy-MM-dd\nDi,Hë,Ma,Më,En,Pr,Sh\nh:mm.tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy-MM\n"
  },
  {
    "path": "dna/Cultures/sr",
    "content": "sr\n0x7c1a\n\nSerbian\nsrpski\nSerbian\nsr\nsrp\nSRB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nsr\nTrue\n1251\n21025\nFalse\n;\n10007\n855\n"
  },
  {
    "path": "dna/Cultures/sr-Cyrl-BA",
    "content": "sr-Cyrl-BA\n0x1c1a\n\nSerbian (Cyrillic) (Bosnia and Herzegovina)\nсрпски (Босна и Херцеговина)\nSerbian (Cyrillic, Bosnia and Herzegovina)\nsr\nsr\nSRN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nsr-Cyrl-BA\nFalse\n1251\n21025\nFalse\n;\n10007\n855\n2\n,\n.\n3\n8\n3\nКМ\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nнед,пон,уто,сре,чет,пет,суб\nјан,феб,мар,апр,мај,јун,јул,авг,сеп,окт,нов,дец,\nјан,феб,мар,апр,мај,јун,јул,авг,сеп,окт,нов,дец,\n\n0\n.\nнедеља,понедељак,уторак,среда,четвртак,петак,субота\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\nMMMM dd\nјануар,фебруар,март,април,мај,јун,јул,август,септембар,октобар,новембар,децембар,\nјануар,фебруар,март,април,мај,јун,јул,август,септембар,октобар,новембар,децембар,\nгрегоријански календар\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nнед,пон,уто,сре,чет,пет,суб\nH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/sr-Cyrl-CS",
    "content": "sr-Cyrl-CS\n0x0c1a\nsr\nSerbian (Cyrillic, Serbia)\nсрпски (Србија)\nSerbian (Cyrillic, Serbia)\nsr\nsrp\nSRB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsr-Cyrl-CS\nFalse\n1251\n21025\nFalse\n;\n10007\n855\n2\n,\n.\n3\n8\n3\nДин.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-бесконачност\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\n+бесконачност\n+\nнед,пон,уто,сре,чет,пет,суб\nјан,феб,мар,апр,мај,јун,јул,авг,сеп,окт,нов,дец,\nјан,феб,мар,апр,мај,јун,јул,авг,сеп,окт,нов,дец,\n\n0\n.\nнедеља,понедељак,уторак,среда,четвртак,петак,субота\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\nd. MMMM\nјануар,фебруар,март,април,мај,јун,јул,август,септембар,октобар,новембар,децембар,\nјануар,фебруар,март,април,мај,јун,јул,август,септембар,октобар,новембар,децембар,\nгрегоријански календар\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nне,по,ут,ср,че,пе,су\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sr-Latn-BA",
    "content": "sr-Latn-BA\n0x181a\n\nSerbian (Latin) (Bosnia and Herzegovina)\nsrpski (Bosna i Hercegovina)\nSerbian (Latin, Bosnia and Herzegovina)\nsr\nsr\nSRS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nsr-Latn-BA\nFalse\n1250\n870\nFalse\n;\n10082\n852\n2\n,\n.\n3\n8\n3\nKM\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nned,pon,uto,sre,čet,pet,sub\njan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec,\njan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec,\n\n0\n.\nnedelja,ponedeljak,utorak,sreda,četvrtak,petak,subota\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\nMMMM dd\njanuar,februar,mart,april,maj,jun,jul,avgust,septembar,oktobar,novembar,decembar,\njanuar,februar,mart,april,maj,jun,jul,avgust,septembar,oktobar,novembar,decembar,\ngregorijanski kalendar\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nned,pon,uto,sre,čet,pet,sub\nH:mm:ss\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sr-Latn-CS",
    "content": "sr-Latn-CS\n0x081a\nsr\nSerbian (Latin, Serbia)\nsrpski (Srbija)\nSerbian (Latin, Serbia)\nsr\nsrp\nSRL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsr-Latn-CS\nFalse\n1250\n500\nFalse\n;\n10029\n852\n2\n,\n.\n3\n8\n3\nDin.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-beskonačnost\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n1\n1\n%\n‰\n+beskonačnost\n+\nned,pon,uto,sre,čet,pet,sub\njan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec,\njan,feb,mar,apr,maj,jun,jul,avg,sep,okt,nov,dec,\n\n0\n.\nnedelja,ponedeljak,utorak,sreda,četvrtak,petak,subota\n1\nd. MMMM yyyy H:mm:ss\nd. MMMM yyyy\nH:mm:ss\nd. MMMM\njanuar,februar,mart,april,maj,jun,jul,avgust,septembar,oktobar,novembar,decembar,\njanuar,februar,mart,april,maj,jun,jul,avgust,septembar,oktobar,novembar,decembar,\ngregorijanski kalendar\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nne,po,ut,sr,če,pe,su\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sv",
    "content": "sv\n0x001d\n\nSwedish\nsvenska\nSwedish\nsv\nswe\nSVE\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nsv\nTrue\n1252\n20278\nFalse\n;\n10000\n850\n"
  },
  {
    "path": "dna/Cultures/sv-FI",
    "content": "sv-FI\n0x081d\nsv\nSwedish (Finland)\nsvenska (Finland)\nSwedish (Finland)\nsv\nswe\nSVF\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsv-FI\nFalse\n1252\n20278\nFalse\n;\n10000\n850\n2\n,\n \n3\n8\n3\n€\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-INF\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nINF\n+\nsö,må,ti,on,to,fr,lö\njan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec,\njan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec,\n\n2\n.\nsöndag,måndag,tisdag,onsdag,torsdag,fredag,lördag\n1\n'den 'd MMMM yyyy HH:mm:ss\n'den 'd MMMM yyyy\nHH:mm:ss\n'den 'd MMMM\njanuari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december,\njanuari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd.M.yyyy\nsö,må,ti,on,to,fr,lö\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sv-SE",
    "content": "sv-SE\n0x041d\nsv\nSwedish (Sweden)\nsvenska (Sverige)\nSwedish (Sweden)\nsv\nswe\nSVE\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsv-SE\nFalse\n1252\n20278\nFalse\n;\n10000\n850\n2\n,\n.\n3\n8\n3\nkr\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-INF\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n0\n0\n%\n‰\nINF\n+\nsö,må,ti,on,to,fr,lö\njan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec,\njan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec,\n\n2\n-\nsöndag,måndag,tisdag,onsdag,torsdag,fredag,lördag\n1\n'den 'd MMMM yyyy HH:mm:ss\n'den 'd MMMM yyyy\nHH:mm:ss\n'den 'd MMMM\njanuari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december,\njanuari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december,\ngregoriansk kalender\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy-MM-dd\nsö,må,ti,on,to,fr,lö\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/sw",
    "content": "sw\n0x0041\n\nKiswahili\nKiswahili\nKiswahili\nsw\nswa\nSWK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nsw\nTrue\n1252\n500\nFalse\n,\n10000\n437\n"
  },
  {
    "path": "dna/Cultures/sw-KE",
    "content": "sw-KE\n0x0441\nsw\nKiswahili (Kenya)\nKiswahili (Kenya)\nKiswahili (Kenya)\nsw\nswa\nSWK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsw-KE\nFalse\n1252\n500\nFalse\n,\n10000\n437\n2\n.\n,\n3\n0\n0\nS\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, MMMM dd, yyyy h:mm:ss tt\ndddd, MMMM dd, yyyy\nh:mm:ss tt\nMMMM dd\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nGregorian Calendar\nh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nM/d/yyyy\nS,M,T,W,T,F,S\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/syr",
    "content": "syr\n0x005a\n\nSyriac\nܣܘܪܝܝܐ\nSyriac\nsyr\nsyr\nSYR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nsyr\nTrue\n0\n500\nTrue\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/syr-SY",
    "content": "syr-SY\n0x045a\nsyr\nSyriac (Syria)\nܣܘܪܝܝܐ (سوريا)\nSyriac (Syria)\nsyr\nsyr\nSYR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nsyr-SY\nFalse\n0\n500\nTrue\n,\n2\n1\n2\n.\n,\n3\n3\n2\nل.س.‏\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\n܏ܐ ܏ܒܫ,܏ܒ ܏ܒܫ,܏ܓ ܏ܒܫ,܏ܕ ܏ܒܫ,܏ܗ ܏ܒܫ,܏ܥܪܘܒ,܏ܫܒ\n܏ܟܢ ܏ܒ,ܫܒܛ,ܐܕܪ,ܢܝܣܢ,ܐܝܪ,ܚܙܝܪܢ,ܬܡܘܙ,ܐܒ,ܐܝܠܘܠ,܏ܬܫ ܏ܐ,܏ܬܫ ܏ܒ,܏ܟܢ ܏ܐ,\n܏ܟܢ ܏ܒ,ܫܒܛ,ܐܕܪ,ܢܝܣܢ,ܐܝܪ,ܚܙܝܪܢ,ܬܡܘܙ,ܐܒ,ܐܝܠܘܠ,܏ܬܫ ܏ܐ,܏ܬܫ ܏ܒ,܏ܟܢ ܏ܐ,\nܩ.ܛ\n0\n/\nܚܕ ܒܫܒܐ,ܬܪܝܢ ܒܫܒܐ,ܬܠܬܐ ܒܫܒܐ,ܐܪܒܥܐ ܒܫܒܐ,ܚܡܫܐ ܒܫܒܐ,ܥܪܘܒܬܐ,ܫܒܬܐ\n6\ndd MMMM, yyyy hh:mm:ss tt\ndd MMMM, yyyy\nhh:mm:ss tt\ndd MMMM\nܟܢܘܢ ܐܚܪܝ,ܫܒܛ,ܐܕܪ,ܢܝܣܢ,ܐܝܪ,ܚܙܝܪܢ,ܬܡܘܙ,ܐܒ,ܐܝܠܘܠ,ܬܫܪܝ ܩܕܝܡ,ܬܫܪܝ ܐܚܪܝ,ܟܢܘܢ ܩܕܝܡ,\nܟܢܘܢ ܐܚܪܝ,ܫܒܛ,ܐܕܪ,ܢܝܣܢ,ܐܝܪ,ܚܙܝܪܢ,ܬܡܘܙ,ܐܒ,ܐܝܠܘܠ,ܬܫܪܝ ܩܕܝܡ,ܬܫܪܝ ܐܚܪܝ,ܟܢܘܢ ܩܕܝܡ,\nܣܘܪܓܕܐ ܓܪܝܓܘܪܝܐ\nhh:mm:ss tt\nܒ.ܛ\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\n܏,܏,܏,܏,܏,܏,܏\nhh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/ta",
    "content": "ta\n0x0049\n\nTamil\nதமிழ்\nTamil\nta\ntam\nTAM\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nta\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/ta-IN",
    "content": "ta-IN\n0x0449\nta\nTamil (India)\nதமிழ் (இந்தியா)\nTamil (India)\nta\ntam\nTAM\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nta-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nரூ\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nஞா,தி,செ,பு,வி,வெ,ச\nஜன.,பெப்.,மார்.,ஏப்.,மே,ஜூன்,ஜூலை,ஆக.,செப்.,அக்.,நவ.,டிச.,\nஜன.,பெப்.,மார்.,ஏப்.,மே,ஜூன்,ஜூலை,ஆக.,செப்.,அக்.,நவ.,டிச.,\nகாலை\n0\n-\nஞாயிறு,திங்கள்,செவ்வாய்,புதன்,வியாழன்,வெள்ளி,சனி\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\ndd MMMM\nஜனவரி,பெப்ரவரி,மார்ச்,ஏப்ரல்,மே,ஜூன்,ஜூலை,ஆகஸ்ட்,செப்டம்பர்,அக்டோபர்,நவம்பர்,டிசம்பர்,\nஜனவரி,பெப்ரவரி,மார்ச்,ஏப்ரல்,மே,ஜூன்,ஜூலை,ஆகஸ்ட்,செப்டம்பர்,அக்டோபர்,நவம்பர்,டிசம்பர்,\nஆங்கில வருடம்\nHH:mm:ss\nமாலை\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yyyy\nஞ,த,ச,ப,வ,வ,ச\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/te",
    "content": "te\n0x004a\n\nTelugu\nతెలుగు\nTelugu\nte\ntel\nTEL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nte\nTrue\n0\n500\nFalse\n,\n2\n1\n"
  },
  {
    "path": "dna/Cultures/te-IN",
    "content": "te-IN\n0x044a\nte\nTelugu (India)\nతెలుగు (భారత దేశం)\nTelugu (India)\nte\ntel\nTEL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nte-IN\nFalse\n0\n500\nFalse\n,\n2\n1\n2\n.\n,\n3,2\n12\n2\nరూ\n1\nNaN\n౦,౧,౨,౩,౪,౫,౬,౭,౮,౯\n-Infinity\n-\n2\n.\n,\n3,2\n1\n2\n.\n,\n3,2\n0\n0\n%\n‰\nInfinity\n+\nఆది.,సోమ.,మంగళ.,బుధ.,గురు.,శుక్ర.,శని.\nజనవరి,ఫిబ్రవరి,మార్చి,ఏప్రిల్,మే,జూన్,జూలై,ఆగస్టు,సెప్టెంబర్,అక్టోబర్,నవంబర్,డిసెంబర్,\nజనవరి,ఫిబ్రవరి,మార్చి,ఏప్రిల్,మే,జూన్,జూలై,ఆగస్టు,సెప్టెంబర్,అక్టోబర్,నవంబర్,డిసెంబర్,\nపూర్వాహ్న\n0\n-\nఆదివారం,సోమవారం,మంగళవారం,బుధవారం,గురువారం,శుక్రవారం,శనివారం\n1\ndd MMMM yyyy HH:mm:ss\ndd MMMM yyyy\nHH:mm:ss\ndd MMMM\nజనవరి,ఫిబ్రవరి,మార్చి,ఏప్రిల్,మే,జూన్,జూలై,ఆగస్టు,సెప్టెంబర్,అక్టోబర్,నవంబర్,డిసెంబర్,\nజనవరి,ఫిబ్రవరి,మార్చి,ఏప్రిల్,మే,జూన్,జూలై,ఆగస్టు,సెప్టెంబర్,అక్టోబర్,నవంబర్,డిసెంబర్,\nఇంగ్లీషు క్యాలండర్\nHH:mm:ss\nఅపరాహ్న\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd-MM-yy\nఆ,స,మ,బ,గ,శ,శ\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/th",
    "content": "th\n0x001e\n\nThai\nไทย\nThai\nth\ntha\nTHA\nThaiBuddhistCalendar\nThaiBuddhistCalendar,GregorianCalendar:Localized\n65\nth\nTrue\n874\n20838\nFalse\n,\n10021\n874\n"
  },
  {
    "path": "dna/Cultures/th-TH",
    "content": "th-TH\n0x041e\nth\nThai (Thailand)\nไทย (ไทย)\nThai (Thailand)\nth\ntha\nTHA\nThaiBuddhistCalendar\nThaiBuddhistCalendar,GregorianCalendar:Localized\n70\nth-TH\nFalse\n874\n20838\nFalse\n,\n10021\n874\n2\n.\n,\n3\n1\n0\n฿\n1\nNaN\n๐,๑,๒,๓,๔,๕,๖,๗,๘,๙\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nอา.,จ.,อ.,พ.,พฤ.,ศ.,ส.\nม.ค.,ก.พ.,มี.ค.,เม.ย.,พ.ค.,มิ.ย.,ก.ค.,ส.ค.,ก.ย.,ต.ค.,พ.ย.,ธ.ค.,\nม.ค.,ก.พ.,มี.ค.,เม.ย.,พ.ค.,มิ.ย.,ก.ค.,ส.ค.,ก.ย.,ต.ค.,พ.ย.,ธ.ค.,\nAM\n0\n/\nอาทิตย์,จันทร์,อังคาร,พุธ,พฤหัสบดี,ศุกร์,เสาร์\n1\nd MMMM yyyy H:mm:ss\nd MMMM yyyy\nH:mm:ss\ndd MMMM\nมกราคม,กุมภาพันธ์,มีนาคม,เมษายน,พฤษภาคม,มิถุนายน,กรกฎาคม,สิงหาคม,กันยายน,ตุลาคม,พฤศจิกายน,ธันวาคม,\nมกราคม,กุมภาพันธ์,มีนาคม,เมษายน,พฤษภาคม,มิถุนายน,กรกฎาคม,สิงหาคม,กันยายน,ตุลาคม,พฤศจิกายน,ธันวาคม,\nพุทธศักราช\nH:mm:ss\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/M/yyyy\nอ,จ,อ,พ,พ,ศ,ส\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/tn-ZA",
    "content": "tn-ZA\n0x0432\n\nTswana (South Africa)\nSetswana (Aforika Borwa)\nTswana\ntn\ntn\nTSN\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\ntn-ZA\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n2\n2\nR\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\nLatshipi,Mosupologo,Labobedi,Laboraro,Labone,Labotlhano,Lamatlhatso\n0\ndd MMMM yyyy hh:mm:ss tt\ndd MMMM yyyy\nhh:mm:ss tt\nMMMM dd\nFerikgong,Tlhakole,Mopitloe,Moranang,Motsheganong,Seetebosigo,Phukwi,Phatwe,Lwetse,Diphalane,Ngwanatsele,Sedimothole,\nFerikgong,Tlhakole,Mopitloe,Moranang,Motsheganong,Seetebosigo,Phukwi,Phatwe,Lwetse,Diphalane,Ngwanatsele,Sedimothole,\nGregorian Calendar\nhh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/MM/dd\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nhh:mm:ss tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/tr",
    "content": "tr\n0x001f\n\nTurkish\nTürkçe\nTurkish\ntr\ntur\nTRK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\ntr\nTrue\n1254\n20905\nFalse\n;\n10081\n857\n"
  },
  {
    "path": "dna/Cultures/tr-TR",
    "content": "tr-TR\n0x041f\ntr\nTurkish (Turkey)\nTürkçe (Türkiye)\nTurkish (Turkey)\ntr\ntur\nTRK\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\ntr-TR\nFalse\n1254\n20905\nFalse\n;\n10081\n857\n2\n,\n.\n3\n8\n3\nYTL\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n2\n2\n%\n‰\nInfinity\n+\nPaz,Pzt,Sal,Çar,Per,Cum,Cmt\nOca,Şub,Mar,Nis,May,Haz,Tem,Ağu,Eyl,Eki,Kas,Ara,\nOca,Şub,Mar,Nis,May,Haz,Tem,Ağu,Eyl,Eki,Kas,Ara,\n\n0\n.\nPazar,Pazartesi,Salı,Çarşamba,Perşembe,Cuma,Cumartesi\n1\ndd MMMM yyyy dddd HH:mm:ss\ndd MMMM yyyy dddd\nHH:mm:ss\ndd MMMM\nOcak,Şubat,Mart,Nisan,Mayıs,Haziran,Temmuz,Ağustos,Eylül,Ekim,Kasım,Aralık,\nOcak,Şubat,Mart,Nisan,Mayıs,Haziran,Temmuz,Ağustos,Eylül,Ekim,Kasım,Aralık,\nGregoryen Takvimi\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nPz,Pt,Sa,Ça,Pe,Cu,Ct\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/tt",
    "content": "tt\n0x0044\n\nTatar\nТатар\nTatar\ntt\ntat\nTTT\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\ntt\nTrue\n1251\n20880\nFalse\n;\n10007\n866\n"
  },
  {
    "path": "dna/Cultures/tt-RU",
    "content": "tt-RU\n0x0444\ntt\nTatar (Russia)\nТатар (Россия)\nTatar (Russia)\ntt\ntat\nTTT\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\ntt-RU\nFalse\n1251\n20880\nFalse\n;\n10007\n866\n2\n,\n \n3\n8\n3\nр.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nInfinity\n+\nЯкш,Дүш,Сиш,Чәрш,Пәнҗ,Җом,Шим\nГыйнв,Фев,Мар,Апр,май,Июн,Июл,Авг,Сен,Окт,Ноя,Дек,\nГыйнв,Фев,Мар,Апр,Май,Июн,Июл,Авг,Сен,Окт,Ноя,Дек,\n\n0\n.\nЯкшәмбе,Дүшәмбе,Сишәмбе,Чәршәмбе,Пәнҗешәмбе,Җомга,Шимбә\n1\nd MMMM yyyy H:mm:ss\nd MMMM yyyy\nH:mm:ss\nd MMMM\nгыйнварь,февраль,март,апрель,май,июнь,июль,август,сентябрь,октябрь,ноябрь,декабрь,\nГыйнварь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь,\nГригориан календаре\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nЯкш,Дүш,Сиш,Чәрш,Пәнҗ,Җом,Шим\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/uk",
    "content": "uk\n0x0022\n\nUkrainian\nукраїньска\nUkrainian\nuk\nukr\nUKR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nuk\nTrue\n1251\n500\nFalse\n;\n10017\n866\n"
  },
  {
    "path": "dna/Cultures/uk-UA",
    "content": "uk-UA\n0x0422\nuk\nUkrainian (Ukraine)\nукраїньска (Україна)\nUkrainian (Ukraine)\nuk\nukr\nUKR\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nuk-UA\nFalse\n1251\n500\nFalse\n;\n10017\n866\n2\n,\n \n3\n8\n3\nгрн.\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-безмежність\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nбезмежність\n+\nНд,Пн,Вт,Ср,Чт,Пт,Сб\nСіч,Лют,Бер,Кві,Тра,Чер,Лип,Сер,Вер,Жов,Лис,Гру,\nСіч,Лют,Бер,Кві,Тра,Чер,Лип,Сер,Вер,Жов,Лис,Гру,\n\n0\n.\nнеділя,понеділок,вівторок,середа,четвер,п'ятниця,субота\n1\nd MMMM yyyy' р.' H:mm:ss\nd MMMM yyyy' р.'\nH:mm:ss\nd MMMM\nсічня,лютого,березня,квітня,травня,червня,липня,серпня,вересня,жовтня,листопада,грудня,\nСічень,Лютий,Березень,Квітень,Травень,Червень,Липень,Серпень,Вересень,Жовтень,Листопад,Грудень,\nГригоріаньский календар\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nНд,Пн,Вт,Ср,Чт,Пт,Сб\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy' р.'\n"
  },
  {
    "path": "dna/Cultures/ur",
    "content": "ur\n0x0020\n\nUrdu\nاُردو\nUrdu\nur\nurd\nURD\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nur\nTrue\n1256\n20420\nTrue\n;\n10004\n720\n"
  },
  {
    "path": "dna/Cultures/ur-PK",
    "content": "ur-PK\n0x0420\nur\nUrdu (Islamic Republic of Pakistan)\nاُردو (پاکستان)\nUrdu (Islamic Republic of Pakistan)\nur\nurd\nURD\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish,HijriCalendar\n70\nur-PK\nFalse\n1256\n20420\nTrue\n;\n10004\n720\n2\n.\n,\n3\n3\n0\nRs\n1\nNaN\n۰,۱,۲,۳,۴,۵,۶,۷,۸,۹\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nاتوار,پير,منگل,بدھ,جمعرات,جمعه,هفته\nجنورى,فرورى,مارچ,اپريل,مئ,جون,جولاٸ,اگست,ستمبر,اکتوبر,نومبر,دسمبر,\nجنورى,فرورى,مارچ,اپريل,مئ,جون,جولاٸ,اگست,ستمبر,اکتوبر,نومبر,دسمبر,\nAM\n1\n/\nاتوار,پير,منگل,بدھ,جمعرات,جمعه,هفته\n1\ndd MMMM, yyyy h:mm:ss tt\ndd MMMM, yyyy\nh:mm:ss tt\ndd MMMM\nجنورى,فرورى,مارچ,اپريل,مئ,جون,جولاٸ,اگست,ستمبر,اکتوبر,نومبر,دسمبر,\nجنورى,فرورى,مارچ,اپريل,مئ,جون,جولاٸ,اگست,ستمبر,اکتوبر,نومبر,دسمبر,\nعيسوى سال\nh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nا,پ,م,ب,ج,ج,ه\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/uz",
    "content": "uz\n0x0043\n\nUzbek\nU'zbek\nUzbek\nuz\nuzb\nUZB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nuz\nTrue\n1254\n500\nFalse\n;\n10029\n857\n"
  },
  {
    "path": "dna/Cultures/uz-Cyrl-UZ",
    "content": "uz-Cyrl-UZ\n0x0843\nuz\nUzbek (Cyrillic, Uzbekistan)\nЎзбек (Ўзбекистон)\nUzbek (Cyrillic, Uzbekistan)\nuz\nuzb\nUZB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nuz-Cyrl-UZ\nFalse\n1251\n20880\nFalse\n;\n10007\n866\n2\n,\n \n3\n8\n3\nсўм\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nInfinity\n+\nякш,дш,сш,чш,пш,ж,ш\nЯнв,Фев,Мар,Апр,мая,Июн,Июл,Авг,Сен,Окт,Ноя,Дек,\nЯнв,Фев,Мар,Апр,Май,Июн,Июл,Авг,Сен,Окт,Ноя,Дек,\n\n0\n.\nякшанба,душанба,сешанба,чоршанба,пайшанба,жума,шанба\n1\nyyyy 'йил' d-MMMM HH:mm:ss\nyyyy 'йил' d-MMMM\nHH:mm:ss\nd-MMMM\nянвар,феврал,март,апрел,май,июн,июл,август,сентябр,октябр,ноябр,декабр,\nЯнвар,Феврал,Март,Апрел,Май,Июн,Июл,Август,Сентябр,Октябр,Ноябр,Декабр,\nгригорианский календарь\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd.MM.yyyy\nякш,дш,сш,чш,пш,ж,ш\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/uz-Latn-UZ",
    "content": "uz-Latn-UZ\n0x0443\nuz\nUzbek (Latin, Uzbekistan)\nU'zbek (U'zbekiston Respublikasi)\nUzbek (Latin, Uzbekistan)\nuz\nuzb\nUZB\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nuz-Latn-UZ\nFalse\n1254\n500\nFalse\n;\n10029\n857\n0\n,\n \n3\n8\n3\nsu'm\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n \n3\n1\n2\n,\n \n3\n1\n1\n%\n‰\nInfinity\n+\nyak.,dsh.,sesh.,chr.,psh.,jm.,sh.\nyanvar,fevral,mart,aprel,may,iyun,iyul,avgust,sentyabr,oktyabr,noyabr,dekabr,\nyanvar,fevral,mart,aprel,may,iyun,iyul,avgust,sentyabr,oktyabr,noyabr,dekabr,\n\n0\n/\nyakshanba,dushanba,seshanba,chorshanba,payshanba,juma,shanba\n1\nyyyy 'yil' d-MMMM HH:mm:ss\nyyyy 'yil' d-MMMM\nHH:mm:ss\nd-MMMM\nyanvar,fevral,mart,aprel,may,iyun,iyul,avgust,sentyabr,oktyabr,noyabr,dekabr,\nyanvar,fevral,mart,aprel,may,iyun,iyul,avgust,sentyabr,oktyabr,noyabr,dekabr,\nGrigorianski\nHH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM yyyy\nyak,dsh,sesh,chr,psh,jm,sh\nHH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/vi",
    "content": "vi\n0x002a\n\nVietnamese\nTiếng Việt\nVietnamese\nvi\nvie\nVIT\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nvi\nTrue\n1258\n500\nFalse\n,\n10000\n1258\n"
  },
  {
    "path": "dna/Cultures/vi-VN",
    "content": "vi-VN\n0x042a\nvi\nVietnamese (Vietnam)\nTiếng Việt (Việt Nam)\nVietnamese (Vietnam)\nvi\nvie\nVIT\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nvi-VN\nFalse\n1258\n500\nFalse\n,\n10000\n1258\n2\n,\n.\n3\n8\n3\n₫\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n,\n.\n3\n1\n2\n,\n.\n3\n0\n0\n%\n‰\nInfinity\n+\nCN,Hai,Ba,Tư,Năm,Sáu,Bảy\nThg1,Thg2,Thg3,Thg4,Thg5,Thg6,Thg7,Thg8,Thg9,Thg10,Thg11,Thg12,\nThg1,Thg2,Thg3,Thg4,Thg5,Thg6,Thg7,Thg8,Thg9,Thg10,Thg11,Thg12,\nSA\n0\n/\nChủ Nhật,Thứ Hai,Thứ Ba,Thứ Tư,Thứ Năm,Thứ Sáu,Thứ Bảy\n1\ndd MMMM yyyy h:mm:ss tt\ndd MMMM yyyy\nh:mm:ss tt\ndd MMMM\nTháng Giêng,Tháng Hai,Tháng Ba,Tháng Tư,Tháng Năm,Tháng Sáu,Tháng Bảy,Tháng Tám,Tháng Chín,Tháng Mười,Tháng Mười Một,Tháng Mười Hai,\nTháng Giêng,Tháng Hai,Tháng Ba,Tháng Tư,Tháng Năm,Tháng Sáu,Tháng Bảy,Tháng Tám,Tháng Chín,Tháng Mười,Tháng Mười Một,Tháng Mười Hai,\nDương Lịch\nh:mm:ss tt\nCH\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\ndd/MM/yyyy\nC,H,B,T,N,S,B\nh:mm tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/xh-ZA",
    "content": "xh-ZA\n0x0434\n\nXhosa (South Africa)\nisiXhosa (uMzantsi Afrika)\nXhosa\nxh\nxh\nXHO\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nxh-ZA\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n2\n2\nR\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\niCawa,uMvulo,uLwesibini,uLwesithathu,uLwesine,uLwesihlanu,uMgqibelo\n0\ndd MMMM yyyy hh:mm:ss tt\ndd MMMM yyyy\nhh:mm:ss tt\nMMMM dd\neyoMqungu,eyoMdumba,eyoKwindla,Tshazimpuzi,Canzibe,eyeSilimela,eyeKhala,eyeThupha,eyoMsintsi,eyeDwara,eyeNkanga,eyoMnga,\neyoMqungu,eyoMdumba,eyoKwindla,Tshazimpuzi,Canzibe,eyeSilimela,eyeKhala,eyeThupha,eyoMsintsi,eyeDwara,eyeNkanga,eyoMnga,\nGregorian Calendar\nhh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/MM/dd\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nhh:mm:ss tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Cultures/zh-CHS",
    "content": "zh-CHS\n0x0004\nzh-Hans\nChinese (Simplified)\n中文(简体)\nChinese (Simplified)\nzh\nzho\nCHS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n65\nzh-Hans\nTrue\n936\n500\nFalse\n,\n10008\n936\n"
  },
  {
    "path": "dna/Cultures/zh-CHT",
    "content": "zh-CHT\n0x7c04\nzh-Hant\nChinese (Traditional)\n中文(繁體)\nChinese (Traditional)\nzh\nzho\nCHT\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish\n65\nzh-Hant\nTrue\n950\n500\nFalse\n,\n10002\n950\n"
  },
  {
    "path": "dna/Cultures/zh-CN",
    "content": "zh-CN\n0x0804\nzh-CHS\nChinese (People's Republic of China)\n中文(中华人民共和国)\nChinese (People's Republic of China)\nzh\nzho\nCHS\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nzh-CN\nFalse\n936\n500\nFalse\n,\n10008\n936\n2\n.\n,\n3\n2\n0\n￥\n1\n非数字\n0,1,2,3,4,5,6,7,8,9\n负无穷大\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n1\n1\n%\n‰\n正无穷大\n+\n日,一,二,三,四,五,六\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n上午\n0\n/\n星期日,星期一,星期二,星期三,星期四,星期五,星期六\n0\nyyyy'年'M'月'd'日' H:mm:ss\nyyyy'年'M'月'd'日'\nH:mm:ss\nM'月'd'日'\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n公历\nH:mm:ss\n下午\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/M/d\n日,一,二,三,四,五,六\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy'年'M'月'\n"
  },
  {
    "path": "dna/Cultures/zh-HK",
    "content": "zh-HK\n0x0c04\nzh-CHT\nChinese (Hong Kong S.A.R.)\n中文(香港特别行政區)\nChinese (Hong Kong S.A.R.)\nzh\nzho\nZHH\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nzh-HK\nFalse\n950\n500\nFalse\n,\n10002\n950\n2\n.\n,\n3\n0\n0\nHK$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n1\n1\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\n\n0\n/\nSunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday\n0\ndddd, d MMMM, yyyy H:mm:ss\ndddd, d MMMM, yyyy\nH:mm:ss\nd MMMM\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\nJanuary,February,March,April,May,June,July,August,September,October,November,December,\n日曆\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/M/yyyy\nSu,Mo,Tu,We,Th,Fr,Sa\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/zh-MO",
    "content": "zh-MO\n0x1404\nzh-CHT\nChinese (Macao S.A.R.)\n中文(澳門特别行政區)\nChinese (Macao S.A.R.)\nzh\nzho\nZHM\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nzh-MO\nFalse\n950\n500\nFalse\n,\n10002\n950\n2\n.\n,\n3\n0\n0\nMOP\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n1\n1\n%\n‰\nInfinity\n+\n星期日,星期一,星期二,星期三,星期四,星期五,星期六\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n\n0\n/\n星期日,星期一,星期二,星期三,星期四,星期五,星期六\n0\ndddd, d MMMM, yyyy H:mm:ss\ndddd, d MMMM, yyyy\nH:mm:ss\nd MMMM\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n西曆\nH:mm:ss\n\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/M/yyyy\n日,一,二,三,四,五,六\nH:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/zh-SG",
    "content": "zh-SG\n0x1004\nzh-CHS\nChinese (Singapore)\n中文(新加坡)\nChinese (Singapore)\nzh\nzho\nZHI\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n70\nzh-SG\nFalse\n936\n500\nFalse\n,\n10008\n936\n2\n.\n,\n3\n0\n0\n$\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n1\n1\n%\n‰\nInfinity\n+\n星期日,星期一,星期二,星期三,星期四,星期五,星期六\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\nAM\n0\n/\n星期日,星期一,星期二,星期三,星期四,星期五,星期六\n0\ndddd, d MMMM, yyyy tt h:mm:ss\ndddd, d MMMM, yyyy\ntt h:mm:ss\nd MMMM\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n西历\ntt h:mm:ss\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nd/M/yyyy\n日,一,二,三,四,五,六\ntt h:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM, yyyy\n"
  },
  {
    "path": "dna/Cultures/zh-TW",
    "content": "zh-TW\n0x0404\nzh-CHT\nChinese (Taiwan)\n中文(台灣)\nChinese (Taiwan)\nzh\nzho\nCHT\nGregorianCalendar:Localized\nGregorianCalendar:Localized,GregorianCalendar:USEnglish,TaiwanCalendar\n70\nzh-TW\nFalse\n950\n500\nFalse\n,\n10002\n950\n2\n.\n,\n3\n1\n0\nNT$\n1\n不是一個數字\n0,1,2,3,4,5,6,7,8,9\n負無窮大\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n1\n1\n%\n‰\n正無窮大\n+\n星期日,星期一,星期二,星期三,星期四,星期五,星期六\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n上午\n0\n/\n星期日,星期一,星期二,星期三,星期四,星期五,星期六\n0\nyyyy'年'M'月'd'日' tt hh:mm:ss\nyyyy'年'M'月'd'日'\ntt hh:mm:ss\nM'月'd'日'\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,\n西曆 (中文)\ntt hh:mm:ss\n下午\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/M/d\n日,一,二,三,四,五,六\ntt hh:mm\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nyyyy'年'M'月'\n"
  },
  {
    "path": "dna/Cultures/zu-ZA",
    "content": "zu-ZA\n0x0435\n\nZulu (South Africa)\nisiZulu (iNingizimu Afrika)\nZulu\nzu\nzu\nZUL\nGregorianCalendar:Localized\nGregorianCalendar:Localized\n38\nzu-ZA\nFalse\n1252\n500\nFalse\n,\n10000\n850\n2\n.\n,\n3\n2\n2\nR\n1\nNaN\n0,1,2,3,4,5,6,7,8,9\n-Infinity\n-\n2\n.\n,\n3\n1\n2\n.\n,\n3\n0\n0\n%\n‰\nInfinity\n+\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nJan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec,\nAM\n0\n/\niSonto,uMsombuluko,uLwesibili,uLwesithathu,uLwesine,uLwesihlanu,uMgqibelo\n0\ndd MMMM yyyy hh:mm:ss tt\ndd MMMM yyyy\nhh:mm:ss tt\nMMMM dd\nuJanuwari,uFebuwari,uMashi,uAprhili,uMeyi,uJuni,uJulayi,uAgaste,uSepthemba,uOkthoba,uNovemba,uDisemba,\nuJanuwari,uFebuwari,uMashi,uAprhili,uMeyi,uJuni,uJulayi,uAgaste,uSepthemba,uOkthoba,uNovemba,uDisemba,\nGregorian Calendar\nhh:mm:ss tt\nPM\nddd, dd MMM yyyy HH':'mm':'ss 'GMT'\nyyyy/MM/dd\nSun,Mon,Tue,Wed,Thu,Fri,Sat\nhh:mm:ss tt\nyyyy'-'MM'-'dd'T'HH':'mm':'ss\n:\nyyyy'-'MM'-'dd HH':'mm':'ss'Z'\nMMMM yyyy\n"
  },
  {
    "path": "dna/Delegate.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"Delegate.h\"\n#include \"MetaData.h\"\n#include \"Heap.h\"\n\n// Note that care is needed to ensure the target object refered to in the delegate is not accidently\n// garbage collected.\n// Because a non-precise GC is currently used, this just happens automatically.\n// The HEAP_PTR targetObj keeps the target object alive.\n\ntypedef struct tDelegate_ tDelegate;\nstruct tDelegate_ {\n\t// These must match the definition in Delegate.cs\n\t// The target object, null if calling a static method\n\tHEAP_PTR targetObj;\n\t// The target method\n\ttMD_MethodDef *pTargetMethod;\n\t// The next delegate in a multicast delegate\n\ttDelegate *pNext;\n};\n\ntMD_MethodDef* Delegate_GetMethod(void *pThis_) {\n\ttDelegate *pThis = (tDelegate*)pThis_;\n\n\treturn pThis->pTargetMethod;\n}\n\ntMD_MethodDef* Delegate_GetMethodAndStore(void *pThis_, HEAP_PTR *pTargetObj, void **ppNextDelegate) {\n\ttDelegate *pThis = (tDelegate*)pThis_;\n\n\t*pTargetObj = pThis->targetObj;\n\tif (ppNextDelegate != NULL) {\n\t\t*ppNextDelegate = pThis->pNext;\n\t}\n\treturn pThis->pTargetMethod;\n}\n\nstatic tAsyncCall* ctor(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t// Note that the 'this' object is already allocated because this method is not\n\t// marked as 'InternalMethod' - it is marked as 'runtime'\n\ttDelegate *pThis = (tDelegate*)pThis_;\n\n\tpThis->targetObj = ((HEAP_PTR*)pParams)[0];\n\tpThis->pTargetMethod = ((tMD_MethodDef**)pParams)[1];\n\tpThis->pNext = NULL;\n\n\treturn NULL;\n}\n\nfnInternalCall Map_Delegate(tMD_MethodDef *pMethod) {\n\t// Note that it is not neccessary to check argument types here, as delegates are very tightly controlled\n\tif (strcmp(pMethod->name, \".ctor\") == 0) {\n\t\treturn ctor;\n\t}\n\n\treturn NULL;\n}"
  },
  {
    "path": "dna/Delegate.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined (__DELEGATE_H)\n#define __DELEGATE_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\nfnInternalCall Map_Delegate(tMD_MethodDef *pMethod);\n\ntMD_MethodDef* Delegate_GetMethod(void *pThis_);\ntMD_MethodDef* Delegate_GetMethodAndStore(void *pThis_, HEAP_PTR *pTargetObj, void **ppNextDelegate);\n\n\n#endif"
  },
  {
    "path": "dna/EvalStack.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined (__EVALSTACK_H)\n#define __EVALSTACK_H\n\n#define EVALSTACK_INT64 0\n#define EVALSTACK_INT32 1\n#define EVALSTACK_INTNATIVE 2\n//#define EVALSTACK_F 3\n#define EVALSTACK_F64 3\n#define EVALSTACK_PTR 4\n#define EVALSTACK_O 5\n//#define EVALSTACK_TRANSPTR 6\n#define EVALSTACK_F32 6\n#define EVALSTACK_VALUETYPE 7\n\n\n// dummy value used for methods that return nothing (void)\n#define EVALSTACK_VOID 0xff\n\n#endif"
  },
  {
    "path": "dna/Finalizer.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"Finalizer.h\"\n\nstatic HEAP_PTR *ppToFinalize;\nstatic int toFinalizeOfs, toFinalizeCapacity;\n\nvoid Finalizer_Init() {\n\ttoFinalizeCapacity = 4;\n\tppToFinalize = (HEAP_PTR*)malloc(toFinalizeCapacity * sizeof(void*));\n\ttoFinalizeOfs = 0;\n}\n\nvoid AddFinalizer(HEAP_PTR ptr) {\n\tif (toFinalizeOfs >= toFinalizeCapacity) {\n\t\ttoFinalizeCapacity <<= 1;\n\t\tppToFinalize = realloc(ppToFinalize, toFinalizeCapacity * sizeof(void*));\n\t}\n\tppToFinalize[toFinalizeOfs++] = ptr;\n}\n\nHEAP_PTR GetNextFinalizer() {\n\tif (toFinalizeOfs == 0) {\n\t\treturn NULL;\n\t}\n\treturn ppToFinalize[--toFinalizeOfs];\n}"
  },
  {
    "path": "dna/Finalizer.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined (__FINALIZER_H)\n#define __FINALIZER_H\n\nvoid Finalizer_Init();\n\nvoid AddFinalizer(PTR ptr);\nHEAP_PTR GetNextFinalizer();\n\n#endif"
  },
  {
    "path": "dna/Generics.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"Generics.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n#include \"Type.h\"\n#include \"EvalStack.h\"\n\nvoid Generic_GetHeapRoots(tHeapRoots *pHeapRoots, tMD_TypeDef *pTypeDef) {\n\ttGenericInstance *pInst = pTypeDef->pGenericInstances;\n\twhile (pInst != NULL) {\n\t\ttMD_TypeDef *pTypeDef = pInst->pInstanceTypeDef;\n\t\tif (pTypeDef->staticFieldSize > 0) {\n\t\t\tHeap_SetRoots(pHeapRoots, pTypeDef->pStaticFields, pTypeDef->staticFieldSize);\n\t\t}\n\t\tpInst = pInst->pNext;\n\t}\n}\n\ntMD_TypeDef* Generics_GetGenericTypeFromSig\n\t(tMetaData *pMetaData, SIG *pSig, tMD_TypeDef **ppCallingClassTypeArgs, tMD_TypeDef **ppCallingMethodTypeArgs) {\n\ttMD_TypeDef *pCoreType, *pRet;\n\tU32 numTypeArgs, i;\n\ttMD_TypeDef **ppTypeArgs;\n\n\tpCoreType = Type_GetTypeFromSig(pMetaData, pSig, ppCallingClassTypeArgs, ppCallingMethodTypeArgs);\n\tMetaData_Fill_TypeDef(pCoreType, ppCallingClassTypeArgs, ppCallingMethodTypeArgs); //NULL, NULL);\n\n\tnumTypeArgs = MetaData_DecodeSigEntry(pSig);\n\tppTypeArgs = (tMD_TypeDef**)malloc(numTypeArgs * sizeof(tMD_TypeDef*));\n\tfor (i=0; i<numTypeArgs; i++) {\n\t\tppTypeArgs[i] = Type_GetTypeFromSig(pMetaData, pSig, ppCallingClassTypeArgs, ppCallingMethodTypeArgs);\n\t\tif (ppTypeArgs[i] != NULL) {\n\t\t\tMetaData_Fill_TypeDef(ppTypeArgs[i], NULL, NULL);\n\t\t}\n\t}\n\n\tpRet = Generics_GetGenericTypeFromCoreType(pCoreType, numTypeArgs, ppTypeArgs);\n\tfree(ppTypeArgs);\n\treturn pRet;\n}\n\n// TODO: This is not the most efficient way of doing this, as it has to search through all the\n// entries in the GenericParams table for all lookups. This can be improved.\nstatic tMD_GenericParam* FindGenericParam(tMD_TypeDef *pCoreType, U32 typeArgIndex) {\n\ttMD_GenericParam *pGenericParam;\n\tU32 i;\n\n\tpGenericParam = (tMD_GenericParam*)MetaData_GetTableRow(pCoreType->pMetaData, MAKE_TABLE_INDEX(MD_TABLE_GENERICPARAM, 1));\n\n\tfor (i=0; i<pCoreType->pMetaData->tables.numRows[MD_TABLE_GENERICPARAM]; i++, pGenericParam++) {\n\t\tif (pGenericParam->owner == pCoreType->tableIndex && pGenericParam->number == typeArgIndex) {\n\t\t\treturn pGenericParam;\n\t\t}\n\t}\n\treturn NULL;\n}\n\ntMD_TypeDef* Generics_GetGenericTypeFromCoreType(tMD_TypeDef *pCoreType, U32 numTypeArgs, tMD_TypeDef **ppTypeArgs) {\n\ttGenericInstance *pInst;\n\ttMD_TypeDef *pTypeDef;\n\tU32 i;\n\tunsigned char name[2048];\n\ttMetaData *pMetaData;\n\n\tpMetaData = pCoreType->pMetaData;\n\tMetaData_Fill_TypeDef(pCoreType, NULL, NULL);\n\n\t// See if we have already built an instantiation of this type with the given type args.\n\tpInst = pCoreType->pGenericInstances;\n\twhile (pInst != NULL) {\n\t\tif (pInst->numTypeArgs == numTypeArgs &&\n\t\t\tmemcmp(pInst->pTypeArgs, ppTypeArgs, numTypeArgs * sizeof(tMD_TypeDef*)) == 0) {\n\t\t\treturn pInst->pInstanceTypeDef;\n\t\t}\n\t\tpInst = pInst->pNext;\n\t}\n\n\t// This has not already been instantiated, so instantiate it now.\n\tpInst = (tGenericInstance*)mallocForever(sizeof(tGenericInstance) + numTypeArgs * sizeof(tMD_TypeDef*));\n\t// Insert this into the chain of instantiations.\n\tpInst->pNext = pCoreType->pGenericInstances;\n\tpCoreType->pGenericInstances = pInst;\n\t// Copy the type args into the instantiation.\n\tpInst->numTypeArgs = numTypeArgs;\n\tmemcpy(pInst->pTypeArgs, ppTypeArgs, numTypeArgs * sizeof(tMD_TypeDef*));\n\n\t// Create the new instantiated type\n\tpInst->pInstanceTypeDef = pTypeDef = TMALLOCFOREVER(tMD_TypeDef);\n\tmemset(pTypeDef, 0, sizeof(tMD_TypeDef));\n\t// Make the name of the instantiation.\n\tstrcpy(name, pCoreType->name);\n\tstrcat(name, \"[\");\n\tfor (i=0; i<numTypeArgs; i++) {\n\t\tif (i > 0) {\n\t\t\tstrcat(name, \",\");\n\t\t}\n\t\tif (ppTypeArgs[i] != NULL) {\n\t\t\tsprintf(strchr(name, 0), \"%s.%s\", ppTypeArgs[i]->nameSpace, ppTypeArgs[i]->name);\n\t\t} else {\n\t\t\ttMD_GenericParam *pGenericParam = FindGenericParam(pCoreType, i);\n\t\t\tif (pGenericParam != NULL) {\n\t\t\t\tsprintf(strchr(name, 0), pGenericParam->name);\n\t\t\t} else {\n\t\t\t\tsprintf(strchr(name, 0), \"???\");\n\t\t\t}\n\t\t}\n\t}\n\tstrcat(name, \"]\");\n\t// Fill in the basic bits of the new type def.\n\tpTypeDef->pTypeDef = pTypeDef;\n\tpTypeDef->pMetaData = pMetaData;\n\tpTypeDef->flags = pCoreType->flags;\n\tpTypeDef->pGenericDefinition = pCoreType;\n\tfor (i=0; i<numTypeArgs; i++) {\n\t\tif (ppTypeArgs[i] == NULL) {\n\t\t\tpTypeDef->isGenericDefinition = 1;\n\t\t\tbreak;\n\t\t}\n\t}\n\tpTypeDef->nameSpace = pCoreType->nameSpace;\n\tpTypeDef->name = (STRING)mallocForever((U32)strlen(name)+1);\n\tstrcpy(pTypeDef->name, name);\n\tpTypeDef->ppClassTypeArgs = pInst->pTypeArgs;\n\tpTypeDef->extends = pCoreType->extends;\n\tpTypeDef->tableIndex = pCoreType->tableIndex;\n\tpTypeDef->fieldList = pCoreType->fieldList;\n\tpTypeDef->methodList = pCoreType->methodList;\n\tpTypeDef->numFields = pCoreType->numFields;\n\tpTypeDef->numMethods = pCoreType->numMethods;\n\tpTypeDef->numVirtualMethods = pCoreType->numVirtualMethods;\n\tpTypeDef->pNestedIn = pCoreType->pNestedIn;\n\tpTypeDef->isPrimed = 1;\n\n\tMetaData_Fill_TypeDef_(pTypeDef, ppTypeArgs, NULL);\n\n\treturn pTypeDef;\n}\n\ntMD_MethodDef* Generics_GetMethodDefFromSpec\n\t(tMD_MethodSpec *pMethodSpec, tMD_TypeDef **ppCallingClassTypeArgs, tMD_TypeDef **ppCallingMethodTypeArgs) {\n\n\ttMD_MethodDef *pCoreMethod, *pMethod;\n\tSIG sig;\n\tU32 argCount, i;\n\ttMD_TypeDef **ppTypeArgs;\n\n\tpCoreMethod = MetaData_GetMethodDefFromDefRefOrSpec(pMethodSpec->pMetaData, pMethodSpec->method, NULL, NULL);//ppCallingClassTypeArgs, ppCallingMethodTypeArgs);\n\n\t//ppClassTypeArgs = pCoreMethod->pParentType->ppClassTypeArgs;\n\tsig = MetaData_GetBlob(pMethodSpec->instantiation, NULL);\n\tMetaData_DecodeSigEntry(&sig); // always 0x0a\n\targCount = MetaData_DecodeSigEntry(&sig);\n\tppTypeArgs = malloc(argCount * sizeof(tMD_TypeDef*));\n\n\tfor (i=0; i<argCount; i++) {\n\t\ttMD_TypeDef *pArgType;\n\n\t\tpArgType = Type_GetTypeFromSig(pMethodSpec->pMetaData, &sig, ppCallingClassTypeArgs, ppCallingMethodTypeArgs);\n\t\tppTypeArgs[i] = pArgType;\n\t}\n\n\tpMethod = Generics_GetMethodDefFromCoreMethod(pCoreMethod, pCoreMethod->pParentType, argCount, ppTypeArgs);\n\tfree(ppTypeArgs);\n\n\treturn pMethod;\n}\n\ntMD_MethodDef* Generics_GetMethodDefFromCoreMethod\n\t(tMD_MethodDef *pCoreMethod, tMD_TypeDef *pParentType, U32 numTypeArgs, tMD_TypeDef **ppTypeArgs) {\n\n\ttGenericMethodInstance *pInst;\n\ttMD_MethodDef *pMethod;\n\n\t// See if we already have an instance with the given type args\n\tpInst = pCoreMethod->pGenericMethodInstances;\n\twhile (pInst != NULL) {\n\t\tif (pInst->numTypeArgs == numTypeArgs &&\n\t\t\tmemcmp(pInst->pTypeArgs, ppTypeArgs, numTypeArgs * sizeof(tMD_TypeDef*)) == 0) {\n\t\t\treturn pInst->pInstanceMethodDef;\n\t\t}\n\t\tpInst = pInst->pNext;\n\t}\n\n\t// We don't have an instance so create one now.\n\tpInst = mallocForever(sizeof(tGenericMethodInstance) + numTypeArgs * sizeof(tMD_TypeDef*));\n\tpInst->pNext = pCoreMethod->pGenericMethodInstances;\n\tpCoreMethod->pGenericMethodInstances = pInst;\n\tpInst->numTypeArgs = numTypeArgs;\n\tmemcpy(pInst->pTypeArgs, ppTypeArgs, numTypeArgs * sizeof(tMD_TypeDef*));\n\n\tpInst->pInstanceMethodDef = pMethod = TMALLOCFOREVER(tMD_MethodDef);\n\tmemset(pMethod, 0, sizeof(tMD_MethodDef));\n\tpMethod->pMethodDef = pMethod;\n\tpMethod->pMetaData = pCoreMethod->pMetaData;\n\tpMethod->pCIL = pCoreMethod->pCIL;\n\tpMethod->implFlags = pCoreMethod->implFlags;\n\tpMethod->flags = pCoreMethod->flags;\n\tpMethod->name = pCoreMethod->name;\n\tpMethod->signature = pCoreMethod->signature;\n\tpMethod->vTableOfs = pCoreMethod->vTableOfs;\n\tpMethod->ppMethodTypeArgs = pInst->pTypeArgs;\n\n\tMetaData_Fill_MethodDef(pParentType, pMethod, pParentType->ppClassTypeArgs, pInst->pTypeArgs);\n\n\treturn pMethod;\n}\n"
  },
  {
    "path": "dna/Generics.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__GENERICS_H)\n#define __GENERICS_H\n\ntypedef struct tGenericInstance_ tGenericInstance;\ntypedef struct tGenericMethodInstance_ tGenericMethodInstance;\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n\n\nstruct tGenericInstance_ {\n\t// The tMD_TypeDef for this instance of this generic type\n\ttMD_TypeDef *pInstanceTypeDef;\n\n\t// The next instantiation of this generic type\n\ttGenericInstance *pNext;\n\n\t// The number of type arguments for this instance\n\tU32 numTypeArgs;\n\t// The type arguments for this instantiation\n\ttMD_TypeDef *pTypeArgs[0];\n};\n\nstruct tGenericMethodInstance_ {\n\t// This instance method.\n\ttMD_MethodDef *pInstanceMethodDef;\n\n\t// The next instantiation of this generic method\n\ttGenericMethodInstance *pNext;\n\n\t// The number of type arguments for this instance\n\tU32 numTypeArgs;\n\t// The method type arguments for this instance\n\ttMD_TypeDef *pTypeArgs[0];\n};\n\nvoid Generic_GetHeapRoots(tHeapRoots *pHeapRoots, tMD_TypeDef *pTypeDef);\n\ntMD_TypeDef* Generics_GetGenericTypeFromSig(tMetaData *pMetaData, SIG *pSig, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppCallingMethodTypeArgs);\ntMD_TypeDef* Generics_GetGenericTypeFromCoreType(tMD_TypeDef *pCoreType, U32 numArgs, tMD_TypeDef **ppTypeArgs);//, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\n\ntMD_MethodDef* Generics_GetMethodDefFromSpec(tMD_MethodSpec *pMethodSpec, tMD_TypeDef **ppCallingClassTypeArgs, tMD_TypeDef **ppCallingMethodTypeArgs);\ntMD_MethodDef* Generics_GetMethodDefFromCoreMethod(tMD_MethodDef *pCoreMethod, tMD_TypeDef *pParentType, U32 numMethodTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\n\n#endif"
  },
  {
    "path": "dna/Heap.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"Heap.h\"\n\n#include \"MetaData.h\"\n#include \"CLIFile.h\"\n#include \"Type.h\"\n#include \"EvalStack.h\"\n#include \"Finalizer.h\"\n#include \"Thread.h\"\n#include \"System.String.h\"\n#include \"System.Array.h\"\n#include \"System.WeakReference.h\"\n\n// Memory roots are:\n// All threads, all MethodStates - the ParamLocals memory and the evaluation stack\n// All static fields of all types\n// Note that the evaluation stack is not typed, so every 4-byte entry is treated as a pointer\n\ntypedef struct tSync_ tSync;\ntypedef struct tHeapEntry_ tHeapEntry;\n\nstruct tSync_ {\n\t// The thread that holds this sync block\n\ttThread *pThread;\n\t// The number of times this thread has entered the sync block\n\tU32 count;\n\n\t// Link to the first weak-ref that targets this object.\n\t// This allows the tracking of all weak-refs that target this object.\n\tHEAP_PTR weakRef;\n};\n\n// The memory is kept track of using a balanced binary search tree (ordered by memory address)\n// See http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_andersson.aspx for details.\n\nstruct tHeapEntry_ {\n\t// Left/right links in the heap binary tree\n\ttHeapEntry *pLink[2];\n\t// The 'level' of this node. Leaf nodes have lowest level\n\tU8 level;\n\t// Used to mark that this node is still in use.\n\t// If this is set to 0xff, then this heap entry is undeletable.\n\tU8 marked;\n\t// Set to 1 if the Finalizer needs to be run.\n\t// Set to 2 if this has been added to the Finalizer queue\n\t// Set to 0 when the Finalizer has been run (or there is no Finalizer in the first place)\n\t// Only set on types that have a Finalizer\n\tU8 needToFinalize;\n\t\n\t// unused\n\tU8 padding;\n\n\t// The type in this heap entry\n\ttMD_TypeDef *pTypeDef;\n\n\t// Used for locking sync, and tracking WeakReference that point to this object\n\ttSync *pSync;\n\n\t// The user memory\n\tU8 memory[0];\n};\n// Get the tHeapEntry pointer when given a HEAP_PTR object\n#define GET_HEAPENTRY(heapObj) ((tHeapEntry*)(heapObj - sizeof(tHeapEntry)))\n\n// Forward ref\nstatic void RemoveWeakRefTarget(tHeapEntry *pHeapEntry, U32 removeLongRefs);\n\nstatic tHeapEntry *pHeapTreeRoot;\nstatic tHeapEntry *nil;\n#define MAX_TREE_DEPTH 40\n\n// The total heap memory currently allocated\nstatic U32 trackHeapSize;\n// The max heap size allowed before a garbage collection is triggered\nstatic U32 heapSizeMax;\n// The number of allocated memory nodes\nstatic U32 numNodes = 0;\n// The number of collections done\nstatic U32 numCollections = 0;\n\n#ifdef DIAG_GC\n// Track how much time GC's are taking\nU64 gcTotalTime = 0;\n#endif\n\n#define MIN_HEAP_SIZE 50000\n#define MAX_HEAP_EXCESS 200000\n\nvoid Heap_Init() {\n\t// Initialise vars\n\ttrackHeapSize = 0;\n\theapSizeMax = MIN_HEAP_SIZE;\n\t// Create nil node - for leaf termination\n\tnil = TMALLOCFOREVER(tHeapEntry);\n\tmemset(nil, 0, sizeof(tHeapEntry));\n\tnil->pLink[0] = nil->pLink[1] = nil;\n\t// Set the heap tree as empty\n\tpHeapTreeRoot = nil;\n}\n\n// Get the size of a heap entry, NOT including the header\n// This works by returning the size of the type, unless the type is an array or a string,\n// which are the only two types that can have variable sizes\nstatic U32 GetSize(tHeapEntry *pHeapEntry) {\n\ttMD_TypeDef *pType = pHeapEntry->pTypeDef;\n\tif (pType == types[TYPE_SYSTEM_STRING]) {\n\t\t// If it's a string, return the string length in bytes\n\t\treturn SystemString_GetNumBytes((HEAP_PTR)(pHeapEntry + 1));\n\t}\n\tif (TYPE_ISARRAY(pType)) {\n\t\t// If it's an array, return the array length * array element size\n\t\treturn SystemArray_GetNumBytes((HEAP_PTR)(pHeapEntry + 1), pType->pArrayElementType);\n\t}\n\t// If it's not string or array, just return the instance memory size\n\treturn pType->instanceMemSize;\n}\n\nstatic tHeapEntry* TreeSkew(tHeapEntry *pRoot) {\n\tif (pRoot->pLink[0]->level == pRoot->level && pRoot->level != 0) {\n\t\ttHeapEntry *pSave = pRoot->pLink[0];\n\t\tpRoot->pLink[0] = pSave->pLink[1];\n\t\tpSave->pLink[1] = pRoot;\n\t\tpRoot = pSave;\n\t}\n\treturn pRoot;\n}\n\nstatic tHeapEntry* TreeSplit(tHeapEntry *pRoot) {\n\tif (pRoot->pLink[1]->pLink[1]->level == pRoot->level && pRoot->level != 0) {\n\t\ttHeapEntry *pSave = pRoot->pLink[1];\n\t\tpRoot->pLink[1] = pSave->pLink[0];\n\t\tpSave->pLink[0] = pRoot;\n\t\tpRoot = pSave;\n\t\tpRoot->level++;\n\t}\n\treturn pRoot;\n}\n\nstatic tHeapEntry* TreeInsert(tHeapEntry *pRoot, tHeapEntry *pEntry) {\n\tif (pRoot == nil) {\n\t\tpRoot = pEntry;\n\t\tpRoot->level = 1;\n\t\tpRoot->pLink[0] = pRoot->pLink[1] = nil;\n\t\tpRoot->marked = 0;\n\t} else {\n\t\ttHeapEntry *pNode = pHeapTreeRoot;\n\t\ttHeapEntry *pUp[MAX_TREE_DEPTH];\n\t\tI32 top = 0, dir;\n\t\t// Find leaf position to insert into tree. This first step is unbalanced\n\t\tfor (;;) {\n\t\t\tpUp[top++] = pNode;\n\t\t\tdir = pNode < pEntry; // 0 for left, 1 for right\n\t\t\tif (pNode->pLink[dir] == nil) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpNode = pNode->pLink[dir];\n\t\t}\n\t\t// Create new node\n\t\tpNode->pLink[dir] = pEntry;\n\t\tpEntry->level = 1;\n\t\tpEntry->pLink[0] = pEntry->pLink[1] = nil;\n\t\tpEntry->marked = 0;\n\t\t// Balance the tree\n\t\twhile (--top >= 0) {\n\t\t\tif (top != 0) {\n\t\t\t\tdir = pUp[top-1]->pLink[1] == pUp[top];\n\t\t\t}\n\t\t\tpUp[top] = TreeSkew(pUp[top]);\n\t\t\tpUp[top] = TreeSplit(pUp[top]);\n\t\t\tif (top != 0) {\n\t\t\t\tpUp[top-1]->pLink[dir] = pUp[top];\n\t\t\t} else {\n\t\t\t\tpRoot = pUp[0];\n\t\t\t}\n\t\t}\n\t}\n\treturn pRoot;\n}\n\nstatic tHeapEntry* TreeRemove(tHeapEntry *pRoot, tHeapEntry *pDelete) {\n\tif (pRoot != nil) {\n\t\tif (pRoot == pDelete) {\n\t\t\tif (pRoot->pLink[0] != nil && pRoot->pLink[1] != nil) {\n\t\t\t\ttHeapEntry *pL0;\n\t\t\t\tU8 l;\n\t\t\t\ttHeapEntry *pHeir = pRoot->pLink[0], **ppHeirLink = &pHeir->pLink[0];\n\t\t\t\twhile (pHeir->pLink[1] != nil) {\n\t\t\t\t\tppHeirLink = &pHeir->pLink[1];\n\t\t\t\t\tpHeir = pHeir->pLink[1];\n\t\t\t\t}\n\t\t\t\t// Swap the two nodes\n\t\t\t\tpL0 = pHeir->pLink[0];\n\t\t\t\tl = pHeir->level;\n\t\t\t\t// Bring heir to replace root\n\t\t\t\tpHeir->pLink[0] = pRoot->pLink[0];\n\t\t\t\tpHeir->pLink[1] = pRoot->pLink[1];\n\t\t\t\tpHeir->level = pRoot->level;\n\t\t\t\t// Send root to replace heir\n\t\t\t\t*ppHeirLink = pRoot;\n\t\t\t\tpRoot->pLink[0] = pL0;\n\t\t\t\tpRoot->pLink[1] = nil;\n\t\t\t\tpRoot->level = l;\n\t\t\t\t// Set correct return value\n\t\t\t\tpL0 = pRoot;\n\t\t\t\tpRoot = pHeir;\n\t\t\t\t// Delete the node that's been sent down\n\t\t\t\tpRoot->pLink[0] = TreeRemove(pRoot->pLink[0], pL0);\n\t\t\t} else {\n\t\t\t\tpRoot = pRoot->pLink[pRoot->pLink[0] == nil];\n\t\t\t}\n\t\t} else {\n\t\t\tI32 dir = pRoot < pDelete;\n\t\t\tpRoot->pLink[dir] = TreeRemove(pRoot->pLink[dir], pDelete);\n\t\t}\n\t}\n\n\tif (pRoot->pLink[0]->level < pRoot->level-1 || pRoot->pLink[1]->level < pRoot->level-1) {\n\t\tif (pRoot->pLink[1]->level > --pRoot->level) {\n\t\t\tpRoot->pLink[1]->level = pRoot->level;\n\t\t}\n\t\tpRoot = TreeSkew(pRoot);\n\t\tpRoot->pLink[1] = TreeSkew(pRoot->pLink[1]);\n\t\tpRoot->pLink[1]->pLink[1] = TreeSkew(pRoot->pLink[1]->pLink[1]);\n\t\tpRoot = TreeSplit(pRoot);\n\t\tpRoot->pLink[1] = TreeSplit(pRoot->pLink[1]);\n\t}\n\n\treturn pRoot;\n}\n\nstatic void GarbageCollect() {\n\ttHeapRoots heapRoots;\n\ttHeapEntry *pNode;\n\ttHeapEntry *pUp[MAX_TREE_DEPTH * 2];\n\tI32 top;\n\ttHeapEntry *pToDelete = NULL;\n\tU32 orgHeapSize = trackHeapSize;\n\tU32 orgNumNodes = numNodes;\n#ifdef DIAG_GC\n\tU64 startTime;\n#endif\n\n\tnumCollections++;\n\n#ifdef DIAG_GC\n\tstartTime = microTime();\n#endif\n\n\theapRoots.capacity = 64;\n\theapRoots.num = 0;\n\theapRoots.pHeapEntries = malloc(heapRoots.capacity * sizeof(tHeapRootEntry));\n\n\tThread_GetHeapRoots(&heapRoots);\n\tCLIFile_GetHeapRoots(&heapRoots);\n\n\t// Mark phase\n\twhile (heapRoots.num > 0) {\n\t\ttHeapRootEntry *pRootsEntry;\n\t\tU32 i;\n\t\tU32 moreRootsAdded = 0;\n\t\tU32 rootsEntryNumPointers;\n\t\tvoid **pRootsEntryMem;\n\n\t\t// Get a piece of memory off the list of heap memory roots.\n\t\tpRootsEntry = &heapRoots.pHeapEntries[heapRoots.num - 1];\n\t\trootsEntryNumPointers = pRootsEntry->numPointers;\n\t\tpRootsEntryMem = pRootsEntry->pMem;\n\t\t// Mark this entry as done\n\t\tpRootsEntry->numPointers = 0;\n\t\tpRootsEntry->pMem = NULL;\n\t\t// Iterate through all pointers in it\n\t\tfor (i=0; i<rootsEntryNumPointers; i++) {\n\t\t\tvoid *pMemRef = pRootsEntryMem[i];\n\t\t\t// Quick escape for known non-memory \n\t\t\tif (pMemRef == NULL) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Find this piece of heap memory in the tracking tree.\n\t\t\t// Note that the 2nd memory address comparison MUST be >, not >= as might be expected,\n\t\t\t// to allow for a zero-sized memory to be detected (and not garbage collected) properly.\n\t\t\t// E.g. The object class has zero memory.\n\t\t\tpNode = pHeapTreeRoot;\n\t\t\twhile (pNode != nil) {\n\t\t\t\tif (pMemRef < (void*)pNode) {\n\t\t\t\t\tpNode = pNode->pLink[0];\n\t\t\t\t} else if ((char*)pMemRef > ((char*)pNode) + GetSize(pNode) + sizeof(tHeapEntry)) {\n\t\t\t\t\tpNode = pNode->pLink[1];\n\t\t\t\t} else {\n\t\t\t\t\t// Found memory. See if it's already been marked.\n\t\t\t\t\t// If it's already marked, then don't do anything.\n\t\t\t\t\t// It it's not marked, then add all of its memory to the roots, and mark it.\n\t\t\t\t\tif (pNode->marked == 0) {\n\t\t\t\t\t\ttMD_TypeDef *pType = pNode->pTypeDef;\n\n\t\t\t\t\t\t// Not yet marked, so mark it, and add it to heap roots.\n\t\t\t\t\t\tpNode->marked = 1;\n\t\n\t\t\t\t\t\t// Don't look at the contents of strings, arrays of primitive types, or WeakReferences\n\t\t\t\t\t\tif (pType->stackType == EVALSTACK_O ||\n\t\t\t\t\t\t\tpType->stackType == EVALSTACK_VALUETYPE ||\n\t\t\t\t\t\t\tpType->stackType == EVALSTACK_PTR) {\n\n\t\t\t\t\t\t\tif (pType != types[TYPE_SYSTEM_STRING] &&\n\t\t\t\t\t\t\t\t(!TYPE_ISARRAY(pType) ||\n\t\t\t\t\t\t\t\tpType->pArrayElementType->stackType == EVALSTACK_O ||\n\t\t\t\t\t\t\t\tpType->pArrayElementType->stackType == EVALSTACK_VALUETYPE ||\n\t\t\t\t\t\t\t\tpType->pArrayElementType->stackType == EVALSTACK_PTR)) {\n\n\t\t\t\t\t\t\t\tif (pType != types[TYPE_SYSTEM_WEAKREFERENCE]) {\n\t\t\t\t\t\t\t\t\tHeap_SetRoots(&heapRoots,pNode->memory, GetSize(pNode));\n\t\t\t\t\t\t\t\t\tmoreRootsAdded = 1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (!moreRootsAdded) {\n\t\t\theapRoots.num--;\n\t\t}\n\t}\n\n\tfree(heapRoots.pHeapEntries);\n\n\t// Sweep phase\n\t// Traverse nodes\n\tpUp[0] = pHeapTreeRoot;\n\ttop = 1;\n\twhile (top != 0) {\n\t\t// Get this node\n\t\tpNode = pUp[--top];\n\t\t// Act on this node\n\t\tif (pNode->marked) {\n\t\t\tif (pNode->marked != 0xff) {\n\t\t\t\t// Still in use (but not marked undeletable), so unmark\n\t\t\t\tpNode->marked = 0;\n\t\t\t}\n\t\t} else {\n\t\t\t// Not in use any more, so put in deletion queue if it does not need Finalizing\n\t\t\t// If it does need Finalizing, then don't garbage collect, and put in Finalization queue.\n\t\t\tif (pNode->needToFinalize) {\n\t\t\t\tif (pNode->needToFinalize == 1) {\n\t\t\t\t\tAddFinalizer((HEAP_PTR)pNode + sizeof(tHeapEntry));\n\t\t\t\t\t// Mark it has having been placed in the finalization queue.\n\t\t\t\t\t// When it has been finalized, then this will be set to 0\n\t\t\t\t\tpNode->needToFinalize = 2;\n\t\t\t\t\t// If this object is being targetted by weak-ref(s), handle it\n\t\t\t\t\tif (pNode->pSync != NULL) {\n\t\t\t\t\t\tRemoveWeakRefTarget(pNode, 0);\n\t\t\t\t\t\tfree(pNode->pSync);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// If this object is being targetted by weak-ref(s), handle it\n\t\t\t\tif (pNode->pSync != NULL) {\n\t\t\t\t\tRemoveWeakRefTarget(pNode, 1);\n\t\t\t\t\tfree(pNode->pSync);\n\t\t\t\t}\n\t\t\t\t// Use pSync to point to next entry in this linked-list.\n\t\t\t\t(tHeapEntry*)(pNode->pSync) = pToDelete;\n\t\t\t\tpToDelete = pNode;\n\t\t\t}\n\t\t}\n\t\t// Get next node(s)\n\t\tif (pNode->pLink[1] != nil) {\n\t\t\tpUp[top++] = pNode->pLink[1];\n\t\t}\n\t\tif (pNode->pLink[0] != nil) {\n\t\t\tpUp[top++] = pNode->pLink[0];\n\t\t}\n\t}\n\n\t// Delete all unused memory nodes.\n\twhile (pToDelete != NULL) {\n\t\ttHeapEntry *pThis = pToDelete;\n\t\tpToDelete = (tHeapEntry*)(pToDelete->pSync);\n\t\tpHeapTreeRoot = TreeRemove(pHeapTreeRoot, pThis);\n\t\tnumNodes--;\n\t\ttrackHeapSize -= GetSize(pThis) + sizeof(tHeapEntry);\n\t\tfree(pThis);\n\t}\n\n#ifdef DIAG_GC\n\tgcTotalTime += microTime() - startTime;\n#endif\n\n\tlog_f(1, \"--- GARBAGE --- [Size: %d -> %d] [Nodes: %d -> %d]\\n\",\n\t\torgHeapSize, trackHeapSize, orgNumNodes, numNodes);\n\n#ifdef DIAG_GC\n\tlog_f(1, \"GC time = %d ms\\n\", gcTotalTime / 1000);\n#endif\n}\n\nvoid Heap_UnmarkFinalizer(HEAP_PTR heapPtr) {\n\t((tHeapEntry*)(heapPtr - sizeof(tHeapEntry)))->needToFinalize = 0;\n}\n\nvoid Heap_GarbageCollect() {\n\tGarbageCollect();\n}\n\nU32 Heap_NumCollections() {\n\treturn numCollections;\n}\n\nU32 Heap_GetTotalMemory() {\n\treturn trackHeapSize;\n}\n\nvoid Heap_SetRoots(tHeapRoots *pHeapRoots, void *pRoots, U32 sizeInBytes) {\n\ttHeapRootEntry *pRootEntry;\n\n\tAssert((sizeInBytes & 0x3) == 0);\n\tif (pHeapRoots->num >= pHeapRoots->capacity) {\n\t\tpHeapRoots->capacity <<= 1;\n\t\tpHeapRoots->pHeapEntries = (tHeapRootEntry*)realloc(pHeapRoots->pHeapEntries, pHeapRoots->capacity * sizeof(tHeapRootEntry));\n\t}\n\tpRootEntry = &pHeapRoots->pHeapEntries[pHeapRoots->num++];\n\tpRootEntry->numPointers = sizeInBytes >> 2;\n\tpRootEntry->pMem = pRoots;\n}\n\nHEAP_PTR Heap_Alloc(tMD_TypeDef *pTypeDef, U32 size) {\n\ttHeapEntry *pHeapEntry;\n\tU32 totalSize;\n\n\ttotalSize = sizeof(tHeapEntry) + size;\n\n\t// Trigger garbage collection if required.\n\tif (trackHeapSize >= heapSizeMax) {\n\t\tGarbageCollect();\n\t\theapSizeMax = (trackHeapSize + totalSize) << 1;\n\t\tif (heapSizeMax < trackHeapSize + totalSize + MIN_HEAP_SIZE) {\n\t\t\t// Make sure there is always MIN_HEAP_SIZE available to allocate on the heap\n\t\t\theapSizeMax = trackHeapSize + totalSize + MIN_HEAP_SIZE;\n\t\t}\n\t\tif (heapSizeMax > trackHeapSize + totalSize + MAX_HEAP_EXCESS) {\n\t\t\t// Make sure there is never more that MAX_HEAP_EXCESS space on the heap\n\t\t\theapSizeMax = trackHeapSize + totalSize + MAX_HEAP_EXCESS;\n\t\t}\n\t}\n\n\tpHeapEntry = (tHeapEntry*)malloc(totalSize);\n\tpHeapEntry->pTypeDef = pTypeDef;\n\tpHeapEntry->pSync = NULL;\n\tpHeapEntry->needToFinalize = (pTypeDef->pFinalizer != NULL);\n\tmemset(pHeapEntry->memory, 0, size);\n\ttrackHeapSize += totalSize;\n\n\tpHeapTreeRoot = TreeInsert(pHeapTreeRoot, pHeapEntry);\n\tnumNodes++;\n\n\treturn pHeapEntry->memory;\n}\n\nHEAP_PTR Heap_AllocType(tMD_TypeDef *pTypeDef) {\n\t//printf(\"Heap_AllocType('%s')\\n\", pTypeDef->name);\n\treturn Heap_Alloc(pTypeDef, pTypeDef->instanceMemSize);\n}\n\ntMD_TypeDef* Heap_GetType(HEAP_PTR heapEntry) {\n\ttHeapEntry *pHeapEntry = GET_HEAPENTRY(heapEntry);\n\treturn pHeapEntry->pTypeDef;\n}\n\nvoid Heap_MakeUndeletable(HEAP_PTR heapEntry) {\n\ttHeapEntry *pHeapEntry = GET_HEAPENTRY(heapEntry);\n\tpHeapEntry->marked = 0xff;\n}\n\nvoid Heap_MakeDeletable(HEAP_PTR heapEntry) {\n\ttHeapEntry *pHeapEntry = GET_HEAPENTRY(heapEntry);\n\tpHeapEntry->marked = 0;\n}\n\nHEAP_PTR Heap_Box(tMD_TypeDef *pType, PTR pMem) {\n\tHEAP_PTR boxed;\n\n\tboxed = Heap_AllocType(pType);\n\tmemcpy(boxed, pMem, pType->instanceMemSize);\n\n\treturn boxed;\n}\n\nHEAP_PTR Heap_Clone(HEAP_PTR obj) {\n\ttHeapEntry *pObj = GET_HEAPENTRY(obj);\n\tHEAP_PTR clone;\n\tU32 size = GetSize(pObj);\n\n\tclone = Heap_Alloc(pObj->pTypeDef, size);\n\tmemcpy(clone, pObj->memory, size);\n\n\treturn clone;\n}\n\nstatic tSync* EnsureSync(tHeapEntry *pHeapEntry) {\n\tif (pHeapEntry->pSync == NULL) {\n\t\ttSync *pSync = TMALLOC(tSync);\n\t\tmemset(pSync, 0, sizeof(tSync));\n\t\tpHeapEntry->pSync = pSync;\n\t}\n\treturn pHeapEntry->pSync;\n}\n\nstatic void DeleteSync(tHeapEntry *pHeapEntry) {\n\tif (pHeapEntry->pSync != NULL) {\n\t\tif (pHeapEntry->pSync->count == 0 && pHeapEntry->pSync->weakRef == NULL) {\n\t\t\tfree(pHeapEntry->pSync);\n\t\t\tpHeapEntry->pSync = NULL;\n\t\t}\n\t}\n}\n\n// Return 1 if lock succesfully got\n// Return 0 if couldn't get the lock this time\nU32 Heap_SyncTryEnter(HEAP_PTR obj) {\n\ttHeapEntry *pHeapEntry = GET_HEAPENTRY(obj);\n\ttThread *pThread = Thread_GetCurrent();\n\ttSync *pSync;\n\n\tpSync = EnsureSync(pHeapEntry);\n\tif (pSync->pThread == NULL) {\n\t\tpSync->pThread = pThread;\n\t\tpSync->count = 1;\n\t\treturn 1;\n\t}\n\tif (pSync->pThread == pThread) {\n\t\tpSync->count++;\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\n// Returns 1 if all is OK\n// Returns 0 if the wrong thread is releasing the sync, or if no thread hold the sync\nU32 Heap_SyncExit(HEAP_PTR obj) {\n\ttHeapEntry *pHeapEntry = GET_HEAPENTRY(obj);\n\ttThread *pThread = Thread_GetCurrent();\n\tif (pHeapEntry->pSync == NULL) {\n\t\treturn 0;\n\t}\n\tif (pHeapEntry->pSync->pThread != pThread) {\n\t\treturn 0;\n\t}\n\tif (--pHeapEntry->pSync->count == 0) {\n\t\tDeleteSync(pHeapEntry);\n\t}\n\treturn 1;\n}\n\nstatic void RemoveWeakRefTarget(tHeapEntry *pTarget, U32 removeLongRefs) {\n\tSystemWeakReference_TargetGone(&pTarget->pSync->weakRef, removeLongRefs);\n}\n\n// Returns the previous first weak-ref in target targetted by weakref\nHEAP_PTR Heap_SetWeakRefTarget(HEAP_PTR target, HEAP_PTR weakRef) {\n\ttHeapEntry *pTarget = GET_HEAPENTRY(target);\n\ttSync *pSync;\n\tHEAP_PTR prevWeakRef;\n\n\tpSync = EnsureSync(pTarget);\n\tprevWeakRef = pSync->weakRef;\n\tpSync->weakRef = weakRef;\n\treturn prevWeakRef;\n}\n\nHEAP_PTR* Heap_GetWeakRefAddress(HEAP_PTR target) {\n\ttHeapEntry *pTarget = GET_HEAPENTRY(target);\n\treturn &pTarget->pSync->weakRef;\n}\n\nvoid Heap_RemovedWeakRefTarget(HEAP_PTR target) {\n\ttHeapEntry *pTarget = GET_HEAPENTRY(target);\n\tDeleteSync(pTarget);\n}\n"
  },
  {
    "path": "dna/Heap.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__HEAP_H)\n#define __HEAP_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntypedef struct tHeapRoots_ tHeapRoots;\ntypedef struct tHeapRootEntry_ tHeapRootEntry;\n\n#ifdef DIAG_GC\nextern U64 gcTotalTime;\n#endif\n\nstruct tHeapRootEntry_ {\n\tU32 numPointers; // The number of pointers within this memory area\n\tvoid **pMem;\n};\n\nstruct tHeapRoots_ {\n\tU32 capacity;\n\tU32 num;\n\ttHeapRootEntry *pHeapEntries;\n};\n\nvoid Heap_Init();\nvoid Heap_SetRoots(tHeapRoots *pHeapRoots, void *pRoots, U32 sizeInBytes);\nvoid Heap_UnmarkFinalizer(HEAP_PTR heapPtr);\nvoid Heap_GarbageCollect();\nU32 Heap_NumCollections();\nU32 Heap_GetTotalMemory();\n\nHEAP_PTR Heap_Alloc(tMD_TypeDef *pTypeDef, U32 size);\nHEAP_PTR Heap_AllocType(tMD_TypeDef *pTypeDef);\nvoid Heap_MakeUndeletable(HEAP_PTR heapEntry);\nvoid Heap_MakeDeletable(HEAP_PTR heapEntry);\n\ntMD_TypeDef* Heap_GetType(HEAP_PTR heapEntry);\n\nHEAP_PTR Heap_Box(tMD_TypeDef *pType, PTR pMem);\nHEAP_PTR Heap_Clone(HEAP_PTR obj);\n\nU32 Heap_SyncTryEnter(HEAP_PTR obj);\nU32 Heap_SyncExit(HEAP_PTR obj);\n\nHEAP_PTR Heap_SetWeakRefTarget(HEAP_PTR target, HEAP_PTR weakRef);\nHEAP_PTR* Heap_GetWeakRefAddress(HEAP_PTR target);\nvoid Heap_RemovedWeakRefTarget(HEAP_PTR target);\n#endif"
  },
  {
    "path": "dna/InternalCall.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"InternalCall.h\"\n#include \"MetaData.h\"\n#include \"Type.h\"\n\n#include \"System.String.h\"\n#include \"System.Object.h\"\n#include \"System.Console.h\"\n#include \"System.Array.h\"\n#include \"System.Environment.h\"\n#include \"System.Runtime.CompilerServices.RuntimeHelpers.h\"\n#include \"System.ValueType.h\"\n#include \"System.RuntimeType.h\"\n#include \"System.Type.h\"\n#include \"System.Threading.Monitor.h\"\n#include \"System.Threading.Thread.h\"\n#include \"System.Threading.Interlocked.h\"\n#include \"System.Enum.h\"\n#include \"System.WeakReference.h\"\n#include \"System.GC.h\"\n#include \"System.IO.FileInternal.h\"\n#include \"System.Char.h\"\n#include \"System.Diagnostics.Debugger.h\"\n#include \"System.Net.Sockets.Socket.h\"\n#include \"System.Net.Dns.h\"\n#include \"System.DateTime.h\"\n#include \"System.Math.h\"\n#include \"Delegate.h\"\n\n#define MAX_PARAMS 6\n\ntypedef struct tInternalCall_ tInternalCall;\nstruct tInternalCall_ {\n\tSTRING nameSpace;\n\tSTRING type;\n\tSTRING method;\n\tfnInternalCall fn;\n\tU8 returnType;\n\tU8 numParameters;\n\tU8 parameterTypes[MAX_PARAMS];\n};\n\nstatic tInternalCall internalCalls[] = {\n\t{\"System\", \"Object\", \"Equals\", System_Object_Equals, TYPE_SYSTEM_BOOLEAN, 1, {TYPE_SYSTEM_OBJECT}},\n\t{NULL,      NULL,    \"Clone\", System_Object_Clone, TYPE_SYSTEM_OBJECT, 1, {TYPE_SYSTEM_OBJECT}},\n\t{NULL,      NULL,    \"GetHashCode\", System_Object_GetHashCode, TYPE_SYSTEM_INT32, 0},\n\t{NULL,      NULL,    \"GetType\", System_Object_GetType, TYPE_SYSTEM_TYPE, 0},\n\n\t{NULL, \"String\", \".ctor\", System_String_ctor_CharInt32, TYPE_SYSTEM_VOID, 2, {TYPE_SYSTEM_CHAR, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,     \".ctor\", System_String_ctor_CharAIntInt, TYPE_SYSTEM_VOID, 3, {TYPE_SYSTEM_ARRAY_CHAR, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,     \".ctor\", System_String_ctor_StringIntInt, TYPE_SYSTEM_VOID, 3, {TYPE_SYSTEM_STRING, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,     \"get_Chars\", System_String_get_Chars, TYPE_SYSTEM_CHAR, 1, {TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,     \"InternalConcat\", System_String_InternalConcat, TYPE_SYSTEM_STRING, 2, {TYPE_SYSTEM_STRING, TYPE_SYSTEM_STRING}},\n\t{NULL, NULL,     \"InternalTrim\", System_String_InternalTrim, TYPE_SYSTEM_STRING, 2, {TYPE_SYSTEM_ARRAY_CHAR, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,     \"Equals\", System_String_Equals, TYPE_SYSTEM_BOOLEAN, 2, {TYPE_SYSTEM_STRING, TYPE_SYSTEM_STRING}},\n\t{NULL, NULL,     \"GetHashCode\", System_String_GetHashCode, TYPE_SYSTEM_INT32, 0},\n\t{NULL, NULL,     \"InternalReplace\", System_String_InternalReplace, TYPE_SYSTEM_STRING, 2, {TYPE_SYSTEM_STRING, TYPE_SYSTEM_STRING}},\n\t{NULL, NULL,     \"InternalIndexOf\", System_String_InternalIndexOf, TYPE_SYSTEM_INT32, 4, {TYPE_SYSTEM_CHAR, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_BOOLEAN}},\n\t{NULL, NULL,     \"InternalIndexOfAny\", System_String_InternalIndexOfAny, TYPE_SYSTEM_INT32, 4, {TYPE_SYSTEM_ARRAY_CHAR, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_BOOLEAN}},\n\n\t{NULL, \"Array\", \"Internal_GetValue\", System_Array_Internal_GetValue, TYPE_SYSTEM_OBJECT, 1, {TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,    \"Internal_SetValue\", System_Array_Internal_SetValue, TYPE_SYSTEM_BOOLEAN, 2, {TYPE_SYSTEM_OBJECT, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,    \"Clear\", System_Array_Clear, TYPE_SYSTEM_VOID, 3, {TYPE_SYSTEM_ARRAY_NO_TYPE, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,    \"Internal_Copy\", System_Array_Internal_Copy, TYPE_SYSTEM_BOOLEAN, 5, {TYPE_SYSTEM_ARRAY_NO_TYPE, TYPE_SYSTEM_INT32, TYPE_SYSTEM_ARRAY_NO_TYPE, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,    \"Resize\", System_Array_Resize, TYPE_SYSTEM_VOID, 2, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,    \"Reverse\", System_Array_Reverse, TYPE_SYSTEM_VOID, 3, {TYPE_SYSTEM_ARRAY_NO_TYPE, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32}},\n\n\t{NULL, \"Console\", \"Write\", System_Console_Write, TYPE_SYSTEM_VOID, 1, {TYPE_SYSTEM_STRING}},\n\t{NULL, NULL     , \"Internal_ReadKey\", System_Console_Internal_ReadKey, TYPE_SYSTEM_INT32, 0},\n\t{NULL, NULL     , \"Internal_KeyAvailable\", System_Console_Internal_KeyAvailable, TYPE_SYSTEM_BOOLEAN, 0},\n\n\t{NULL, \"Environment\", \"get_TickCount\", System_Environment_get_TickCount, TYPE_SYSTEM_INT32, 0},\n\t{NULL, NULL         , \"GetOSVersionString\", System_Environment_GetOSVersionString, TYPE_SYSTEM_STRING, 0},\n\t{NULL, NULL         , \"get_Platform\", System_Environment_get_Platform, TYPE_SYSTEM_PLATFORMID, 0},\n\n\t{NULL, \"Type\", \"GetTypeFromHandle\", System_Type_GetTypeFromHandle, TYPE_SYSTEM_TYPE, 1, {TYPE_SYSTEM_RUNTIMETYPEHANDLE}},\n\t{NULL, NULL,   \"get_IsValueType\", System_Type_get_IsValueType, TYPE_SYSTEM_BOOLEAN, 0},\n\n\t{NULL, \"RuntimeType\", \"get_Name\", System_RuntimeType_get_Name, TYPE_SYSTEM_STRING, 0},\n\t{NULL, NULL,          \"get_Namespace\", System_RuntimeType_get_Namespace, TYPE_SYSTEM_STRING, 0},\n\t{NULL, NULL,          \"GetNestingParentType\", System_RuntimeType_GetNestingParentType, TYPE_SYSTEM_RUNTIMETYPE, 0},\n\t{NULL, NULL,          \"get_BaseType\", System_RuntimeType_get_BaseType, TYPE_SYSTEM_TYPE, 0},\n\t{NULL, NULL,          \"get_IsEnum\", System_RuntimeType_get_IsEnum, TYPE_SYSTEM_BOOLEAN, 0},\n\t{NULL, NULL,          \"get_IsGenericType\", System_RuntimeType_get_IsGenericType, TYPE_SYSTEM_BOOLEAN, 0},\n\t{NULL, NULL,          \"Internal_GetGenericTypeDefinition\", System_RuntimeType_Internal_GetGenericTypeDefinition, TYPE_SYSTEM_RUNTIMETYPE, 0},\n\t{NULL, NULL,          \"GetGenericArguments\", System_RuntimeType_GetGenericArguments, TYPE_SYSTEM_ARRAY_TYPE, 0},\n\n\t{NULL, \"Char\", \"GetUnicodeCategory\", System_Char_GetUnicodeCategory, TYPE_SYSTEM_GLOBALIZATION_UNICODECATEGORY, 1, {TYPE_SYSTEM_CHAR}},\n\t{NULL, NULL  , \"ToLowerInvariant\", System_Char_ToLowerInvariant, TYPE_SYSTEM_CHAR, 1, {TYPE_SYSTEM_CHAR}},\n\t{NULL, NULL  , \"ToUpperInvariant\", System_Char_ToUpperInvariant, TYPE_SYSTEM_CHAR, 1, {TYPE_SYSTEM_CHAR}},\n\n\t{NULL, \"GC\", \"Collect\", System_GC_Collect, TYPE_SYSTEM_VOID, 0},\n\t{NULL, NULL, \"Internal_CollectionCount\", System_GC_Internal_CollectionCount, TYPE_SYSTEM_INT32, 0},\n\t{NULL, NULL, \"GetTotalMemory\", System_GC_GetTotalMemory, TYPE_SYSTEM_INT64, 1, {TYPE_SYSTEM_BOOLEAN}},\n\t{NULL, NULL, \"SuppressFinalize\", System_GC_SuppressFinalize, TYPE_SYSTEM_VOID, 1, {TYPE_SYSTEM_OBJECT}},\n\n\t{NULL, \"Enum\", \"Internal_GetValue\", System_Enum_Internal_GetValue, TYPE_SYSTEM_INT32, 0},\n\t{NULL, NULL,   \"Internal_GetInfo\", System_Enum_Internal_GetInfo, TYPE_SYSTEM_VOID, 3, {TYPE_SYSTEM_TYPE, TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_INTPTR}},\n\n\t{NULL, \"ValueType\", \"GetFields\", System_ValueType_GetFields, TYPE_SYSTEM_ARRAY_NO_TYPE, 2, {TYPE_SYSTEM_OBJECT, TYPE_SYSTEM_OBJECT}},\n\n\t{NULL, \"WeakReference\", \"get_Target\", System_WeakReference_get_Target, TYPE_SYSTEM_OBJECT, 0},\n\t{NULL, NULL,            \"set_Target\", System_WeakReference_set_Target, TYPE_SYSTEM_VOID, 1, {TYPE_SYSTEM_OBJECT}},\n\n\t{NULL, \"DateTime\", \"InternalUtcNow\", System_DateTime_InternalUtcNow, TYPE_SYSTEM_INT64, 0},\n\n\t{NULL, \"Math\", \"Sin\", System_Math_Sin, TYPE_SYSTEM_DOUBLE, 1, {TYPE_SYSTEM_DOUBLE}},\n\t{NULL, NULL,   \"Cos\", System_Math_Cos, TYPE_SYSTEM_DOUBLE, 1, {TYPE_SYSTEM_DOUBLE}},\n\t{NULL, NULL,   \"Tan\", System_Math_Tan, TYPE_SYSTEM_DOUBLE, 1, {TYPE_SYSTEM_DOUBLE}},\n\t{NULL, NULL,   \"Pow\", System_Math_Pow, TYPE_SYSTEM_DOUBLE, 2, {TYPE_SYSTEM_DOUBLE, TYPE_SYSTEM_DOUBLE}},\n\t{NULL, NULL,   \"Sqrt\", System_Math_Sqrt, TYPE_SYSTEM_DOUBLE, 1, {TYPE_SYSTEM_DOUBLE}},\n\n\t{\"System.Threading\", \"Thread\", \".ctor\", System_Threading_Thread_ctor, TYPE_SYSTEM_VOID, 1, {TYPE_SYSTEM_THREADING_THREADSTART}},\n\t{NULL,               NULL,     \".ctor\", System_Threading_Thread_ctorParam, TYPE_SYSTEM_VOID, 1, {TYPE_SYSTEM_THREADING_PARAMETERIZEDTHREADSTART}},\n\t{NULL,               NULL,     \"Start\", System_Threading_Thread_Start, TYPE_SYSTEM_VOID, 0},\n\t{NULL,               NULL,     \"Sleep\", System_Threading_Thread_Sleep, TYPE_SYSTEM_VOID, 1, {TYPE_SYSTEM_INT32}},\n\t{NULL,               NULL,     \"get_CurrentThread\", System_Threading_Thread_get_CurrentThread, TYPE_SYSTEM_THREADING_THREAD, 0},\n\n\t{NULL, \"Monitor\", \"Internal_TryEnter\", System_Threading_Monitor_Internal_TryEnter, TYPE_SYSTEM_BOOLEAN, 2, {TYPE_SYSTEM_OBJECT, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,      \"Internal_Exit\", System_Threading_Monitor_Internal_Exit, TYPE_SYSTEM_VOID, 1, {TYPE_SYSTEM_OBJECT}},\n\n\t{NULL, \"Interlocked\", \"CompareExchange\", System_Threading_Interlocked_CompareExchange_Int32, TYPE_SYSTEM_INT32, 3, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,          \"Increment\", System_Threading_Interlocked_Increment_Int32, TYPE_SYSTEM_INT32, 1, {TYPE_SYSTEM_INTPTR}},\n\t{NULL, NULL,          \"Decrement\", System_Threading_Interlocked_Decrement_Int32, TYPE_SYSTEM_INT32, 1, {TYPE_SYSTEM_INTPTR}},\n\t{NULL, NULL,          \"Add\", System_Threading_Interlocked_Add_Int32, TYPE_SYSTEM_INT32, 2, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_INT32}},\n\t{NULL, NULL,          \"Exchange\", System_Threading_Interlocked_Exchange_Int32, TYPE_SYSTEM_INT32, 2, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_INT32}},\n\n\t{\"System.IO\", \"FileInternal\", \"Open\", System_IO_FileInternal_Open, TYPE_SYSTEM_INTPTR, 5, {TYPE_SYSTEM_STRING, TYPE_SYSTEM_IO_FILEMODE, TYPE_SYSTEM_IO_FILEACCESS, TYPE_SYSTEM_IO_FILESHARE, TYPE_SYSTEM_INTPTR}},\n\t{NULL,        NULL,           \"Read\", System_IO_FileInternal_Read, TYPE_SYSTEM_INT32, 5, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_ARRAY_BYTE, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INTPTR}},\n\t{NULL,        NULL,           \"Close\", System_IO_FileInternal_Close, TYPE_SYSTEM_VOID, 2, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_INTPTR}},\n\t{NULL,        NULL,           \"GetCurrentDirectory\", System_IO_FileInternal_GetCurrentDirectory, TYPE_SYSTEM_STRING, 1, {TYPE_SYSTEM_INTPTR}},\n\t{NULL,        NULL,           \"GetFileAttributes\", System_IO_FileInternal_GetFileAttributes, TYPE_SYSTEM_IO_FILESYSTEMATTRIBUTES, 2, {TYPE_SYSTEM_STRING, TYPE_SYSTEM_INTPTR}},\n\t{NULL,        NULL,           \"GetFileSystemEntries\", System_IO_FileInternal_GetFileSystemEntries, TYPE_SYSTEM_ARRAY_STRING, 5, {TYPE_SYSTEM_STRING, TYPE_SYSTEM_STRING, TYPE_SYSTEM_IO_FILESYSTEMATTRIBUTES, TYPE_SYSTEM_IO_FILESYSTEMATTRIBUTES, TYPE_SYSTEM_INTPTR}},\n\n\t{\"System.Runtime.CompilerServices\", \"RuntimeHelpers\", \"InitializeArray\", System_Runtime_CompilerServices_InitializeArray, TYPE_SYSTEM_VOID, 2, {TYPE_SYSTEM_ARRAY_NO_TYPE, TYPE_SYSTEM_RUNTIMEFIELDHANDLE}},\n\n\t{\"System.Diagnostics\", \"Debugger\", \"Break\", System_Diagnostics_Debugger_Break, TYPE_SYSTEM_VOID, 0},\n\n\t{\"System.Net\", \"Dns\", \"Internal_GetHostEnt\", System_Net_Dns_Internal_GetHostEnt, TYPE_SYSTEM_ARRAY_INT32, 2, {TYPE_SYSTEM_STRING, TYPE_SYSTEM_INTPTR}},\n\n\t{\"System.Net.Sockets\", \"Socket\", \"Internal_CreateSocket\", System_Net_Sockets_Internal_CreateSocket, TYPE_SYSTEM_INTPTR, 4, {TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INTPTR}}, \n\t{NULL,                 NULL,     \"Internal_Bind\", System_Net_Sockets_Internal_Bind, TYPE_SYSTEM_VOID, 4, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_UINT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INTPTR}},\n\t{NULL,                 NULL,     \"Internal_Close\", System_Net_Sockets_Internal_Close, TYPE_SYSTEM_VOID, 1, {TYPE_SYSTEM_INTPTR}},\n\t{NULL,                 NULL,     \"Internal_Listen\", System_Net_Sockets_Internal_Listen, TYPE_SYSTEM_VOID, 3, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INTPTR}},\n\t{NULL,                 NULL,     \"Internal_Accept\", System_Net_Sockets_Internal_Accept, TYPE_SYSTEM_INTPTR, 2, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_INTPTR}},\n\t{NULL,                 NULL,     \"Internal_Connect\", System_Net_Sockets_Internal_Connect, TYPE_SYSTEM_VOID, 4, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_UINT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INTPTR}},\n\t{NULL,                 NULL,     \"Internal_Receive\", System_Net_Sockets_Internal_Receive, TYPE_SYSTEM_INT32, 6, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_ARRAY_BYTE, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INTPTR}},\n\t{NULL,                 NULL,     \"Internal_Send\", System_Net_Sockets_Internal_Send, TYPE_SYSTEM_INT32, 6, {TYPE_SYSTEM_INTPTR, TYPE_SYSTEM_ARRAY_BYTE, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INT32, TYPE_SYSTEM_INTPTR}},\n\n\t{NULL, NULL, NULL, NULL}\n};\n\nfnInternalCall InternalCall_Map(tMD_MethodDef *pMethod) {\n\ttInternalCall *pCall;\n\tSTRING curNameSpace;\n\tSTRING curType;\n\n\tif (pMethod->pParentType->pParent == types[TYPE_SYSTEM_MULTICASTDELEGATE]) {\n\t\t// Special case to handle delegates\n\t\tfnInternalCall fn = Map_Delegate(pMethod);\n\t\tif (fn != NULL) {\n\t\t\treturn fn;\n\t\t}\n\t} else {\n\n\t\tfor (pCall = internalCalls; pCall->method != NULL; pCall++) {\n\t\t\tif (pCall->nameSpace != NULL) {\n\t\t\t\tcurNameSpace = pCall->nameSpace;\n\t\t\t}\n\t\t\tif (pCall->type != NULL) {\n\t\t\t\tcurType = pCall->type;\n\t\t\t}\n\t\t\tif (strcmp(pMethod->pParentType->nameSpace, curNameSpace) == 0) {\n\t\t\t\tif (strcmp(pMethod->pParentType->name, curType) == 0) {\n\t\t\t\t\tif (Type_IsMethod(pMethod, pCall->method, types[pCall->returnType], pCall->numParameters, pCall->parameterTypes)) {\n\t\t\t\t\t\treturn pCall->fn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\tCrash(\"InternalCall_Map(): Cannot map [%s]%s.%s\", pMethod->pParentType->nameSpace, pMethod->pParentType->name, pMethod->name);\n\tFAKE_RETURN;\n}\n"
  },
  {
    "path": "dna/InternalCall.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__INTERNALCALL_H)\n#define __INTERNALCALL_H\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n\nfnInternalCall InternalCall_Map(tMD_MethodDef *pMethod);\n\n#endif"
  },
  {
    "path": "dna/JIT.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"JIT.h\"\n\n#include \"JIT_OpCodes.h\"\n#include \"CIL_OpCodes.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n#include \"Type.h\"\n#include \"InternalCall.h\"\n#include \"Heap.h\"\n#include \"PInvoke.h\"\n\n#define CorILMethod_TinyFormat 0x02\n#define CorILMethod_MoreSects 0x08\n\n#define CorILMethod_Sect_EHTable 0x01\n#define CorILMethod_Sect_FatFormat 0x40\n#define CorILMethod_Sect_MoreSects 0x80\n\n#define DYNAMIC_OK 0x100\n#define DYNAMIC_JUMP_TARGET 0x200\n#define DYNAMIC_EX_START 0x400\n#define DYNAMIC_EX_END 0x800\n#define DYNAMIC_BYTE_COUNT_MASK 0xff\n\ntypedef struct tOps_ tOps;\nstruct tOps_ {\n\tU32 *p;\n\tU32 capacity;\n\tU32 ofs;\n};\n\ntypedef struct tTypeStack_ tTypeStack;\nstruct tTypeStack_ {\n\ttMD_TypeDef **ppTypes;\n\tU32 ofs;\n\tU32 maxBytes; // The max size of the stack in bytes\n};\n\n#define InitOps(ops_, initialCapacity) ops_.capacity = initialCapacity; ops_.ofs = 0; ops_.p = malloc((initialCapacity) * sizeof(I32));\n#define DeleteOps(ops_) free(ops_.p)\n\n// Turn this into a MACRO at some point?\nstatic U32 Translate(U32 op, U32 getDynamic) {\n\tif (op >= JIT_OPCODE_MAXNUM) {\n\t\tCrash(\"Illegal opcode: %d\", op);\n\t}\n\tif (jitCodeInfo[op].pEnd == NULL) {\n\t\tCrash(\"Opcode not available: 0x%08x\", op);\n\t}\n\tif (getDynamic) {\n\t\treturn (U32)jitCodeInfo[op].isDynamic;\n\t} else {\n\t\treturn (U32)jitCodeInfo[op].pStart;\n\t}\n}\n\n#ifdef GEN_COMBINED_OPCODES\n#define PushU32(v) PushU32_(&ops, (U32)(v)); PushU32_(&isDynamic, 0)\n#define PushI32(v) PushU32_(&ops, (U32)(v)); PushU32_(&isDynamic, 0)\n#define PushFloat(v) convFloat.f=(float)(v); PushU32_(&ops, convFloat.u32); PushU32_(&isDynamic, 0)\n#define PushDouble(v) convDouble.d=(double)(v); PushU32_(&ops, convDouble.u32.a); PushU32_(&ops, convDouble.u32.b); PushU32_(&isDynamic, 0); PushU32_(&isDynamic, 0)\n#define PushPTR(ptr) PushU32_(&ops, (U32)(ptr)); PushU32_(&isDynamic, 0)\n#define PushOp(op) PushU32_(&ops, Translate((U32)(op), 0)); PushU32_(&isDynamic, Translate((U32)(op), 1))\n#define PushOpParam(op, param) PushOp(op); PushU32_(&ops, (U32)(param)); PushU32_(&isDynamic, 0)\n#else\n#define PushU32(v) PushU32_(&ops, (U32)(v))\n#define PushI32(v) PushU32_(&ops, (U32)(v))\n#define PushFloat(v) convFloat.f=(float)(v); PushU32_(&ops, convFloat.u32)\n#define PushDouble(v) convDouble.d=(double)(v); PushU32_(&ops, convDouble.u32.a); PushU32_(&ops, convDouble.u32.b)\n#define PushPTR(ptr) PushU32_(&ops, (U32)(ptr))\n#define PushOp(op) PushU32_(&ops, Translate((U32)(op), 0))\n#define PushOpParam(op, param) PushOp(op); PushU32_(&ops, (U32)(param))\n#endif\n\n#define PushBranch() PushU32_(&branchOffsets, ops.ofs)\n\n#define PushStackType(type) PushStackType_(&typeStack, type);\n#define PopStackType() (typeStack.ppTypes[--typeStack.ofs])\n#define PopStackTypeDontCare() typeStack.ofs--\n#define PopStackTypeMulti(number) typeStack.ofs -= number\n#define PopStackTypeAll() typeStack.ofs = 0;\n\n#define MayCopyTypeStack() if (u32Value > cilOfs) ppTypeStacks[u32Value] = DeepCopyTypeStack(&typeStack)\n\nstatic void PushStackType_(tTypeStack *pTypeStack, tMD_TypeDef *pType) {\n\tU32 i, size;\n\n\tMetaData_Fill_TypeDef(pType, NULL, NULL);\n\tpTypeStack->ppTypes[pTypeStack->ofs++] = pType;\n\t// Count current stack size in bytes\n\tsize = 0;\n\tfor (i=0; i<pTypeStack->ofs; i++) {\n\t\tsize += pTypeStack->ppTypes[i]->stackSize;\n\t}\n\tif (size > pTypeStack->maxBytes) {\n\t\tpTypeStack->maxBytes = size;\n\t}\n\t//printf(\"Stack ofs = %d; Max stack size: %d (0x%x)\\n\", pTypeStack->ofs, size, size);\n}\n\nstatic void PushU32_(tOps *pOps, U32 v) {\n\tif (pOps->ofs >= pOps->capacity) {\n\t\tpOps->capacity <<= 1;\n//\t\tprintf(\"a.pOps->p = 0x%08x size=%d\\n\", pOps->p, pOps->capacity * sizeof(U32));\n\t\tpOps->p = realloc(pOps->p, pOps->capacity * sizeof(U32));\n\t}\n\tpOps->p[pOps->ofs++] = v;\n}\n\nstatic U32 GetUnalignedU32(U8 *pCIL, U32 *pCILOfs) {\n\tU32 a,b,c,d;\n\ta = pCIL[(*pCILOfs)++];\n\tb = pCIL[(*pCILOfs)++];\n\tc = pCIL[(*pCILOfs)++];\n\td = pCIL[(*pCILOfs)++];\n\treturn a | (b << 8) | (c << 16) | (d << 24);\n}\n\nstatic tTypeStack* DeepCopyTypeStack(tTypeStack *pToCopy) {\n\ttTypeStack *pCopy;\n\n\tpCopy = TMALLOC(tTypeStack);\n\tpCopy->maxBytes = pToCopy->maxBytes;\n\tpCopy->ofs = pToCopy->ofs;\n\tif (pToCopy->ofs > 0) {\n\t\tpCopy->ppTypes = malloc(pToCopy->ofs * sizeof(tMD_TypeDef*));\n\t\tmemcpy(pCopy->ppTypes, pToCopy->ppTypes, pToCopy->ofs * sizeof(tMD_TypeDef*));\n\t} else {\n\t\tpCopy->ppTypes = NULL;\n\t}\n\treturn pCopy;\n}\n\nstatic void RestoreTypeStack(tTypeStack *pMainStack, tTypeStack *pCopyFrom) {\n\t// This does not effect maxBytes, as the current value will always be equal\n\t// or greater than the value being copied from.\n\tif (pCopyFrom == NULL) {\n\t\tpMainStack->ofs = 0;\n\t} else {\n\t\tpMainStack->ofs = pCopyFrom->ofs;\n\t\tif (pCopyFrom->ppTypes != NULL) {\n\t\t\tmemcpy(pMainStack->ppTypes, pCopyFrom->ppTypes, pCopyFrom->ofs * sizeof(tMD_TypeDef*));\n\t\t}\n\t}\n}\n\n#ifdef GEN_COMBINED_OPCODES\nstatic U32 FindOpCode(void *pAddr) {\n\tU32 i;\n\tfor (i=0; i<JIT_OPCODE_MAXNUM; i++) {\n\t\tif (jitCodeInfo[i].pStart == pAddr) {\n\t\t\treturn i;\n\t\t}\n\t}\n\tCrash(\"Cannot find opcode for address: 0x%08x\", (U32)pAddr);\n\tFAKE_RETURN;\n}\n\nstatic U32 combinedMemSize = 0;\nstatic U32 GenCombined(tOps *pOps, tOps *pIsDynamic, U32 startOfs, U32 count, U32 *pCombinedSize, void **ppMem) {\n\tU32 memSize;\n\tU32 ofs;\n\tvoid *pCombined;\n\tU32 opCopyToOfs;\n\tU32 shrinkOpsBy;\n\tU32 goNextSize = (U32)((char*)jitCodeGoNext.pEnd - (char*)jitCodeGoNext.pStart);\n\n\t// Get length of final combined code chunk\n\tmemSize = 0;\n\tfor (ofs=0; ofs < count; ofs++) {\n\t\tU32 opcode = FindOpCode((void*)pOps->p[startOfs + ofs]);\n\t\tU32 size = (U32)((char*)jitCodeInfo[opcode].pEnd - (char*)jitCodeInfo[opcode].pStart);\n\t\tmemSize += size;\n\t\tofs += (pIsDynamic->p[startOfs + ofs] & DYNAMIC_BYTE_COUNT_MASK) >> 2;\n\t}\n\t// Add length of GoNext code\n\tmemSize += goNextSize;\n\n\tpCombined = malloc(memSize);\n\t*ppMem = pCombined;\n\tcombinedMemSize += memSize;\n\t*pCombinedSize = memSize;\n\t//log_f(0, \"Combined JIT size: %d\\n\", combinedMemSize);\n\n\t// Copy the bits of code into place\n\tmemSize = 0;\n\topCopyToOfs = 1;\n\tfor (ofs=0; ofs < count; ofs++) {\n\t\tU32 extraOpBytes;\n\t\tU32 opcode = FindOpCode((void*)pOps->p[startOfs + ofs]);\n\t\tU32 size = (U32)((char*)jitCodeInfo[opcode].pEnd - (char*)jitCodeInfo[opcode].pStart);\n\t\tmemcpy((char*)pCombined + memSize, jitCodeInfo[opcode].pStart, size);\n\t\tmemSize += size;\n\t\textraOpBytes = pIsDynamic->p[startOfs + ofs] & DYNAMIC_BYTE_COUNT_MASK;\n\t\tmemmove(&pOps->p[startOfs + opCopyToOfs], &pOps->p[startOfs + ofs + 1], extraOpBytes);\n\t\topCopyToOfs += extraOpBytes >> 2;\n\t\tofs += extraOpBytes >> 2;\n\t}\n\tshrinkOpsBy = ofs - opCopyToOfs;\n\t// Add GoNext code\n\tmemcpy((char*)pCombined + memSize, jitCodeGoNext.pStart, goNextSize);\n\tpOps->p[startOfs] = (U32)pCombined;\n\n\treturn shrinkOpsBy;\n}\n#endif\n\nstatic U32* JITit(tMD_MethodDef *pMethodDef, U8 *pCIL, U32 codeSize, tParameter *pLocals, tJITted *pJITted, U32 genCombinedOpcodes) {\n\tU32 maxStack = pJITted->maxStack;\n\tU32 i;\n\tU32 cilOfs;\n\ttOps ops; // The JITted op-codes\n\ttOps branchOffsets; // Filled with all the branch instructions that need offsets fixing\n\tU32 *pJITOffsets;\t// To store the JITted code offset of each CIL byte.\n\t\t\t\t\t\t// Only CIL bytes that are the first byte of an instruction will have meaningful data\n\ttTypeStack **ppTypeStacks; // To store the evaluation stack state for forward jumps\n\tU32 *pFinalOps;\n\ttMD_TypeDef *pStackType;\n\ttTypeStack typeStack;\n\n#ifdef GEN_COMBINED_OPCODES\n\ttOps isDynamic;\n#endif\n\n\tI32 i32Value;\n\tU32 u32Value, u32Value2, ofs;\n\tuConvFloat convFloat;\n\tuConvDouble convDouble;\n\ttMD_TypeDef *pTypeA, *pTypeB;\n\tPTR pMem;\n\ttMetaData *pMetaData;\n\n\tpMetaData = pMethodDef->pMetaData;\n\tpJITOffsets = malloc(codeSize * sizeof(U32));\n\t// + 1 to handle cases where the stack is being restored at the last instruction in a method\n\tppTypeStacks = malloc((codeSize + 1) * sizeof(tTypeStack*));\n\tmemset(ppTypeStacks, 0, (codeSize + 1) * sizeof(tTypeStack*));\n\ttypeStack.maxBytes = 0;\n\ttypeStack.ofs = 0;\n\ttypeStack.ppTypes = malloc(maxStack * sizeof(tMD_TypeDef*));\n\n\t// Set up all exception 'catch' blocks with the correct stack information,\n\t// So they'll have just the exception type on the stack when entered\n\tfor (i=0; i<pJITted->numExceptionHandlers; i++) {\n\t\ttExceptionHeader *pEx;\n\n\t\tpEx = &pJITted->pExceptionHeaders[i]; \n\t\tif (pEx->flags == COR_ILEXCEPTION_CLAUSE_EXCEPTION) {\n\t\t\ttTypeStack *pTypeStack;\n\n\t\t\tppTypeStacks[pEx->handlerStart] = pTypeStack = TMALLOC(tTypeStack);\n\t\t\tpTypeStack->maxBytes = 4;\n\t\t\tpTypeStack->ofs = 1;\n\t\t\tpTypeStack->ppTypes = TMALLOC(tMD_TypeDef*);\n\t\t\tpTypeStack->ppTypes[0] = pEx->u.pCatchTypeDef;\n\t\t}\n\t}\n\n\tInitOps(ops, 32);\n\tInitOps(branchOffsets, 16);\n#ifdef GEN_COMBINED_OPCODES\n\tInitOps(isDynamic, 32);\n#endif\n\n\tcilOfs = 0;\n\n\tdo {\n\t\tU8 op;\n\n\t\t// Set the JIT offset for this CIL opcode\n\t\tpJITOffsets[cilOfs] = ops.ofs;\n\n\t\top = pCIL[cilOfs++];\n\t\t//printf(\"Opcode: 0x%02x\\n\", op);\n\n\t\tswitch (op) {\n\t\t\tcase CIL_NOP:\n\t\t\t\tPushOp(JIT_NOP);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDNULL:\n\t\t\t\tPushOp(JIT_LOAD_NULL);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_OBJECT]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_DUP:\n\t\t\t\tpStackType = PopStackType();\n\t\t\t\tPushStackType(pStackType);\n\t\t\t\tPushStackType(pStackType);\n\t\t\t\tswitch (pStackType->stackSize) {\n\t\t\t\tcase 4:\n\t\t\t\t\tPushOp(JIT_DUP_4);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 8:\n\t\t\t\t\tPushOp(JIT_DUP_8);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tPushOpParam(JIT_DUP_GENERAL, pStackType->stackSize);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_POP:\n\t\t\t\tpStackType = PopStackType();\n\t\t\t\tif (pStackType->stackSize == 4) {\n\t\t\t\t\tPushOp(JIT_POP_4);\n\t\t\t\t} else {\n\t\t\t\t\tPushOpParam(JIT_POP, pStackType->stackSize);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDC_I4_M1:\n\t\t\tcase CIL_LDC_I4_0:\n\t\t\tcase CIL_LDC_I4_1:\n\t\t\tcase CIL_LDC_I4_2:\n\t\t\tcase CIL_LDC_I4_3:\n\t\t\tcase CIL_LDC_I4_4:\n\t\t\tcase CIL_LDC_I4_5:\n\t\t\tcase CIL_LDC_I4_6:\n\t\t\tcase CIL_LDC_I4_7:\n\t\t\tcase CIL_LDC_I4_8:\n\t\t\t\ti32Value = (I8)op - (I8)CIL_LDC_I4_0;\n\t\t\t\tgoto cilLdcI4;\n\n\t\t\tcase CIL_LDC_I4_S:\n\t\t\t\ti32Value = (I8)pCIL[cilOfs++];\n\t\t\t\tgoto cilLdcI4;\n\n\t\t\tcase CIL_LDC_I4:\n\t\t\t\ti32Value = (I32)GetUnalignedU32(pCIL, &cilOfs);\ncilLdcI4:\n\t\t\t\tif (i32Value >= -1 && i32Value <= 2) {\n\t\t\t\t\tPushOp(JIT_LOAD_I4_0 + i32Value);\n\t\t\t\t} else {\n\t\t\t\t\tPushOp(JIT_LOAD_I32);\n\t\t\t\t\tPushI32(i32Value);\n\t\t\t\t}\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT32]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDC_I8:\n\t\t\t\tPushOp(JIT_LOAD_I64);\n\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\tPushU32(u32Value);\n\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\tPushU32(u32Value);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT64]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDC_R4:\n\t\t\t\tconvFloat.u32 = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_SINGLE]);\n\t\t\t\tPushOp(JIT_LOAD_F32);\n\t\t\t\tPushFloat(convFloat.f);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDC_R8:\n\t\t\t\tconvDouble.u32.a = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\tconvDouble.u32.b = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_DOUBLE]);\n\t\t\t\tPushOp(JIT_LOAD_F64);\n\t\t\t\tPushDouble(convDouble.d);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDARG_0:\n\t\t\tcase CIL_LDARG_1:\n\t\t\tcase CIL_LDARG_2:\n\t\t\tcase CIL_LDARG_3:\n\t\t\t\tu32Value = op - CIL_LDARG_0;\n\t\t\t\tgoto cilLdArg;\n\n\t\t\tcase CIL_LDARG_S:\n\t\t\t\tu32Value = pCIL[cilOfs++];\ncilLdArg:\n\t\t\t\tpStackType = pMethodDef->pParams[u32Value].pTypeDef;\n\t\t\t\tofs = pMethodDef->pParams[u32Value].offset;\n\t\t\t\tif (pStackType->stackSize == 4 && ofs < 32) {\n\t\t\t\t\tPushOp(JIT_LOADPARAMLOCAL_0 + (ofs >> 2));\n\t\t\t\t} else {\n\t\t\t\t\tPushOpParam(JIT_LOADPARAMLOCAL_TYPEID + pStackType->stackType, ofs);\n\t\t\t\t\t// if it's a valuetype then push the TypeDef of it afterwards\n\t\t\t\t\tif (pStackType->stackType == EVALSTACK_VALUETYPE) {\n\t\t\t\t\t\tPushPTR(pStackType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tPushStackType(pStackType);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDARGA_S:\n\t\t\t\t// Get the argument number to load the address of\n\t\t\t\tu32Value = pCIL[cilOfs++];\n\t\t\t\tPushOpParam(JIT_LOAD_PARAMLOCAL_ADDR, pMethodDef->pParams[u32Value].offset);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_INTPTR]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_STARG_S:\n\t\t\t\t// Get the argument number to store the arg of\n\t\t\t\tu32Value = pCIL[cilOfs++];\n\t\t\t\tpStackType = PopStackType();\n\t\t\t\tofs = pMethodDef->pParams[u32Value].offset;\n\t\t\t\tif (pStackType->stackSize == 4 && ofs < 32) {\n\t\t\t\t\tPushOp(JIT_STOREPARAMLOCAL_0 + (ofs >> 2));\n\t\t\t\t} else {\n\t\t\t\t\tPushOpParam(JIT_STOREPARAMLOCAL_TYPEID + pStackType->stackType, ofs);\n\t\t\t\t\t// if it's a valuetype then push the TypeDef of it afterwards\n\t\t\t\t\tif (pStackType->stackType == EVALSTACK_VALUETYPE) {\n\t\t\t\t\t\tPushPTR(pStackType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDLOC_0:\n\t\t\tcase CIL_LDLOC_1:\n\t\t\tcase CIL_LDLOC_2:\n\t\t\tcase CIL_LDLOC_3:\n\t\t\t\t// Push opcode and offset into locals memory\n\t\t\t\tu32Value = op - CIL_LDLOC_0;\n\t\t\t\tgoto cilLdLoc;\n\n\t\t\tcase CIL_LDLOC_S:\n\t\t\t\t// Push opcode and offset into locals memory\n\t\t\t\tu32Value = pCIL[cilOfs++];\ncilLdLoc:\n\t\t\t\tpStackType = pLocals[u32Value].pTypeDef;\n\t\t\t\tofs = pMethodDef->parameterStackSize + pLocals[u32Value].offset;\n\t\t\t\tif (pStackType->stackSize == 4 && ofs < 32) {\n\t\t\t\t\tPushOp(JIT_LOADPARAMLOCAL_0 + (ofs >> 2));\n\t\t\t\t} else {\n\t\t\t\t\tPushOpParam(JIT_LOADPARAMLOCAL_TYPEID + pStackType->stackType, ofs);\n\t\t\t\t\t// if it's a valuetype then push the TypeDef of it afterwards\n\t\t\t\t\tif (pStackType->stackType == EVALSTACK_VALUETYPE) {\n\t\t\t\t\t\tPushPTR(pStackType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tPushStackType(pStackType);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_STLOC_0:\n\t\t\tcase CIL_STLOC_1:\n\t\t\tcase CIL_STLOC_2:\n\t\t\tcase CIL_STLOC_3:\n\t\t\t\tu32Value = op - CIL_STLOC_0;\n\t\t\t\tgoto cilStLoc;\n\n\t\t\tcase CIL_STLOC_S:\n\t\t\t\tu32Value = pCIL[cilOfs++];\ncilStLoc:\n\t\t\t\tpStackType = PopStackType();\n\t\t\t\tofs = pMethodDef->parameterStackSize + pLocals[u32Value].offset;\n\t\t\t\tif (pStackType->stackSize == 4 && ofs < 32) {\n\t\t\t\t\tPushOp(JIT_STOREPARAMLOCAL_0 + (ofs >> 2));\n\t\t\t\t} else {\n\t\t\t\t\tPushOpParam(JIT_STOREPARAMLOCAL_TYPEID + pStackType->stackType, ofs);\n\t\t\t\t\t// if it's a valuetype then push the TypeDef of it afterwards\n\t\t\t\t\tif (pStackType->stackType == EVALSTACK_VALUETYPE) {\n\t\t\t\t\t\tPushPTR(pStackType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDLOCA_S:\n\t\t\t\t// Get the local number to load the address of\n\t\t\t\tu32Value = pCIL[cilOfs++];\n\t\t\t\tPushOpParam(JIT_LOAD_PARAMLOCAL_ADDR, pMethodDef->parameterStackSize + pLocals[u32Value].offset);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_INTPTR]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDIND_I1:\n\t\t\t\tu32Value = TYPE_SYSTEM_SBYTE;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_U1:\n\t\t\t\tu32Value = TYPE_SYSTEM_BYTE;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_I2:\n\t\t\t\tu32Value = TYPE_SYSTEM_INT16;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_U2:\n\t\t\t\tu32Value = TYPE_SYSTEM_UINT16;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_I4:\n\t\t\t\tu32Value = TYPE_SYSTEM_INT32;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_U4:\n\t\t\t\tu32Value = TYPE_SYSTEM_UINT32;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_I8:\n\t\t\t\tu32Value = TYPE_SYSTEM_INT64;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_R4:\n\t\t\t\tu32Value = TYPE_SYSTEM_SINGLE;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_R8:\n\t\t\t\tu32Value = TYPE_SYSTEM_DOUBLE;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_REF:\n\t\t\t\tu32Value = TYPE_SYSTEM_OBJECT;\n\t\t\t\tgoto cilLdInd;\n\t\t\tcase CIL_LDIND_I:\n\t\t\t\tu32Value = TYPE_SYSTEM_INTPTR;\ncilLdInd:\n\t\t\t\tPopStackTypeDontCare(); // don't care what it is\n\t\t\t\tPushOp(JIT_LOADINDIRECT_I8 + (op - CIL_LDIND_I1));\n\t\t\t\tPushStackType(types[u32Value]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_STIND_REF:\n\t\t\tcase CIL_STIND_I1:\n\t\t\tcase CIL_STIND_I2:\n\t\t\tcase CIL_STIND_I4:\n\t\t\t\tPopStackTypeMulti(2); // Don't care what they are\n\t\t\t\tPushOp(JIT_STOREINDIRECT_REF + (op - CIL_STIND_REF));\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_RET:\n\t\t\t\tPushOp(JIT_RETURN);\n\t\t\t\tRestoreTypeStack(&typeStack, ppTypeStacks[cilOfs]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_CALL:\n\t\t\tcase CIL_CALLVIRT:\n\t\t\t\t{\n\t\t\t\t\ttMD_MethodDef *pCallMethod;\n\t\t\t\t\ttMD_TypeDef *pBoxCallType;\n\t\t\t\t\tU32 derefRefType;\n\n\t\t\t\t\tu32Value2 = 0;\n\ncilCallVirtConstrained:\n\t\t\t\t\tpBoxCallType = NULL;\n\t\t\t\t\tderefRefType = 0;\n\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpCallMethod = MetaData_GetMethodDefFromDefRefOrSpec(pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tif (pCallMethod->isFilled == 0) {\n\t\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\t\t\t\t\t\t\n\t\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromMethodDef(pCallMethod);\n\t\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (u32Value2 != 0) {\n\t\t\t\t\t\t// There is a 'constrained' prefix\n\t\t\t\t\t\ttMD_TypeDef *pConstrainedType;\n\n\t\t\t\t\t\tpConstrainedType = MetaData_GetTypeDefFromDefRefOrSpec(pMetaData, u32Value2, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\t\tif (TYPE_ISINTERFACE(pCallMethod->pParentType)) {\n\t\t\t\t\t\t\tu32Value2 = 0xffffffff;\n\t\t\t\t\t\t\t// Find the interface that we're dealing with\n\t\t\t\t\t\t\tfor (i=0; i<pConstrainedType->numInterfaces; i++) {\n\t\t\t\t\t\t\t\tif (pConstrainedType->pInterfaceMaps[i].pInterface == pCallMethod->pParentType) {\n\t\t\t\t\t\t\t\t\tu32Value2 = pConstrainedType->pInterfaceMaps[i].pVTableLookup[pCallMethod->vTableOfs];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tAssert(u32Value2 != 0xffffffff);\n\t\t\t\t\t\t\tif (pConstrainedType->pVTable[u32Value2]->pParentType == pConstrainedType) {\n\t\t\t\t\t\t\t\t// This method is implemented on this class, so make it a normal CALL op\n\t\t\t\t\t\t\t\top = CIL_CALL;\n\t\t\t\t\t\t\t\tpCallMethod = pConstrainedType->pVTable[u32Value2];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (pConstrainedType->isValueType) {\n\t\t\t\t\t\t\t\ttMD_MethodDef *pImplMethod;\n\t\t\t\t\t\t\t\t// If pConstraintedType directly implements the call then don't do anything\n\t\t\t\t\t\t\t\t// otherwise the 'this' pointer must be boxed (BoxedCall)\n\t\t\t\t\t\t\t\tpImplMethod = pConstrainedType->pVTable[pCallMethod->vTableOfs];\n\t\t\t\t\t\t\t\tif (pImplMethod->pParentType == pConstrainedType) {\n\t\t\t\t\t\t\t\t\top = CIL_CALL;\n\t\t\t\t\t\t\t\t\tpCallMethod = pImplMethod;\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tpBoxCallType = pConstrainedType;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Reference-type, so dereference the PTR to 'this' and use that for the 'this' for the call.\n\t\t\t\t\t\t\t\tderefRefType = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Pop stack type for each argument. Don't actually care what these are,\n\t\t\t\t\t// except the last one which will be the 'this' object type of a non-static method\n\t\t\t\t\t//printf(\"Call %s() - popping %d stack args\\n\", pCallMethod->name, pCallMethod->numberOfParameters);\n\t\t\t\t\tfor (i=0; i<pCallMethod->numberOfParameters; i++) {\n\t\t\t\t\t\tpStackType = PopStackType();\n\t\t\t\t\t}\n\t\t\t\t\t// the stack type of the 'this' object will now be in stackType (if there is one)\n\t\t\t\t\tif (METHOD_ISSTATIC(pCallMethod)) {\n\t\t\t\t\t\tpStackType = types[TYPE_SYSTEM_OBJECT];\n\t\t\t\t\t}\n\t\t\t\t\tMetaData_Fill_TypeDef(pStackType, NULL, NULL);\n\t\t\t\t\tif (TYPE_ISINTERFACE(pCallMethod->pParentType) && op == CIL_CALLVIRT) {\n\t\t\t\t\t\tPushOp(JIT_CALL_INTERFACE);\n\t\t\t\t\t} else if (pCallMethod->pParentType->pParent == types[TYPE_SYSTEM_MULTICASTDELEGATE]) {\n\t\t\t\t\t\tPushOp(JIT_INVOKE_DELEGATE);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch (pStackType->stackType)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tcase EVALSTACK_INTNATIVE: // Not really right, but it'll work on 32-bit\n\t\t\t\t\t\tcase EVALSTACK_O:\n\t\t\t\t\t\t\tif (derefRefType) {\n\t\t\t\t\t\t\t\tPushOp(JIT_DEREF_CALLVIRT);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (pBoxCallType != NULL) {\n\t\t\t\t\t\t\t\t\tPushOp(JIT_BOX_CALLVIRT);\n\t\t\t\t\t\t\t\t\tPushPTR(pBoxCallType);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tPushOp((op == CIL_CALL)?JIT_CALL_O:JIT_CALLVIRT_O);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase EVALSTACK_PTR:\n\t\t\t\t\t\tcase EVALSTACK_VALUETYPE:\n\t\t\t\t\t\t\tif (derefRefType) {\n\t\t\t\t\t\t\t\tPushOp(JIT_DEREF_CALLVIRT);\n\t\t\t\t\t\t\t} else if (pBoxCallType != NULL) {\n\t\t\t\t\t\t\t\tPushOp(JIT_BOX_CALLVIRT);\n\t\t\t\t\t\t\t\tPushPTR(pBoxCallType);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tPushOp(JIT_CALL_PTR);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tCrash(\"JITit(): Cannot CALL or CALLVIRT with stack type: %d\", pStackType->stackType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tPushPTR(pCallMethod);\n\n\t\t\t\t\tif (pCallMethod->pReturnType != NULL) {\n\t\t\t\t\t\tPushStackType(pCallMethod->pReturnType);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_BR_S: // unconditional branch\n\t\t\t\tu32Value = (I8)pCIL[cilOfs++];\n\t\t\t\tgoto cilBr;\n\n\t\t\tcase CIL_BR:\n\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\ncilBr:\n\t\t\t\t// Put a temporary CIL offset value into the JITted code. This will be updated later\n\t\t\t\tu32Value = cilOfs + (I32)u32Value;\n\t\t\t\tMayCopyTypeStack();\n\t\t\t\tPushOp(JIT_BRANCH);\n\t\t\t\tPushBranch();\n\t\t\t\tPushU32(u32Value);\n\t\t\t\t// Restore the stack state\n\t\t\t\tRestoreTypeStack(&typeStack, ppTypeStacks[cilOfs]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_SWITCH:\n\t\t\t\t// This is the int containing the switch value. Don't care what it is.\n\t\t\t\tPopStackTypeDontCare();\n\t\t\t\t// The number of switch jump targets\n\t\t\t\ti32Value = (I32)GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t// Set up the offset from which the jump offsets are calculated\n\t\t\t\tu32Value2 = cilOfs + (i32Value << 2);\n\t\t\t\tPushOpParam(JIT_SWITCH, i32Value);\n\t\t\t\tfor (i=0; i<(U32)i32Value; i++) {\n\t\t\t\t\t// A jump target\n\t\t\t\t\tu32Value = u32Value2 + (I32)GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tPushBranch();\n\t\t\t\t\tMayCopyTypeStack();\n\t\t\t\t\t// Push the jump target.\n\t\t\t\t\t// It is needed to allow the branch offset to be correctly updated later.\n\t\t\t\t\tPushU32(u32Value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_BRFALSE_S:\n\t\t\tcase CIL_BRTRUE_S:\n\t\t\t\tu32Value = (I8)pCIL[cilOfs++];\n\t\t\t\tu32Value2 = JIT_BRANCH_FALSE + (op - CIL_BRFALSE_S);\n\t\t\t\tgoto cilBrFalseTrue;\n\n\t\t\tcase CIL_BRFALSE:\n\t\t\tcase CIL_BRTRUE:\n\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\tu32Value2 = JIT_BRANCH_FALSE + (op - CIL_BRFALSE);\ncilBrFalseTrue:\n\t\t\t\tPopStackTypeDontCare(); // Don't care what it is\n\t\t\t\t// Put a temporary CIL offset value into the JITted code. This will be updated later\n\t\t\t\tu32Value = cilOfs + (I32)u32Value;\n\t\t\t\tMayCopyTypeStack();\n\t\t\t\tPushOp(u32Value2);\n\t\t\t\tPushBranch();\n\t\t\t\tPushU32(u32Value);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_BEQ_S:\n\t\t\tcase CIL_BGE_S:\n\t\t\tcase CIL_BGT_S:\n\t\t\tcase CIL_BLE_S:\n\t\t\tcase CIL_BLT_S:\n\t\t\tcase CIL_BNE_UN_S:\n\t\t\tcase CIL_BGE_UN_S:\n\t\t\tcase CIL_BGT_UN_S:\n\t\t\tcase CIL_BLE_UN_S:\n\t\t\tcase CIL_BLT_UN_S:\n\t\t\t\tu32Value = (I8)pCIL[cilOfs++];\n\t\t\t\tu32Value2 = CIL_BEQ_S;\n\t\t\t\tgoto cilBrCond;\n\n\t\t\tcase CIL_BEQ:\n\t\t\tcase CIL_BGE:\n\t\t\tcase CIL_BGT:\n\t\t\tcase CIL_BLE:\n\t\t\tcase CIL_BLT:\n\t\t\tcase CIL_BNE_UN:\n\t\t\tcase CIL_BGE_UN:\n\t\t\tcase CIL_BGT_UN:\n\t\t\tcase CIL_BLE_UN:\n\t\t\tcase CIL_BLT_UN:\n\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\tu32Value2 = CIL_BEQ;\ncilBrCond:\n\t\t\t\tpTypeB = PopStackType();\n\t\t\t\tpTypeA = PopStackType();\n\t\t\t\tu32Value = cilOfs + (I32)u32Value;\n\t\t\t\tMayCopyTypeStack();\n\t\t\t\tif ((pTypeA->stackType == EVALSTACK_INT32 && pTypeB->stackType == EVALSTACK_INT32) ||\n\t\t\t\t\t(pTypeA->stackType == EVALSTACK_O && pTypeB->stackType == EVALSTACK_O)) {\n\t\t\t\t\tPushOp(JIT_BEQ_I32I32 + (op - u32Value2));\n\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_INT64 && pTypeB->stackType == EVALSTACK_INT64) {\n\t\t\t\t\tPushOp(JIT_BEQ_I64I64 + (op - u32Value2));\n\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_F32 && pTypeB->stackType == EVALSTACK_F32) {\n\t\t\t\t\tPushOp(JIT_BEQ_F32F32 + (op - u32Value2));\n\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_F64 && pTypeB->stackType == EVALSTACK_F64) {\n\t\t\t\t\tPushOp(JIT_BEQ_F64F64 + (op - u32Value2));\n\t\t\t\t} else {\n\t\t\t\t\tCrash(\"JITit(): Cannot perform conditional branch on stack types: %d and %d\", pTypeA->stackType, pTypeB->stackType);\n\t\t\t\t}\n\t\t\t\tPushBranch();\n\t\t\t\tPushU32(u32Value);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_ADD_OVF:\n\t\t\tcase CIL_ADD_OVF_UN:\n\t\t\tcase CIL_MUL_OVF:\n\t\t\tcase CIL_MUL_OVF_UN:\n\t\t\tcase CIL_SUB_OVF:\n\t\t\tcase CIL_SUB_OVF_UN:\n\t\t\t\tu32Value = (CIL_ADD_OVF - CIL_ADD) + (JIT_ADD_I32I32 - JIT_ADD_OVF_I32I32);\n\t\t\t\tgoto cilBinaryArithOp;\n\t\t\tcase CIL_ADD:\n\t\t\tcase CIL_SUB:\n\t\t\tcase CIL_MUL:\n\t\t\tcase CIL_DIV:\n\t\t\tcase CIL_DIV_UN:\n\t\t\tcase CIL_REM:\n\t\t\tcase CIL_REM_UN:\n\t\t\tcase CIL_AND:\n\t\t\tcase CIL_OR:\n\t\t\tcase CIL_XOR:\n\t\t\t\tu32Value = 0;\ncilBinaryArithOp:\n\t\t\t\tpTypeB = PopStackType();\n\t\t\t\tpTypeA = PopStackType();\n\t\t\t\tif (pTypeA->stackType == EVALSTACK_INT32 && pTypeB->stackType == EVALSTACK_INT32) {\n\t\t\t\t\tPushOp(JIT_ADD_I32I32 + (op - CIL_ADD) - u32Value);\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT32]);\n\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_INT64 && pTypeB->stackType == EVALSTACK_INT64) {\n\t\t\t\t\tPushOp(JIT_ADD_I64I64 + (op - CIL_ADD) - u32Value);\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT64]);\n\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_F32 && pTypeB->stackType == EVALSTACK_F32) {\n\t\t\t\t\tPushOp(JIT_ADD_F32F32 + (op - CIL_ADD) - u32Value);\n\t\t\t\t\tPushStackType(pTypeA);\n\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_F64 && pTypeB->stackType == EVALSTACK_F64) {\n\t\t\t\t\tPushOp(JIT_ADD_F64F64 + (op - CIL_ADD) - u32Value);\n\t\t\t\t\tPushStackType(pTypeA);\n\t\t\t\t} else {\n\t\t\t\t\tCrash(\"JITit(): Cannot perform binary numeric operand on stack types: %d and %d\", pTypeA->stackType, pTypeB->stackType);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_NEG:\n\t\t\tcase CIL_NOT:\n\t\t\t\tpTypeA = PopStackType();\n\t\t\t\tif (pTypeA->stackType == EVALSTACK_INT32) {\n\t\t\t\t\tPushOp(JIT_NEG_I32 + (op - CIL_NEG));\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT32]);\n\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_INT64) {\n\t\t\t\t\tPushOp(JIT_NEG_I64 + (op - CIL_NEG));\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT64]);\n\t\t\t\t} else {\n\t\t\t\t\tCrash(\"JITit(): Cannot perform unary operand on stack types: %d\", pTypeA->stackType);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_SHL:\n\t\t\tcase CIL_SHR:\n\t\t\tcase CIL_SHR_UN:\n\t\t\t\tPopStackTypeDontCare(); // Don't care about the shift amount\n\t\t\t\tpTypeA = PopStackType(); // Do care about the value to shift\n\t\t\t\tif (pTypeA->stackType == EVALSTACK_INT32) {\n\t\t\t\t\tPushOp(JIT_SHL_I32 - CIL_SHL + op);\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT32]);\n\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_INT64) {\n\t\t\t\t\tPushOp(JIT_SHL_I64 - CIL_SHL + op);\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT64]);\n\t\t\t\t} else {\n\t\t\t\t\tCrash(\"JITit(): Cannot perform shift operation on type: %s\", pTypeA->name);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\t// Conversion operations\n\t\t\t\t{\n\t\t\t\t\tU32 toType;\n\t\t\t\t\tU32 toBitCount;\n\t\t\t\t\tU32 convOpOffset;\n\t\t\tcase CIL_CONV_I1:\n\t\t\tcase CIL_CONV_OVF_I1: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_OVF_I1_UN: // Fix this later - will never overflow\n\t\t\t\ttoBitCount = 8;\n\t\t\t\ttoType = TYPE_SYSTEM_SBYTE;\n\t\t\t\tgoto cilConvInt32;\n\t\t\tcase CIL_CONV_I2:\n\t\t\tcase CIL_CONV_OVF_I2: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_OVF_I2_UN: // Fix this later - will never overflow\n\t\t\t\ttoBitCount = 16;\n\t\t\t\ttoType = TYPE_SYSTEM_INT16;\n\t\t\t\tgoto cilConvInt32;\n\t\t\tcase CIL_CONV_I4:\n\t\t\tcase CIL_CONV_OVF_I4: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_OVF_I4_UN: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_I: // Only on 32-bit\n\t\t\tcase CIL_CONV_OVF_I_UN: // Only on 32-bit; Fix this later - will never overflow\n\t\t\t\ttoBitCount = 32;\n\t\t\t\ttoType = TYPE_SYSTEM_INT32;\ncilConvInt32:\n\t\t\t\tconvOpOffset = JIT_CONV_OFFSET_I32;\n\t\t\t\tgoto cilConv;\n\t\t\tcase CIL_CONV_U1:\n\t\t\tcase CIL_CONV_OVF_U1: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_OVF_U1_UN: // Fix this later - will never overflow\n\t\t\t\ttoBitCount = 8;\n\t\t\t\ttoType = TYPE_SYSTEM_BYTE;\n\t\t\t\tgoto cilConvUInt32;\n\t\t\tcase CIL_CONV_U2:\n\t\t\tcase CIL_CONV_OVF_U2: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_OVF_U2_UN: // Fix this later - will never overflow\n\t\t\t\ttoBitCount = 16;\n\t\t\t\ttoType = TYPE_SYSTEM_UINT16;\n\t\t\t\tgoto cilConvUInt32;\n\t\t\tcase CIL_CONV_U4:\n\t\t\tcase CIL_CONV_OVF_U4: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_OVF_U4_UN: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_U: // Only on 32-bit\n\t\t\tcase CIL_CONV_OVF_U_UN: // Only on 32-bit; Fix this later - will never overflow\n\t\t\t\ttoBitCount = 32;\n\t\t\t\ttoType = TYPE_SYSTEM_UINT32;\ncilConvUInt32:\n\t\t\t\tconvOpOffset = JIT_CONV_OFFSET_U32;\n\t\t\t\tgoto cilConv;\n\t\t\tcase CIL_CONV_I8:\n\t\t\tcase CIL_CONV_OVF_I8: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_OVF_I8_UN: // Fix this later - will never overflow\n\t\t\t\ttoType = TYPE_SYSTEM_INT64;\n\t\t\t\tconvOpOffset = JIT_CONV_OFFSET_I64;\n\t\t\t\tgoto cilConv;\n\t\t\tcase CIL_CONV_U8:\n\t\t\tcase CIL_CONV_OVF_U8: // Fix this later - will never overflow\n\t\t\tcase CIL_CONV_OVF_U8_UN: // Fix this later - will never overflow\n\t\t\t\ttoType = TYPE_SYSTEM_UINT64;\n\t\t\t\tconvOpOffset = JIT_CONV_OFFSET_U64;\n\t\t\t\tgoto cilConv;\n\t\t\tcase CIL_CONV_R4:\n\t\t\t\ttoType = TYPE_SYSTEM_SINGLE;\n\t\t\t\tconvOpOffset = JIT_CONV_OFFSET_R32;\n\t\t\t\tgoto cilConv;\n\t\t\tcase CIL_CONV_R8:\n\t\t\tcase CIL_CONV_R_UN:\n\t\t\t\ttoType = TYPE_SYSTEM_DOUBLE;\n\t\t\t\tconvOpOffset = JIT_CONV_OFFSET_R64;\n\t\t\t\tgoto cilConv;\ncilConv:\n\t\t\t\tpStackType = PopStackType();\n\t\t\t\t{\n\t\t\t\t\tU32 opCodeBase;\n\t\t\t\t\tU32 useParam = 0, param;\n\t\t\t\t\t// This is the types that the conversion is from.\n\t\t\t\t\tswitch (pStackType->stackType) {\n\t\t\t\t\tcase EVALSTACK_INT64:\n\t\t\t\t\t\topCodeBase = (pStackType == types[TYPE_SYSTEM_INT64])?JIT_CONV_FROM_I64:JIT_CONV_FROM_U64;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EVALSTACK_INT32:\n\t\t\t\t\tcase EVALSTACK_PTR: // Only on 32-bit\n\t\t\t\t\t\topCodeBase =\n\t\t\t\t\t\t\t(pStackType == types[TYPE_SYSTEM_BYTE] ||\n\t\t\t\t\t\t\tpStackType == types[TYPE_SYSTEM_UINT16] ||\n\t\t\t\t\t\t\tpStackType == types[TYPE_SYSTEM_UINT32] ||\n\t\t\t\t\t\t\tpStackType == types[TYPE_SYSTEM_UINTPTR])?JIT_CONV_FROM_U32:JIT_CONV_FROM_I32;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EVALSTACK_F64:\n\t\t\t\t\t\topCodeBase = JIT_CONV_FROM_R64;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase EVALSTACK_F32:\n\t\t\t\t\t\topCodeBase = JIT_CONV_FROM_R32;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tCrash(\"JITit() Conv cannot handle stack type %d\", pStackType->stackType);\n\t\t\t\t\t}\n\t\t\t\t\t// This is the types that the conversion is to.\n\t\t\t\t\tswitch (convOpOffset) {\n\t\t\t\t\tcase JIT_CONV_OFFSET_I32:\n\t\t\t\t\t\tuseParam = 1;\n\t\t\t\t\t\tparam = 32 - toBitCount;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JIT_CONV_OFFSET_U32:\n\t\t\t\t\t\tuseParam = 1;\n\t\t\t\t\t\t// Next line is really (1 << toBitCount) - 1\n\t\t\t\t\t\t// But it's done like this to work when toBitCount == 32\n\t\t\t\t\t\tparam = (((1 << (toBitCount - 1)) - 1) << 1) + 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase JIT_CONV_OFFSET_I64:\n\t\t\t\t\tcase JIT_CONV_OFFSET_U64:\n\t\t\t\t\tcase JIT_CONV_OFFSET_R32:\n\t\t\t\t\tcase JIT_CONV_OFFSET_R64:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tCrash(\"JITit() Conv cannot handle convOpOffset %d\", convOpOffset);\n\t\t\t\t\t}\n\t\t\t\t\tPushOp(opCodeBase + convOpOffset);\n\t\t\t\t\tif (useParam) {\n\t\t\t\t\t\tPushU32(param);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tPushStackType(types[toType]);\n\t\t\t\tbreak;\n\t\t\t\t}\n\n#ifdef OLD_CONV\n\t\t\tcase CIL_CONV_OVF_I1:\n\t\t\tcase CIL_CONV_OVF_I2:\n\t\t\tcase CIL_CONV_OVF_I4:\n\t\t\t\tu32Value = TYPE_SYSTEM_INT32;\n\t\t\t\tgoto convOvf;\n\t\t\tcase CIL_CONV_OVF_I8:\n\t\t\t\tu32Value = TYPE_SYSTEM_INT64;\n\t\t\t\tgoto convOvf;\n\t\t\tcase CIL_CONV_OVF_U1:\n\t\t\tcase CIL_CONV_OVF_U2:\n\t\t\tcase CIL_CONV_OVF_U4:\n\t\t\t\tu32Value = TYPE_SYSTEM_UINT32;\n\t\t\t\tgoto convOvf;\n\t\t\tcase CIL_CONV_OVF_U8:\n\t\t\t\tu32Value = TYPE_SYSTEM_UINT64;\nconvOvf:\n\t\t\t\tpStackType = PopStackType();\n\t\t\t\tPushOpParam(JIT_CONV_OVF_I1 + (op - CIL_CONV_OVF_I1), pStackType->stackType);\n\t\t\t\tPushStackType(types[u32Value]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_CONV_I1:\n\t\t\tcase CIL_CONV_I2:\n\t\t\tcase CIL_CONV_I4:\n\t\t\t\tu32Value = TYPE_SYSTEM_INT32;\n\t\t\t\tgoto conv1;\n\t\t\tcase CIL_CONV_I8:\n\t\t\t\tu32Value = TYPE_SYSTEM_INT64;\n\t\t\t\tgoto conv1;\n\t\t\tcase CIL_CONV_R4:\n\t\t\t\tu32Value = TYPE_SYSTEM_SINGLE;\n\t\t\t\tgoto conv1;\n\t\t\tcase CIL_CONV_R8:\n\t\t\t\tu32Value = TYPE_SYSTEM_DOUBLE;\n\t\t\t\tgoto conv1;\n\t\t\tcase CIL_CONV_U4:\n\t\t\t\tu32Value = TYPE_SYSTEM_UINT32;\n\t\t\t\tgoto conv1;\n\t\t\tcase CIL_CONV_U8:\n\t\t\t\tu32Value = TYPE_SYSTEM_UINT64;\nconv1:\n\t\t\t\tpStackType = PopStackType();\n\t\t\t\tPushOpParam(JIT_CONV_I1 + (op - CIL_CONV_I1), pStackType->stackType);\n\t\t\t\tPushStackType(types[u32Value]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_CONV_U2:\n\t\t\tcase CIL_CONV_U1:\n\t\t\t\tu32Value = TYPE_SYSTEM_UINT32;\n\t\t\t\tgoto conv2;\n\t\t\tcase CIL_CONV_I:\n\t\t\t\tu32Value = TYPE_SYSTEM_INT32; // Only on 32-bit\nconv2:\n\t\t\t\tpStackType = PopStackType();\n\t\t\t\tPushOpParam(JIT_CONV_U2 + (op - CIL_CONV_U2), pStackType->stackType);\n\t\t\t\tPushStackType(types[u32Value]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_CONV_U:\n\t\t\t\tpStackType = PopStackType();\n\t\t\t\tPushOpParam(JIT_CONV_U_NATIVE, pStackType->stackType);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_UINTPTR]);\n\t\t\t\tbreak;\n#endif\n\n\t\t\tcase CIL_LDOBJ:\n\t\t\t\t{\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\tPopStackTypeDontCare(); // Don't care what this is\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tPushOp(JIT_LOADOBJECT);\n\t\t\t\t\tPushPTR(pTypeDef);\n\t\t\t\t\tPushStackType(pTypeDef);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_STOBJ:\n\t\t\t\t{\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tPopStackTypeMulti(2);\n\t\t\t\t\tif (pTypeDef->isValueType && pTypeDef->arrayElementSize != 4) {\n\t\t\t\t\t\t// If it's a value-type then do this\n\t\t\t\t\t\tPushOpParam(JIT_STORE_OBJECT_VALUETYPE, pTypeDef->arrayElementSize);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// If it's a ref type, or a value-type with size 4, then can do this instead\n\t\t\t\t\t\t// (it executes faster)\n\t\t\t\t\t\tPushOp(JIT_STOREINDIRECT_REF);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\tcase CIL_LDSTR:\n\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs) & 0x00ffffff;\n\t\t\t\tPushOpParam(JIT_LOAD_STRING, u32Value);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_STRING]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_NEWOBJ:\n\t\t\t\t{\n\t\t\t\t\ttMD_MethodDef *pConstructorDef;\n\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpConstructorDef = MetaData_GetMethodDefFromDefRefOrSpec(pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tif (pConstructorDef->isFilled == 0) {\n\t\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromMethodDef(pConstructorDef);\n\t\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t\t}\n\t\t\t\t\tif (pConstructorDef->pParentType->isValueType) {\n\t\t\t\t\t\tPushOp(JIT_NEWOBJECT_VALUETYPE);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPushOp(JIT_NEWOBJECT);\n\t\t\t\t\t}\n\t\t\t\t\t// -1 because the param count includes the 'this' parameter that is sent to the constructor\n\t\t\t\t\tPopStackTypeMulti(pConstructorDef->numberOfParameters - 1);\n\t\t\t\t\tPushPTR(pConstructorDef);\n\t\t\t\t\tPushStackType(pConstructorDef->pParentType);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_CASTCLASS:\n\t\t\t\t{\n\t\t\t\t\ttMD_TypeDef *pCastToType;\n\n\t\t\t\t\tPushOp(JIT_CAST_CLASS);\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpCastToType = MetaData_GetTypeDefFromDefRefOrSpec(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tPushPTR(pCastToType);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_ISINST:\n\t\t\t\t{\n\t\t\t\t\ttMD_TypeDef *pIsInstanceOfType;\n\n\t\t\t\t\tPushOp(JIT_IS_INSTANCE);\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpIsInstanceOfType = MetaData_GetTypeDefFromDefRefOrSpec(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tPushPTR(pIsInstanceOfType);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_NEWARR:\n\t\t\t\t{\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tPopStackTypeDontCare(); // Don't care what it is\n\t\t\t\t\tPushOp(JIT_NEW_VECTOR);\n\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t\tpTypeDef = Type_GetArrayTypeDef(pTypeDef, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tPushPTR(pTypeDef);\n\t\t\t\t\tPushStackType(pTypeDef);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDLEN:\n\t\t\t\tPopStackTypeDontCare(); // Don't care what it is\n\t\t\t\tPushOp(JIT_LOAD_VECTOR_LEN);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT32]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDELEM_I1:\n\t\t\tcase CIL_LDELEM_U1:\n\t\t\tcase CIL_LDELEM_I2:\n\t\t\tcase CIL_LDELEM_U2:\n\t\t\tcase CIL_LDELEM_I4:\n\t\t\tcase CIL_LDELEM_U4:\n\t\t\t\tPopStackTypeMulti(2); // Don't care what any of these are\n\t\t\t\tPushOp(JIT_LOAD_ELEMENT_I8 + (op - CIL_LDELEM_I1));\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT32]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDELEM_I8:\n\t\t\t\tPopStackTypeMulti(2); // Don't care what any of these are\n\t\t\t\tPushOp(JIT_LOAD_ELEMENT_I64);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT64]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDELEM_R4:\n\t\t\t\tPopStackTypeMulti(2); // Don't care what any of these are\n\t\t\t\tPushOp(JIT_LOAD_ELEMENT_R32);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_SINGLE]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDELEM_R8:\n\t\t\t\tPopStackTypeMulti(2); // Don't care what any of these are\n\t\t\t\tPushOp(JIT_LOAD_ELEMENT_R64);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_DOUBLE]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDELEM_REF:\n\t\t\t\tPopStackTypeMulti(2); // Don't care what any of these are\n\t\t\t\tPushOp(JIT_LOAD_ELEMENT_U32);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_OBJECT]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDELEM_ANY:\n\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\tpStackType = (tMD_TypeDef*)MetaData_GetTypeDefFromDefRefOrSpec(pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\tPopStackTypeMulti(2); // Don't care what these are\n\t\t\t\tPushOpParam(JIT_LOAD_ELEMENT, pStackType->stackSize);\n\t\t\t\tPushStackType(pStackType);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDELEMA:\n\t\t\t\tPopStackTypeMulti(2); // Don't care what any of these are\n\t\t\t\tGetUnalignedU32(pCIL, &cilOfs); // Don't care what this is\n\t\t\t\tPushOp(JIT_LOAD_ELEMENT_ADDR);\n\t\t\t\tPushStackType(types[TYPE_SYSTEM_INTPTR]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_STELEM_I1:\n\t\t\tcase CIL_STELEM_I2:\n\t\t\tcase CIL_STELEM_I4:\n\t\t\tcase CIL_STELEM_R4:\n\t\t\tcase CIL_STELEM_REF:\n\t\t\t\tPopStackTypeMulti(3); // Don't care what any of these are\n\t\t\t\tPushOp(JIT_STORE_ELEMENT_32);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_STELEM_I8:\n\t\t\tcase CIL_STELEM_R8:\n\t\t\t\tPopStackTypeMulti(3); // Don't care what any of these are\n\t\t\t\tPushOp(JIT_STORE_ELEMENT_64);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_STELEM_ANY:\n\t\t\t\tGetUnalignedU32(pCIL, &cilOfs); // Don't need this token, as the type stack will contain the same type\n\t\t\t\tpStackType = PopStackType(); // This is the type to store\n\t\t\t\tPopStackTypeMulti(2); // Don't care what these are\n\t\t\t\tPushOpParam(JIT_STORE_ELEMENT, pStackType->stackSize);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_STFLD:\n\t\t\t\t{\n\t\t\t\t\ttMD_FieldDef *pFieldDef;\n\n\t\t\t\t\t// Get the stack type of the value to store\n\t\t\t\t\tpStackType = PopStackType();\n\t\t\t\t\tPushOp(JIT_STOREFIELD_TYPEID + pStackType->stackType);\n\t\t\t\t\t// Get the FieldRef or FieldDef of the field to store\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpFieldDef = MetaData_GetFieldDefFromDefOrRef(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tPushPTR(pFieldDef);\n\t\t\t\t\t// Pop the object/valuetype on which to store the field. Don't care what it is\n\t\t\t\t\tPopStackTypeDontCare();\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDFLD:\n\t\t\t\t{\n\t\t\t\t\ttMD_FieldDef *pFieldDef;\n\n\t\t\t\t\t// Get the FieldRef or FieldDef of the field to load\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpFieldDef = MetaData_GetFieldDefFromDefOrRef(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\t// Pop the object/valuetype on which to load the field.\n\t\t\t\t\tpStackType = PopStackType();\n\t\t\t\t\tif (pStackType->stackType == EVALSTACK_VALUETYPE) {\n\t\t\t\t\t\tPushOpParam(JIT_LOADFIELD_VALUETYPE, pStackType->stackSize);\n\t\t\t\t\t\tPushPTR(pFieldDef);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (pFieldDef->memSize <= 4) {\n\t\t\t\t\t\t\tPushOp(JIT_LOADFIELD_4);\n\t\t\t\t\t\t\tPushU32(pFieldDef->memOffset);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tPushOp(JIT_LOADFIELD);\n\t\t\t\t\t\t\tPushPTR(pFieldDef);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Push the stack type of the just-read field\n\t\t\t\t\tPushStackType(pFieldDef->pType);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDFLDA:\n\t\t\t\t{\n\t\t\t\t\ttMD_FieldDef *pFieldDef;\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\t// Get the FieldRef or FieldDef of the field to load\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpFieldDef = MetaData_GetFieldDefFromDefOrRef(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\t// Sometimes, the type def will not have been filled, so ensure it's filled.\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromFieldDef(pFieldDef);\n\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t\tPopStackTypeDontCare(); // Don't care what it is\n\t\t\t\t\tPushOpParam(JIT_LOAD_FIELD_ADDR, pFieldDef->memOffset);\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INTPTR]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_STSFLD: // Store static field\n\t\t\t\t{\n\t\t\t\t\ttMD_FieldDef *pFieldDef;\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\t// Get the FieldRef or FieldDef of the static field to store\n\t\t\t\t\tPopStackTypeDontCare(); // Don't care what it is\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpFieldDef = MetaData_GetFieldDefFromDefOrRef(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\t// Sometimes, the type def will not have been filled, so ensure it's filled.\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromFieldDef(pFieldDef);\n\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t\tpStackType = pFieldDef->pType;\n\t\t\t\t\tPushOp(JIT_STORESTATICFIELD_TYPEID + pStackType->stackType);\n\t\t\t\t\tPushPTR(pFieldDef);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDSFLD: // Load static field\n\t\t\t\t{\n\t\t\t\t\ttMD_FieldDef *pFieldDef;\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\t// Get the FieldRef or FieldDef of the static field to load\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpFieldDef = MetaData_GetFieldDefFromDefOrRef(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\t// Sometimes, the type def will not have been filled, so ensure it's filled.\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromFieldDef(pFieldDef);\n\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t\tpStackType = pFieldDef->pType;\n\t\t\t\t\tPushOp(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + pStackType->stackType);\n\t\t\t\t\tPushPTR(pFieldDef);\n\t\t\t\t\tPushStackType(pStackType);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDSFLDA: // Load static field address\n\t\t\t\t{\n\t\t\t\t\ttMD_FieldDef *pFieldDef;\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\t// Get the FieldRef or FieldDef of the field to load\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpFieldDef = MetaData_GetFieldDefFromDefOrRef(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\t// Sometimes, the type def will not have been filled, so ensure it's filled.\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromFieldDef(pFieldDef);\n\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t\tPushOp(JIT_LOADSTATICFIELDADDRESS_CHECKTYPEINIT);\n\t\t\t\t\tPushPTR(pFieldDef);\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INTPTR]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_BOX:\n\t\t\t\t{\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\tpStackType = PopStackType();\n\t\t\t\t\t// Get the TypeDef(or Ref) token of the valuetype to box\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t\tif (pTypeDef->pGenericDefinition == types[TYPE_SYSTEM_NULLABLE]) {\n\t\t\t\t\t\t// This is a nullable type, so special boxing code is needed.\n\t\t\t\t\t\tPushOp(JIT_BOX_NULLABLE);\n\t\t\t\t\t\t// Push the underlying type of the nullable type, not the nullable type itself\n\t\t\t\t\t\tPushPTR(pTypeDef->ppClassTypeArgs[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPushOp(JIT_BOX_TYPEID + pStackType->stackType);\n\t\t\t\t\t\tPushPTR(pTypeDef);\n\t\t\t\t\t}\n\t\t\t\t\t// This is correct - cannot push underlying type, as then references are treated as value-types\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_OBJECT]);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_UNBOX_ANY:\n\t\t\t\t{\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\tPopStackTypeDontCare(); // Don't care what it is\n\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\tif (pTypeDef->pGenericDefinition == types[TYPE_SYSTEM_NULLABLE]) {\n\t\t\t\t\t\t// This is a nullable type, so special unboxing is required.\n\t\t\t\t\t\tPushOp(JIT_UNBOX_NULLABLE);\n\t\t\t\t\t\t// For nullable types, push the underlying type\n\t\t\t\t\t\tPushPTR(pTypeDef->ppClassTypeArgs[0]);\n\t\t\t\t\t} else if (pTypeDef->isValueType) {\n\t\t\t\t\t\tPushOp(JIT_UNBOX2VALUETYPE);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tPushOp(JIT_UNBOX2OBJECT);\n\t\t\t\t\t}\n\t\t\t\t\tPushStackType(pTypeDef);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LDTOKEN:\n\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\tpMem = MetaData_GetTypeMethodField(pMethodDef->pMetaData, u32Value, &u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\tPushOp(JIT_LOADTOKEN_BASE + u32Value);\n\t\t\t\tPushPTR(pMem);\n\t\t\t\tPushStackType(types[\n\t\t\t\t\t(u32Value==0)?TYPE_SYSTEM_RUNTIMETYPEHANDLE:\n\t\t\t\t\t\t((u32Value==1)?TYPE_SYSTEM_RUNTIMEFIELDHANDLE:TYPE_SYSTEM_RUNTIMEMETHODHANDLE)\n\t\t\t\t]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_THROW:\n\t\t\t\tPopStackTypeDontCare(); // Don't care what it is\n\t\t\t\tPushOp(JIT_THROW);\n\t\t\t\tRestoreTypeStack(&typeStack, ppTypeStacks[cilOfs]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_LEAVE_S:\n\t\t\t\tu32Value = (I8)pCIL[cilOfs++];\n\t\t\t\tgoto cilLeave;\n\n\t\t\tcase CIL_LEAVE:\n\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\ncilLeave:\n\t\t\t\t// Put a temporary CIL offset value into the JITted code. This will be updated later\n\t\t\t\tu32Value = cilOfs + (I32)u32Value;\n\t\t\t\tMayCopyTypeStack();\n\t\t\t\tRestoreTypeStack(&typeStack, ppTypeStacks[cilOfs]);\n\t\t\t\tPushOp(JIT_LEAVE);\n\t\t\t\tPushBranch();\n\t\t\t\tPushU32(u32Value);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_ENDFINALLY:\n\t\t\t\tPushOp(JIT_END_FINALLY);\n\t\t\t\tRestoreTypeStack(&typeStack, ppTypeStacks[cilOfs]);\n\t\t\t\tbreak;\n\n\t\t\tcase CIL_EXTENDED:\n\t\t\t\top = pCIL[cilOfs++];\n\n\t\t\t\tswitch (op)\n\t\t\t\t{\n\t\t\t\tcase CILX_INITOBJ:\n\t\t\t\t\t{\n\t\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\t\tPopStackTypeDontCare(); // Don't care what it is\n\t\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\t\tif (pTypeDef->isValueType) {\n\t\t\t\t\t\t\tPushOp(JIT_INIT_VALUETYPE);\n\t\t\t\t\t\t\tPushPTR(pTypeDef);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tPushOp(JIT_INIT_OBJECT);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CILX_LOADFUNCTION:\n\t\t\t\t\t{\n\t\t\t\t\t\ttMD_MethodDef *pFuncMethodDef;\n\n\t\t\t\t\t\tu32Value = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\t\tpFuncMethodDef = MetaData_GetMethodDefFromDefRefOrSpec(pMethodDef->pMetaData, u32Value, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\t\t\tPushOp(JIT_LOADFUNCTION);\n\t\t\t\t\t\tPushPTR(pFuncMethodDef);\n\t\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INTPTR]);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CILX_CEQ:\n\t\t\t\tcase CILX_CGT:\n\t\t\t\tcase CILX_CGT_UN:\n\t\t\t\tcase CILX_CLT:\n\t\t\t\tcase CILX_CLT_UN:\n\t\t\t\t\tpTypeB = PopStackType();\n\t\t\t\t\tpTypeA = PopStackType();\n\t\t\t\t\tif ((pTypeA->stackType == EVALSTACK_INT32 && pTypeB->stackType == EVALSTACK_INT32) ||\n\t\t\t\t\t\t(pTypeA->stackType == EVALSTACK_O && pTypeB->stackType == EVALSTACK_O) ||\n\t\t\t\t\t\t// Next line: only on 32-bit\n\t\t\t\t\t\t(pTypeA->stackType == EVALSTACK_PTR && pTypeB->stackType == EVALSTACK_PTR)) {\n\t\t\t\t\t\tPushOp(JIT_CEQ_I32I32 + (op - CILX_CEQ));\n\t\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_INT64 && pTypeB->stackType == EVALSTACK_INT64) {\n\t\t\t\t\t\tPushOp(JIT_CEQ_I64I64 + (op - CILX_CEQ));\n\t\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_F32 && pTypeB->stackType == EVALSTACK_F32) {\n\t\t\t\t\t\tPushOp(JIT_CEQ_F32F32 + (op - CILX_CEQ));\n\t\t\t\t\t} else if (pTypeA->stackType == EVALSTACK_F64 && pTypeB->stackType == EVALSTACK_F64) {\n\t\t\t\t\t\tPushOp(JIT_CEQ_F64F64 + (op - CILX_CEQ));\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCrash(\"JITit(): Cannot perform comparison operand on stack types: %s and %s\", pTypeA->name, pTypeB->name);\n\t\t\t\t\t}\n\t\t\t\t\tPushStackType(types[TYPE_SYSTEM_INT32]);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase CILX_RETHROW:\n\t\t\t\t\tPushOp(JIT_RETHROW);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CILX_CONSTRAINED:\n\t\t\t\t\tu32Value2 = GetUnalignedU32(pCIL, &cilOfs);\n\t\t\t\t\tcilOfs++;\n\t\t\t\t\tgoto cilCallVirtConstrained;\n\n\t\t\t\tcase CILX_READONLY:\n\t\t\t\t\t// Do nothing\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tCrash(\"JITit(): JITter cannot handle extended op-code:0x%02x\", op);\n\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tCrash(\"JITit(): JITter cannot handle op-code: 0x%02x\", op);\n\t\t}\n\n\t} while (cilOfs < codeSize);\n\n\t// Apply branch offset fixes\n\tfor (i=0; i<branchOffsets.ofs; i++) {\n\t\tU32 ofs, jumpTarget;\n\n\t\tofs = branchOffsets.p[i];\n\t\tjumpTarget = ops.p[ofs];\n\t\t// Rewrite the branch offset\n\t\tjumpTarget = pJITOffsets[jumpTarget];\n\t\tops.p[ofs] = jumpTarget;\n#ifdef GEN_COMBINED_OPCODES\n\t\tisDynamic.p[jumpTarget] |= DYNAMIC_JUMP_TARGET;\n#endif\n\t}\n\n\t// Apply expection handler offset fixes\n\tfor (i=0; i<pJITted->numExceptionHandlers; i++) {\n\t\ttExceptionHeader *pEx;\n\n\t\tpEx = &pJITted->pExceptionHeaders[i];\n\t\tpEx->tryEnd = pJITOffsets[pEx->tryStart + pEx->tryEnd];\n\t\tpEx->tryStart = pJITOffsets[pEx->tryStart];\n\t\tpEx->handlerEnd = pJITOffsets[pEx->handlerStart + pEx->handlerEnd];\n\t\tpEx->handlerStart = pJITOffsets[pEx->handlerStart];\n#ifdef GEN_COMBINED_OPCODES\n\t\tisDynamic.p[pEx->tryStart] |= DYNAMIC_EX_START | DYNAMIC_JUMP_TARGET;\n\t\tisDynamic.p[pEx->tryEnd] |= DYNAMIC_EX_END | DYNAMIC_JUMP_TARGET;\n\t\tisDynamic.p[pEx->handlerStart] |= DYNAMIC_EX_START | DYNAMIC_JUMP_TARGET;\n\t\tisDynamic.p[pEx->handlerEnd] |= DYNAMIC_EX_END | DYNAMIC_JUMP_TARGET;\n#endif\n\t}\n\n#ifdef GEN_COMBINED_OPCODES\n\t// Find any candidates for instruction combining\n\tif (genCombinedOpcodes) {\n\t\tU32 inst0 = 0;\n\t\twhile (inst0 < ops.ofs) {\n\t\t\tU32 opCodeCount = 0;\n\t\t\tU32 instCount = 0;\n\t\t\tU32 shrinkOpsBy;\n\t\t\tU32 isFirstInst;\n\t\t\twhile (!(isDynamic.p[inst0] & DYNAMIC_OK)) {\n\t\t\t\tinst0++;\n\t\t\t\tif (inst0 >= ops.ofs) {\n\t\t\t\t\tgoto combineDone;\n\t\t\t\t}\n\t\t\t}\n\t\t\tisFirstInst = 1;\n\t\t\twhile (isDynamic.p[inst0 + instCount] & DYNAMIC_OK) {\n\t\t\t\tif (isFirstInst) {\n\t\t\t\t\tisFirstInst = 0;\n\t\t\t\t} else {\n\t\t\t\t\tif (isDynamic.p[inst0 + instCount] & DYNAMIC_JUMP_TARGET) {\n\t\t\t\t\t\t// Cannot span a jump target\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tinstCount += 1 + ((isDynamic.p[inst0 + instCount] & DYNAMIC_BYTE_COUNT_MASK) >> 2);\n\t\t\t\topCodeCount++;\n\t\t\t}\n\t\t\tshrinkOpsBy = 0;\n\t\t\tif (opCodeCount > 1) {\n\t\t\t\tU32 combinedSize;\n\t\t\t\ttCombinedOpcodesMem *pCOMem = TMALLOC(tCombinedOpcodesMem);\n\t\t\t\tshrinkOpsBy = GenCombined(&ops, &isDynamic, inst0, instCount, &combinedSize, &pCOMem->pMem);\n\t\t\t\tpCOMem->pNext = pJITted->pCombinedOpcodesMem;\n\t\t\t\tpJITted->pCombinedOpcodesMem = pCOMem;\n\t\t\t\tpJITted->opsMemSize += combinedSize;\n\t\t\t\tmemmove(&ops.p[inst0 + instCount - shrinkOpsBy], &ops.p[inst0 + instCount], (ops.ofs - inst0 - instCount) << 2);\n\t\t\t\tmemmove(&isDynamic.p[inst0 + instCount - shrinkOpsBy], &isDynamic.p[inst0 + instCount], (ops.ofs - inst0 - instCount) << 2);\n\t\t\t\tops.ofs -= shrinkOpsBy;\n\t\t\t\tisDynamic.ofs -= shrinkOpsBy;\n\t\t\t\tfor (i=0; i<branchOffsets.ofs; i++) {\n\t\t\t\t\tU32 ofs;\n\t\t\t\t\tif (branchOffsets.p[i] > inst0) {\n\t\t\t\t\t\tbranchOffsets.p[i] -= shrinkOpsBy;\n\t\t\t\t\t}\n\t\t\t\t\tofs = branchOffsets.p[i];\n\t\t\t\t\tif (ops.p[ofs] > inst0) {\n\t\t\t\t\t\tops.p[ofs] -= shrinkOpsBy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (i=0; i<pJITted->numExceptionHandlers; i++) {\n\t\t\t\t\ttExceptionHeader *pEx;\n\n\t\t\t\t\tpEx = &pJITted->pExceptionHeaders[i];\n\t\t\t\t\tif (pEx->tryStart > inst0) {\n\t\t\t\t\t\tpEx->tryStart -= shrinkOpsBy;\n\t\t\t\t\t}\n\t\t\t\t\tif (pEx->tryEnd > inst0) {\n\t\t\t\t\t\tpEx->tryEnd -= shrinkOpsBy;\n\t\t\t\t\t}\n\t\t\t\t\tif (pEx->handlerStart > inst0) {\n\t\t\t\t\t\tpEx->handlerStart -= shrinkOpsBy;\n\t\t\t\t\t}\n\t\t\t\t\tif (pEx->handlerEnd > inst0) {\n\t\t\t\t\t\tpEx->handlerEnd -= shrinkOpsBy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tinst0 += instCount - shrinkOpsBy;\n\t\t}\n\t}\ncombineDone:\n#endif\n\n\t// Change maxStack to indicate the number of bytes needed on the evaluation stack.\n\t// This is the largest number of bytes needed by all objects/value-types on the stack,\n\tpJITted->maxStack = typeStack.maxBytes;\n\n\tfree(typeStack.ppTypes);\n\n\tfor (i=0; i<codeSize; i++) {\n\t\tif (ppTypeStacks[i] != NULL) {\n\t\t\tfree(ppTypeStacks[i]->ppTypes);\n\t\t}\n\t}\n\tfree(ppTypeStacks);\n\n\tDeleteOps(branchOffsets);\n\tfree(pJITOffsets);\n\n\t// Copy ops to some memory of exactly the correct size. To not waste memory.\n\tu32Value = ops.ofs * sizeof(U32);\n\tpFinalOps = genCombinedOpcodes?malloc(u32Value):mallocForever(u32Value);\n\tmemcpy(pFinalOps, ops.p, u32Value);\n\tDeleteOps(ops);\n#ifdef GEN_COMBINED_OPCODES\n\tpJITted->opsMemSize += u32Value;\n\tDeleteOps(isDynamic);\n#endif\n\n\treturn pFinalOps;\n}\n\n// Prepare a method for execution\n// This makes sure that the method has been JITed.\nvoid JIT_Prepare(tMD_MethodDef *pMethodDef, U32 genCombinedOpcodes) {\n\ttMetaData *pMetaData;\n\tU8 *pMethodHeader;\n\ttJITted *pJITted;\n\tFLAGS16 flags;\n\tU32 codeSize;\n\tIDX_TABLE localsToken;\n\tU8 *pCIL;\n\tSIG sig;\n\tU32 i, sigLength, numLocals;\n\ttParameter *pLocals;\n\n\tlog_f(2, \"JIT:   %s\\n\", Sys_GetMethodDesc(pMethodDef));\n\n\tpMetaData = pMethodDef->pMetaData;\n\tpJITted = (genCombinedOpcodes)?TMALLOC(tJITted):TMALLOCFOREVER(tJITted);\n#ifdef GEN_COMBINED_OPCODES\n\tpJITted->pCombinedOpcodesMem = NULL;\n\tpJITted->opsMemSize = 0;\n\tif (genCombinedOpcodes) {\n\t\tpMethodDef->pJITtedCombined = pJITted;\n\t} else {\n\t\tpMethodDef->pJITted = pJITted;\n\t}\n#else\n\tpMethodDef->pJITted = pJITted;\n#endif\n\n\tif ((pMethodDef->implFlags & METHODIMPLATTRIBUTES_INTERNALCALL) ||\n\t\t((pMethodDef->implFlags & METHODIMPLATTRIBUTES_CODETYPE_MASK) == METHODIMPLATTRIBUTES_CODETYPE_RUNTIME)) {\n\t\ttJITCallNative *pCallNative;\n\n\t\t// Internal call\n\t\tif (strcmp(pMethodDef->name, \".ctor\") == 0) {\n\t\t\t// Internal constructor needs enough evaluation stack space to return itself\n\t\t\tpJITted->maxStack = pMethodDef->pParentType->stackSize;\n\t\t} else {\n\t\t\tpJITted->maxStack = (pMethodDef->pReturnType == NULL)?0:pMethodDef->pReturnType->stackSize; // For return value\n\t\t}\n\t\tpCallNative = TMALLOCFOREVER(tJITCallNative);\n\t\tpCallNative->opCode = Translate(JIT_CALL_NATIVE, 0);\n\t\tpCallNative->pMethodDef = pMethodDef;\n\t\tpCallNative->fn = InternalCall_Map(pMethodDef);\n\t\tpCallNative->retOpCode = Translate(JIT_RETURN, 0);\n\n\t\tpJITted->localsStackSize = 0;\n\t\tpJITted->pOps = (U32*)pCallNative;\n\n\t\treturn;\n\t}\n\tif (pMethodDef->flags & METHODATTRIBUTES_PINVOKEIMPL) {\n\t\ttJITCallPInvoke *pCallPInvoke;\n\n\t\t// PInvoke call\n\t\ttMD_ImplMap *pImplMap = MetaData_GetImplMap(pMetaData, pMethodDef->tableIndex);\n\t\tfnPInvoke fn = PInvoke_GetFunction(pMetaData, pImplMap);\n\t\tif (fn == NULL) {\n\t\t\tCrash(\"PInvoke library or function not found: %s()\", pImplMap->importName);\n\t\t}\n\n\t\tpCallPInvoke = TMALLOCFOREVER(tJITCallPInvoke);\n\t\tpCallPInvoke->opCode = Translate(JIT_CALL_PINVOKE, 0);\n\t\tpCallPInvoke->fn = fn;\n\t\tpCallPInvoke->pMethod = pMethodDef;\n\t\tpCallPInvoke->pImplMap = pImplMap;\n\n\t\tpJITted->localsStackSize = 0;\n\t\tpJITted->maxStack = (pMethodDef->pReturnType == NULL)?0:pMethodDef->pReturnType->stackSize; // For return value\n\t\tpJITted->pOps = (U32*)pCallPInvoke;\n\n\t\treturn;\n\t}\n\n\tpMethodHeader = (U8*)pMethodDef->pCIL;\n\tif ((*pMethodHeader & 0x3) == CorILMethod_TinyFormat) {\n\t\t// Tiny header\n\t\tflags = *pMethodHeader & 0x3;\n\t\tpJITted->maxStack = 8;\n\t\tcodeSize = (*pMethodHeader & 0xfc) >> 2;\n\t\tlocalsToken = 0;\n\t\tpCIL = pMethodHeader + 1;\n\t} else {\n\t\t// Fat header\n\t\tflags = *(U16*)pMethodHeader & 0x0fff;\n\t\tpJITted->maxStack = *(U16*)&pMethodHeader[2];\n\t\tcodeSize = *(U32*)&pMethodHeader[4];\n\t\tlocalsToken = *(IDX_TABLE*)&pMethodHeader[8];\n\t\tpCIL = pMethodHeader + ((pMethodHeader[1] & 0xf0) >> 2);\n\t}\n\tif (flags & CorILMethod_MoreSects) {\n\t\tU32 numClauses;\n\n\t\tpMethodHeader = pCIL + ((codeSize + 3) & (~0x3));\n\t\tif (*pMethodHeader & CorILMethod_Sect_FatFormat) {\n\t\t\tU32 exSize;\n\t\t\t// Fat header\n\t\t\tnumClauses = ((*(U32*)pMethodHeader >> 8) - 4) / 24;\n\t\t\t//pJITted->pExceptionHeaders = (tExceptionHeader*)(pMethodHeader + 4);\n\t\t\texSize = numClauses * sizeof(tExceptionHeader);\n\t\t\tpJITted->pExceptionHeaders =\n\t\t\t\t(tExceptionHeader*)(genCombinedOpcodes?malloc(exSize):mallocForever(exSize));\n\t\t\tmemcpy(pJITted->pExceptionHeaders, pMethodHeader + 4, exSize);\n\t\t} else {\n\t\t\t// Thin header\n\t\t\ttExceptionHeader *pExHeaders;\n\t\t\tU32 exSize;\n\n\t\t\tnumClauses = (((U8*)pMethodHeader)[1] - 4) / 12;\n\t\t\texSize = numClauses * sizeof(tExceptionHeader);\n\t\t\tpMethodHeader += 4;\n\t\t\t//pExHeaders = pJITted->pExceptionHeaders = (tExceptionHeader*)mallocForever(numClauses * sizeof(tExceptionHeader));\n\t\t\tpExHeaders = pJITted->pExceptionHeaders =\n\t\t\t\t(tExceptionHeader*)(genCombinedOpcodes?malloc(exSize):mallocForever(exSize));\n\t\t\tfor (i=0; i<numClauses; i++) {\n\t\t\t\tpExHeaders[i].flags = ((U16*)pMethodHeader)[0];\n\t\t\t\tpExHeaders[i].tryStart = ((U16*)pMethodHeader)[1];\n\t\t\t\tpExHeaders[i].tryEnd = ((U8*)pMethodHeader)[4];\n\t\t\t\tpExHeaders[i].handlerStart = ((U8*)pMethodHeader)[5] | (((U8*)pMethodHeader)[6] << 8);\n\t\t\t\tpExHeaders[i].handlerEnd = ((U8*)pMethodHeader)[7];\n\t\t\t\tpExHeaders[i].u.classToken = ((U32*)pMethodHeader)[2];\n\n\t\t\t\tpMethodHeader += 12;\n\t\t\t}\n\t\t}\n\t\tpJITted->numExceptionHandlers = numClauses;\n\t\t// replace all classToken's with the actual tMD_TypeDef*\n\t\tfor (i=0; i<numClauses; i++) {\n\t\t\tif (pJITted->pExceptionHeaders[i].flags == COR_ILEXCEPTION_CLAUSE_EXCEPTION) {\n\t\t\t\tpJITted->pExceptionHeaders[i].u.pCatchTypeDef =\n\t\t\t\t\tMetaData_GetTypeDefFromDefRefOrSpec(pMethodDef->pMetaData, pJITted->pExceptionHeaders[i].u.classToken, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tpJITted->numExceptionHandlers = 0;\n\t\tpJITted->pExceptionHeaders = NULL;\n\t}\n\n\t// Analyse the locals\n\tif (localsToken == 0) {\n\t\t// No locals\n\t\tpJITted->localsStackSize = 0;\n\t\tpLocals = NULL;\n\t} else {\n\t\ttMD_StandAloneSig *pStandAloneSig;\n\t\tU32 i, totalSize;\n\n\t\tpStandAloneSig = (tMD_StandAloneSig*)MetaData_GetTableRow(pMethodDef->pMetaData, localsToken);\n\t\tsig = MetaData_GetBlob(pStandAloneSig->signature, &sigLength);\n\t\tMetaData_DecodeSigEntry(&sig); // Always 0x07\n\t\tnumLocals = MetaData_DecodeSigEntry(&sig);\n\t\tpLocals = (tParameter*)malloc(numLocals * sizeof(tParameter));\n\t\ttotalSize = 0;\n\t\tfor (i=0; i<numLocals; i++) {\n\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\tpTypeDef = Type_GetTypeFromSig(pMethodDef->pMetaData, &sig, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\tpLocals[i].pTypeDef = pTypeDef;\n\t\t\tpLocals[i].offset = totalSize;\n\t\t\tpLocals[i].size = pTypeDef->stackSize;\n\t\t\ttotalSize += pTypeDef->stackSize;\n\t\t}\n\t\tpJITted->localsStackSize = totalSize;\n\t}\n\n\t// JIT the CIL code\n\tpJITted->pOps = JITit(pMethodDef, pCIL, codeSize, pLocals, pJITted, genCombinedOpcodes);\n\n\tfree(pLocals);\n}"
  },
  {
    "path": "dna/JIT.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined (__JIT_H)\n#define __JIT_H\n\ntypedef struct tJITted_ tJITted;\ntypedef struct tExceptionHeader_ tExceptionHeader;\n\n#include \"Types.h\"\n\n#ifdef GEN_COMBINED_OPCODES\ntypedef struct tCombinedOpcodesMem_ tCombinedOpcodesMem;\nstruct tCombinedOpcodesMem_ {\n\tvoid *pMem;\n\ttCombinedOpcodesMem *pNext;\n};\n#endif\n\nstruct tJITted_ {\n\t// The JITted opcodes\n\tU32 *pOps;\n\t// The maximum size of the evaluation stack\n\tU32 maxStack;\n\t// The required size of the locals stack\n\tU32 localsStackSize;\n\t// Number of exception handler headers\n\tU32 numExceptionHandlers;\n\t// Pointer to the exception handler headers (NULL if none)\n\ttExceptionHeader *pExceptionHeaders;\n#ifdef GEN_COMBINED_OPCODES\n\t// The number of bytes used by this JITted method - to include ALL bytes:\n\t// The size of the opcodes, plus the size of the combined opcodes.\n\tU32 opsMemSize;\n\t// Store all memory used to store combined opcodes, so they can be free()d later\n\ttCombinedOpcodesMem *pCombinedOpcodesMem;\n#endif\n};\n\n#include \"MetaDataTables.h\"\n#include \"Thread.h\"\n\n#define COR_ILEXCEPTION_CLAUSE_EXCEPTION 0\n#define COR_ILEXCEPTION_CLAUSE_FINALLY 2\n\nstruct tExceptionHeader_ {\n\tU32 flags;\n\tU32 tryStart;\n\tU32 tryEnd;\n\tU32 handlerStart;\n\tU32 handlerEnd;\n\tunion {\n\t\t// Class token for type-based exception handler\n\t\tIDX_TABLE classToken;\n\t\t// Filter code offset for filter-based exception handler (not supported)\n\t\tU32 filterOffset;\n\t\t// The TypeDef of the catch type\n\t\ttMD_TypeDef *pCatchTypeDef;\n\t} u;\n};\n\ntypedef struct tJITCallNative_ tJITCallNative;\nstruct tJITCallNative_ {\n\tU32 opCode;\n\t// The method meta-data\n\ttMD_MethodDef *pMethodDef;\n\t// the native pointer to the function\n\tfnInternalCall fn;\n\t// The RET instruction. This is needed when the native function has blocking IO or sleep\n\tU32 retOpCode;\n};\n\ntypedef struct tJITCallPInvoke_ tJITCallPInvoke;\nstruct tJITCallPInvoke_ {\n\tU32 opCode;\n\t// The native function to call - type should be fnPInvoke, but there's a problem with #including PInvoke.h\n\tvoid* fn;\n\t// The method that is being called\n\ttMD_MethodDef *pMethod;\n\t// The ImplMap of the function that's being called\n\ttMD_ImplMap *pImplMap;\n};\n\ntypedef struct tJITCodeInfo_ {\n\t// The beginning and end of the actual native code to run the JIT opcode.\n\tvoid *pStart;\n\tvoid *pEnd;\n\tU32 isDynamic;\n} tJITCodeInfo;\n\n#include \"JIT_OpCodes.h\"\n\nextern tJITCodeInfo jitCodeInfo[JIT_OPCODE_MAXNUM];\nextern tJITCodeInfo jitCodeGoNext;\n\nvoid JIT_Execute_Init();\n\n//void JIT_Prepare(tMD_MethodDef *pMethodDef);\nvoid JIT_Prepare(tMD_MethodDef *pMethodDef, U32 genCombinedOpcodes);\n\nU32 JIT_Execute(tThread *pThread, U32 numInst);\n\n#ifdef DIAG_OPCODE_TIMES\n#include \"JIT_OpCodes.h\"\nextern U64 opcodeTimes[JIT_OPCODE_MAXNUM];\n#endif\n\n#ifdef DIAG_OPCODE_USE\n#include \"JIT_OpCodes.h\"\nextern U32 opcodeNumUses[JIT_OPCODE_MAXNUM];\n#endif\n\n#endif"
  },
  {
    "path": "dna/JIT_Execute.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"JIT.h\"\n\n#include \"JIT_OpCodes.h\"\n#include \"MetaData.h\"\n#include \"MetaDataTables.h\"\n#include \"Heap.h\"\n#include \"Type.h\"\n#include \"MethodState.h\"\n#include \"Finalizer.h\"\n#include \"Delegate.h\"\n#include \"PInvoke.h\"\n\n#include \"System.String.h\"\n#include \"System.Array.h\"\n\n// Global array which stores the absolute addresses of the start and end of all JIT code\n// fragment machine code.\ntJITCodeInfo jitCodeInfo[JIT_OPCODE_MAXNUM];\ntJITCodeInfo jitCodeGoNext;\n\n// Get the next op-code\n#define GET_OP() *(pCurOp++)\n\n// Push a PTR value on the top of the stack\n#define PUSH_PTR(ptr) *(PTR*)pCurEvalStack = (PTR)(ptr); pCurEvalStack += sizeof(void*)\n// Push an arbitrarily-sized value-type onto the top of the stack\n#define PUSH_VALUETYPE(ptr, valueSize, stackInc) memcpy(pCurEvalStack, ptr, valueSize); pCurEvalStack += stackInc\n// Push a U32 value on the top of the stack\n#define PUSH_U32(value) *(U32*)pCurEvalStack = (U32)(value); pCurEvalStack += 4\n// Push a U64 value on the top of the stack\n#define PUSH_U64(value) *(U64*)pCurEvalStack = (U64)(value); pCurEvalStack += 8\n// Push a float value on the top of the stack\n#define PUSH_FLOAT(value) *(float*)pCurEvalStack = (float)(value); pCurEvalStack += 4;\n// Push a double value on the top of the stack\n#define PUSH_DOUBLE(value) *(double*)pCurEvalStack = (double)(value); pCurEvalStack += 8;\n// Push a 4-byte heap pointer on to the top of the stack\n#define PUSH_O(pHeap) *(void**)pCurEvalStack = (void*)(pHeap); pCurEvalStack += sizeof(void*)\n// DUP4() duplicates the top 4 bytes on the eval stack\n#define DUP4() *(U32*)pCurEvalStack = *(U32*)(pCurEvalStack - 4); pCurEvalStack += 4\n// DUP8() duplicates the top 4 bytes on the eval stack\n#define DUP8() *(U64*)pCurEvalStack = *(U64*)(pCurEvalStack - 8); pCurEvalStack += 8\n// DUP() duplicates numBytes bytes from the top of the stack\n#define DUP(numBytes) memcpy(pCurEvalStack, pCurEvalStack - numBytes, numBytes); pCurEvalStack += numBytes\n// Pop a U32 value from the stack\n#define POP_U32() (*(U32*)(pCurEvalStack -= 4))\n// Pop a U64 value from the stack\n#define POP_U64() (*(U64*)(pCurEvalStack -= 8))\n// Pop a float value from the stack\n#define POP_FLOAT() (*(float*)(pCurEvalStack -= 4))\n// Pop a double value from the stack\n#define POP_DOUBLE() (*(double*)(pCurEvalStack -= 8))\n// Pop 2 U32's from the stack\n#define POP_U32_U32(v1,v2) pCurEvalStack -= 8; v1 = *(U32*)pCurEvalStack; v2 = *(U32*)(pCurEvalStack + 4)\n// Pop 2 U64's from the stack\n#define POP_U64_U64(v1,v2) pCurEvalStack -= 16; v1 = *(U64*)pCurEvalStack; v2 = *(U64*)(pCurEvalStack + 8)\n// Pop 2 F32's from the stack\n#define POP_F32_F32(v1,v2) pCurEvalStack -= 8; v1 = *(float*)pCurEvalStack; v2 = *(float*)(pCurEvalStack + 4)\n// Pop 2 F64's from the stack\n#define POP_F64_F64(v1,v2) pCurEvalStack -= 16; v1 = *(double*)pCurEvalStack; v2 = *(double*)(pCurEvalStack + 8)\n// Pop a PTR value from the stack\n#define POP_PTR() (*(PTR*)(pCurEvalStack -= sizeof(void*)))\n// Pop an arbitrarily-sized value-type from the stack (copies it to the specified memory location)\n#define POP_VALUETYPE(ptr, valueSize, stackDec) memcpy(ptr, pCurEvalStack -= stackDec, valueSize)\n// Pop a Object (heap) pointer value from the stack\n#define POP_O() (*(HEAP_PTR*)(pCurEvalStack -= 4))\n// POP() returns nothing - it just alters the stack offset correctly\n#define POP(numBytes) pCurEvalStack -= numBytes\n// POP_ALL() empties the evaluation stack\n#define POP_ALL() pCurEvalStack = pCurrentMethodState->pEvalStack\n\n#define STACK_ADDR(type) *(type*)(pCurEvalStack - sizeof(type))\n// General binary ops\n#define BINARY_OP(returnType, type1, type2, op) \\\n\tpCurEvalStack -= sizeof(type1) + sizeof(type2) - sizeof(returnType); \\\n\t*(returnType*)(pCurEvalStack - sizeof(returnType)) = \\\n\t*(type1*)(pCurEvalStack - sizeof(returnType)) op \\\n\t*(type2*)(pCurEvalStack - sizeof(returnType) + sizeof(type1))\n// General unary ops\n#define UNARY_OP(type, op) STACK_ADDR(type) = op STACK_ADDR(type)\n\n// Set the new method state (for use when the method state changes - in calls mainly)\n#define SAVE_METHOD_STATE() \\\n\tpCurrentMethodState->stackOfs = (U32)(pCurEvalStack - pCurrentMethodState->pEvalStack); \\\n\tpCurrentMethodState->ipOffset = (U32)(pCurOp - pOps)\n\n#define LOAD_METHOD_STATE() \\\n\tpCurrentMethodState = pThread->pCurrentMethodState; \\\n\tpParamsLocals = pCurrentMethodState->pParamsLocals; \\\n\tpCurEvalStack = pCurrentMethodState->pEvalStack + pCurrentMethodState->stackOfs; \\\n\tpJIT = pCurrentMethodState->pJIT; \\\n\tpOps = pJIT->pOps; \\\n\tpCurOp = pOps + pCurrentMethodState->ipOffset\n\n#define CHANGE_METHOD_STATE(pNewMethodState) \\\n\tSAVE_METHOD_STATE(); \\\n\tpThread->pCurrentMethodState = pNewMethodState; \\\n\tLOAD_METHOD_STATE()\n\n// Easy access to method parameters and local variables\n#define PARAMLOCAL_U32(offset) *(U32*)(pParamsLocals + offset)\n#define PARAMLOCAL_U64(offset) *(U64*)(pParamsLocals + offset)\n\n#define THROW(exType) heapPtr = Heap_AllocType(exType); goto throwHeapPtr\n\n// Note: newObj is only set if a constructor is being called\nstatic void CreateParameters(PTR pParamsLocals, tMD_MethodDef *pCallMethod, PTR *ppCurEvalStack, HEAP_PTR newObj) {\n\tU32 ofs;\n\n\tif (newObj != NULL) {\n\t\t// If this is being called from JIT_NEW_OBJECT then need to specially push the new object\n\t\t// onto parameter stack position 0\n\t\t*(HEAP_PTR*)pParamsLocals = newObj;\n\t\tofs = 4;\n\t} else {\n\t\tofs = 0;\n\t}\n\t*ppCurEvalStack -= pCallMethod->parameterStackSize - ofs;\n\tmemcpy(pParamsLocals + ofs, *ppCurEvalStack, pCallMethod->parameterStackSize - ofs);\n}\n\nstatic tMethodState* RunFinalizer(tThread *pThread) {\n\tHEAP_PTR heapPtr = GetNextFinalizer();\n\tif (heapPtr != NULL) {\n\t\t// There is a pending finalizer, so create a MethodState for it and put it as next-to-run on the stack\n\t\ttMethodState *pFinalizerMethodState;\n\t\ttMD_TypeDef *pFinalizerType = Heap_GetType(heapPtr);\n\n\t\tpFinalizerMethodState = MethodState_Direct(pThread, pFinalizerType->pFinalizer, pThread->pCurrentMethodState, 0);\n\t\t// Mark this methodState as a Finalizer\n\t\tpFinalizerMethodState->finalizerThis = heapPtr;\n\t\t// Put the object on the stack (the object that is being Finalized)\n\t\t// Finalizers always have no parameters\n\t\t*(HEAP_PTR*)(pFinalizerMethodState->pParamsLocals) = heapPtr;\n\t\t//printf(\"--- FINALIZE ---\\n\");\n\n\t\treturn pFinalizerMethodState;\n\t}\n\treturn NULL;\n}\n\n#ifdef DIAG_OPCODE_TIMES\nU64 opcodeTimes[JIT_OPCODE_MAXNUM];\nstatic __inline unsigned __int64 __cdecl rdtsc() {\n\t__asm {\n\t\trdtsc\n\t}\n}\n#endif\n\n#ifdef DIAG_OPCODE_USE\nU32 opcodeNumUses[JIT_OPCODE_MAXNUM];\n\n#define OPCODE_USE(op) opcodeNumUses[op]++;\n\n#else\n\n#define OPCODE_USE(op)\n\n#endif\n\n#ifdef __GNUC__\n\n#define GET_LABEL(var, label) var = &&label\n\n#define GO_NEXT() goto **(void**)(pCurOp++)\n\n#else\n#ifdef WIN32\n\n#define GET_LABEL(var, label) \\\n\t{ __asm mov edi, label \\\n\t__asm mov var, edi }\n\n#define GO_NEXT() \\\n\t{ __asm mov edi, pCurOp \\\n\t__asm add edi, 4 \\\n\t__asm mov pCurOp, edi \\\n\t__asm jmp DWORD PTR [edi - 4] }\n\n#endif\n#endif\n\n#define GO_NEXT_CHECK() \\\n\tif (--numInst == 0) goto done; \\\n\tGO_NEXT()\n\n#define GET_LABELS(op) \\\n\tGET_LABEL(pAddr, op##_start); \\\n\tjitCodeInfo[op].pStart = pAddr; \\\n\tGET_LABEL(pAddr, op##_end); \\\n\tjitCodeInfo[op].pEnd = pAddr; \\\n\tjitCodeInfo[op].isDynamic = 0\n\n#define GET_LABELS_DYNAMIC(op, extraBytes) \\\n\tGET_LABEL(pAddr, op##_start); \\\n\tjitCodeInfo[op].pStart = pAddr; \\\n\tGET_LABEL(pAddr, op##_end); \\\n\tjitCodeInfo[op].pEnd = pAddr; \\\n\tjitCodeInfo[op].isDynamic = 0x100 | (extraBytes & 0xff)\n\n#define RUN_FINALIZER() {tMethodState *pMS = RunFinalizer(pThread);if(pMS) {CHANGE_METHOD_STATE(pMS);}}\n\nU32 JIT_Execute(tThread *pThread, U32 numInst) {\n\ttJITted *pJIT;\n\ttMethodState *pCurrentMethodState;\n\tPTR pParamsLocals;\n\n\t// Local copies of thread state variables, to speed up execution\n\t// Pointer to next op-code\n\tU32 *pOps;\n\tregister U32 *pCurOp;\n\t// Pointer to eval-stack position\n\tregister PTR pCurEvalStack;\n\tPTR pTempPtr;\n\n\tU32 op;\n\t// General purpose variables\n\t//I32 i32Value;\n\tU32 u32Value; //, u32Value2;\n\t//U64 u64Value;\n\t//double dValue;\n\t//float fValue;\n\t//uConvDouble convDouble;\n\tU32 ofs;\n\tHEAP_PTR heapPtr;\n\tPTR pMem;\n\n\tif (pThread == NULL) {\n\t\tvoid *pAddr;\n\t\t// Special case to get all the label addresses\n\t\t// Default all op-codes to noCode.\n\t\tGET_LABEL(pAddr, noCode);\n\t\tfor (u32Value = 0; u32Value < JIT_OPCODE_MAXNUM; u32Value++) {\n\t\t\tjitCodeInfo[u32Value].pStart = pAddr;\n\t\t\tjitCodeInfo[u32Value].pEnd = NULL;\n\t\t\tjitCodeInfo[u32Value].isDynamic = 0;\n\t\t}\n\n\t\t// Get GoNext code\n\t\tGET_LABEL(jitCodeGoNext.pStart, JIT_GoNext_start);\n\t\tGET_LABEL(jitCodeGoNext.pEnd, JIT_GoNext_end);\n\t\tjitCodeGoNext.isDynamic = 0;\n\n\t\t// Get all defined opcodes\n\t\tGET_LABELS_DYNAMIC(JIT_NOP, 0);\n\t\tGET_LABELS(JIT_RETURN);\n\t\tGET_LABELS_DYNAMIC(JIT_LOAD_I32, 4);\n\t\tGET_LABELS(JIT_BRANCH);\n\t\tGET_LABELS(JIT_LOAD_STRING);\n\t\tGET_LABELS(JIT_CALLVIRT_O);\n\t\tGET_LABELS(JIT_CALL_NATIVE);\n\t\tGET_LABELS(JIT_CALL_O);\n\t\tGET_LABELS(JIT_NEWOBJECT);\n\t\tGET_LABELS(JIT_LOAD_PARAMLOCAL_ADDR);\n\t\tGET_LABELS(JIT_CALL_PTR);\n\t\tGET_LABELS(JIT_BOX_CALLVIRT);\n\t\tGET_LABELS(JIT_INIT_VALUETYPE);\n\t\tGET_LABELS(JIT_NEW_VECTOR);\n\t\tGET_LABELS(JIT_NEWOBJECT_VALUETYPE);\n\t\tGET_LABELS(JIT_IS_INSTANCE);\n\t\tGET_LABELS(JIT_LOAD_NULL);\n\t\tGET_LABELS(JIT_UNBOX2VALUETYPE);\n\t\tGET_LABELS(JIT_UNBOX2OBJECT);\n\t\tGET_LABELS(JIT_LOAD_FIELD_ADDR);\n\t\tGET_LABELS(JIT_DUP_GENERAL);\n\t\tGET_LABELS_DYNAMIC(JIT_POP, 4);\n\t\tGET_LABELS(JIT_STORE_OBJECT_VALUETYPE);\n\t\tGET_LABELS(JIT_DEREF_CALLVIRT);\n\t\tGET_LABELS(JIT_STORE_ELEMENT);\n\t\tGET_LABELS(JIT_LEAVE);\n\t\tGET_LABELS(JIT_END_FINALLY);\n\t\tGET_LABELS(JIT_THROW);\n\t\tGET_LABELS(JIT_RETHROW);\n\t\tGET_LABELS(JIT_LOADOBJECT);\n\t\tGET_LABELS(JIT_LOAD_VECTOR_LEN);\n\t\tGET_LABELS(JIT_SWITCH);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_ADDR);\n\t\tGET_LABELS(JIT_CALL_INTERFACE);\n\t\tGET_LABELS(JIT_CAST_CLASS);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT);\n\t\tGET_LABELS(JIT_LOADFIELD_VALUETYPE);\n\t\tGET_LABELS(JIT_LOADFIELD);\n\t\tGET_LABELS(JIT_LOADFUNCTION);\n\t\tGET_LABELS(JIT_INVOKE_DELEGATE);\n\t\tGET_LABELS(JIT_CALL_PINVOKE);\n\t\tGET_LABELS_DYNAMIC(JIT_LOAD_I64, 8);\n\t\tGET_LABELS(JIT_INIT_OBJECT);\n\t\tGET_LABELS_DYNAMIC(JIT_DUP_4, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_DUP_8, 0);\n\t\tGET_LABELS(JIT_LOADSTATICFIELDADDRESS_CHECKTYPEINIT);\n\t\tGET_LABELS_DYNAMIC(JIT_POP_4, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOAD_F32, 4);\n\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_INT64, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_INT32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_INTNATIVE, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_F32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_F64, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_PTR, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_O, 4);\n\t\tGET_LABELS(JIT_LOADPARAMLOCAL_VALUETYPE);\n\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_0, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_1, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_2, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_3, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_4, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_5, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_6, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOADPARAMLOCAL_7, 0);\n\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_INT64, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_INT32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_INTNATIVE, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_F32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_F64, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_PTR, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_O, 4);\n\t\tGET_LABELS(JIT_STOREPARAMLOCAL_VALUETYPE);\n\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_0, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_1, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_2, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_3, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_4, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_5, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_6, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_STOREPARAMLOCAL_7, 0);\n\n\t\tGET_LABELS(JIT_STOREFIELD_INT64);\n\t\tGET_LABELS(JIT_STOREFIELD_INT32);\n\t\tGET_LABELS(JIT_STOREFIELD_INTNATIVE);\n\t\tGET_LABELS(JIT_STOREFIELD_F32);\n\t\tGET_LABELS(JIT_STOREFIELD_F64);\n\t\tGET_LABELS(JIT_STOREFIELD_PTR);\n\t\tGET_LABELS(JIT_STOREFIELD_O);\n\t\tGET_LABELS(JIT_STOREFIELD_VALUETYPE);\n\n\t\tGET_LABELS(JIT_LOADSTATICFIELD_CHECKTYPEINIT_INT32);\n\t\tGET_LABELS(JIT_LOADSTATICFIELD_CHECKTYPEINIT_VALUETYPE);\n\t\tGET_LABELS(JIT_LOADSTATICFIELD_CHECKTYPEINIT_O);\n\t\tGET_LABELS(JIT_LOADSTATICFIELD_CHECKTYPEINIT_INTNATIVE);\n\t\tGET_LABELS(JIT_LOADSTATICFIELD_CHECKTYPEINIT_PTR);\n\t\tGET_LABELS(JIT_LOADSTATICFIELD_CHECKTYPEINIT_F32);\n\t\tGET_LABELS(JIT_LOADSTATICFIELD_CHECKTYPEINIT_F64);\n\n\t\tGET_LABELS(JIT_STORESTATICFIELD_INT32);\n\t\tGET_LABELS(JIT_STORESTATICFIELD_INT64);\n\t\tGET_LABELS(JIT_STORESTATICFIELD_O);\n\t\tGET_LABELS(JIT_STORESTATICFIELD_F32);\n\t\tGET_LABELS(JIT_STORESTATICFIELD_F64);\n\t\tGET_LABELS(JIT_STORESTATICFIELD_INTNATIVE);\n\t\tGET_LABELS(JIT_STORESTATICFIELD_PTR);\n\t\tGET_LABELS(JIT_STORESTATICFIELD_VALUETYPE);\n\n\t\tGET_LABELS(JIT_BOX_INT64);\n\t\tGET_LABELS(JIT_BOX_INT32);\n\t\tGET_LABELS(JIT_BOX_INTNATIVE);\n\t\tGET_LABELS(JIT_BOX_F32);\n\t\tGET_LABELS(JIT_BOX_F64);\n\t\tGET_LABELS(JIT_BOX_O);\n\t\tGET_LABELS(JIT_BOX_VALUETYPE);\n\n\t\tGET_LABELS_DYNAMIC(JIT_CEQ_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CGT_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CGT_UN_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CLT_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CLT_UN_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CEQ_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CGT_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CGT_UN_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CLT_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CLT_UN_I64I64, 0);\n\n\t\tGET_LABELS_DYNAMIC(JIT_ADD_OVF_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_ADD_OVF_UN_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_MUL_OVF_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_MUL_OVF_UN_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SUB_OVF_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SUB_OVF_UN_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_ADD_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SUB_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_MUL_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_DIV_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_DIV_UN_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_REM_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_REM_UN_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_AND_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_OR_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_XOR_I32I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_NEG_I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_NOT_I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_NEG_I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_NOT_I64, 0);\n\n\t\tGET_LABELS(JIT_BOX_NULLABLE);\n\t\tGET_LABELS_DYNAMIC(JIT_LOAD_F64, 8);\n\t\tGET_LABELS(JIT_UNBOX_NULLABLE);\n\n\t\tGET_LABELS(JIT_BEQ_I32I32);\n\t\tGET_LABELS(JIT_BEQ_I64I64);\n\t\tGET_LABELS(JIT_BEQ_F32F32);\n\t\tGET_LABELS(JIT_BEQ_F64F64);\n\n\t\tGET_LABELS(JIT_BGE_I32I32);\n\t\tGET_LABELS(JIT_BGE_I64I64);\n\t\tGET_LABELS(JIT_BGE_F32F32);\n\t\tGET_LABELS(JIT_BGE_F64F64);\n\t\tGET_LABELS(JIT_BGE_UN_F32F32);\n\t\tGET_LABELS(JIT_BGE_UN_F64F64);\n\n\t\tGET_LABELS(JIT_BGT_I32I32);\n\t\tGET_LABELS(JIT_BGT_I64I64);\n\t\tGET_LABELS(JIT_BGT_F32F32);\n\t\tGET_LABELS(JIT_BGT_F64F64);\n\t\tGET_LABELS(JIT_BGT_UN_F32F32);\n\t\tGET_LABELS(JIT_BGT_UN_F64F64);\n\n\t\tGET_LABELS(JIT_BLE_I32I32);\n\t\tGET_LABELS(JIT_BLE_I64I64);\n\t\tGET_LABELS(JIT_BLE_F32F32);\n\t\tGET_LABELS(JIT_BLE_F64F64);\n\t\tGET_LABELS(JIT_BLE_UN_F32F32);\n\t\tGET_LABELS(JIT_BLE_UN_F64F64);\n\n\t\tGET_LABELS(JIT_BLT_I32I32);\n\t\tGET_LABELS(JIT_BLT_I64I64);\n\t\tGET_LABELS(JIT_BLT_F32F32);\n\t\tGET_LABELS(JIT_BLT_F64F64);\n\t\tGET_LABELS(JIT_BLT_UN_F32F32);\n\t\tGET_LABELS(JIT_BLT_UN_F64F64);\n\n\t\tGET_LABELS(JIT_BNE_UN_I32I32);\n\t\tGET_LABELS(JIT_BNE_UN_I64I64);\n\t\tGET_LABELS(JIT_BNE_UN_F32F32);\n\t\tGET_LABELS(JIT_BNE_UN_F64F64);\n\n\t\tGET_LABELS(JIT_BGE_UN_I32I32);\n\t\tGET_LABELS(JIT_BGT_UN_I32I32);\n\t\tGET_LABELS(JIT_BLE_UN_I32I32);\n\t\tGET_LABELS(JIT_BLT_UN_I32I32);\n\n\t\tGET_LABELS_DYNAMIC(JIT_SHL_I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SHR_I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SHR_UN_I32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SHL_I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SHR_I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SHR_UN_I64, 0);\n\n\t\tGET_LABELS(JIT_BRANCH_FALSE);\n\t\tGET_LABELS(JIT_BRANCH_TRUE);\n\t\tGET_LABELS(JIT_LOADTOKEN_TYPE);\n\t\t\n\t\tGET_LABELS(JIT_LOADTOKEN_FIELD);\n\t\tGET_LABELS(JIT_LOADINDIRECT_I8);\n\t\tGET_LABELS(JIT_LOADINDIRECT_U8);\n\t\tGET_LABELS(JIT_LOADINDIRECT_I16);\n\t\tGET_LABELS(JIT_LOADINDIRECT_U16);\n\t\tGET_LABELS(JIT_LOADINDIRECT_I32);\n\t\tGET_LABELS(JIT_LOADINDIRECT_U32);\n\t\tGET_LABELS(JIT_LOADINDIRECT_I64);\n\n\t\tGET_LABELS(JIT_LOADINDIRECT_R32);\n\t\tGET_LABELS(JIT_LOADINDIRECT_R64);\n\t\tGET_LABELS(JIT_LOADINDIRECT_REF);\n\t\tGET_LABELS(JIT_STOREINDIRECT_REF);\n\t\tGET_LABELS(JIT_STOREINDIRECT_U8);\n\t\tGET_LABELS(JIT_STOREINDIRECT_U16);\n\t\tGET_LABELS(JIT_STOREINDIRECT_U32);\n\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I32_I32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I32_U32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I32_I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I32_U64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I32_R32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I32_R64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U32_I32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U32_U32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U32_I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U32_U64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U32_R32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U32_R64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I64_I32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I64_U32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I64_U64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I64_R32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_I64_R64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U64_I32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U64_U32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U64_I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U64_R32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_U64_R64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R32_I32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R32_U32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R32_I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R32_U64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R32_R32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R32_R64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R64_I32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R64_U32, 4);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R64_I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R64_U64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R64_R32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CONV_R64_R64, 0);\n\n\t\tGET_LABELS(JIT_STORE_ELEMENT_32);\n\t\tGET_LABELS(JIT_STORE_ELEMENT_64);\n\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_I8);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_U8);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_I16);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_U16);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_I32);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_U32);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_I64);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_R32);\n\t\tGET_LABELS(JIT_LOAD_ELEMENT_R64);\n\n\t\tGET_LABELS_DYNAMIC(JIT_ADD_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SUB_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_MUL_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_DIV_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_DIV_UN_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_REM_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_REM_UN_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_AND_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_OR_I64I64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_XOR_I64I64, 0);\n\n\t\tGET_LABELS_DYNAMIC(JIT_CEQ_F32F32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CGT_F32F32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CLT_F32F32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CEQ_F64F64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CGT_F64F64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_CLT_F64F64, 0);\n\n\t\tGET_LABELS_DYNAMIC(JIT_ADD_F32F32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_ADD_F64F64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SUB_F32F32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_SUB_F64F64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_MUL_F32F32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_MUL_F64F64, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_DIV_F32F32, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_DIV_F64F64, 0);\n\n\t\tGET_LABELS_DYNAMIC(JIT_LOAD_I4_M1, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOAD_I4_0, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOAD_I4_1, 0);\n\t\tGET_LABELS_DYNAMIC(JIT_LOAD_I4_2, 0);\n\n\t\tGET_LABELS_DYNAMIC(JIT_LOADFIELD_4, 4);\n\n\t\treturn 0;\n\t}\n\n#ifdef DIAG_OPCODE_TIMES\n\tU64 opcodeStartTime = rdtsc();\n\tU32 realOp;\n#endif\n\n\tLOAD_METHOD_STATE();\n\n\tGO_NEXT();\n\nnoCode:\n\tCrash(\"No code for op-code\");\n\nJIT_NOP_start:\nJIT_CONV_R32_R32_start:\nJIT_CONV_R64_R64_start:\nJIT_CONV_I64_U64_start:\nJIT_CONV_U64_I64_start:\n\tOPCODE_USE(JIT_NOP);\nJIT_NOP_end:\nJIT_CONV_R32_R32_end:\nJIT_CONV_R64_R64_end:\nJIT_CONV_I64_U64_end:\nJIT_CONV_U64_I64_end:\nJIT_GoNext_start:\n\tGO_NEXT();\nJIT_GoNext_end:\n\nJIT_LOAD_NULL_start:\n\tOPCODE_USE(JIT_LOAD_NULL);\n\tPUSH_O(NULL);\nJIT_LOAD_NULL_end:\n\tGO_NEXT();\n\nJIT_DUP_4_start:\n\tOPCODE_USE(JIT_DUP_4);\n\tDUP4();\nJIT_DUP_4_end:\n\tGO_NEXT();\n\nJIT_DUP_8_start:\n\tOPCODE_USE(JIT_DUP_8);\n\tDUP8();\nJIT_DUP_8_end:\n\tGO_NEXT();\n\nJIT_DUP_GENERAL_start:\n\tOPCODE_USE(JIT_DUP_GENERAL);\n\t{\n\t\tU32 dupSize = GET_OP();\n\t\tDUP(dupSize);\n\t}\nJIT_DUP_GENERAL_end:\n\tGO_NEXT();\n\nJIT_POP_start:\n\tOPCODE_USE(JIT_POP);\n\t{\n\t\tU32 popSize = GET_OP();\n\t\tPOP(popSize);\n\t}\nJIT_POP_end:\n\tGO_NEXT();\n\nJIT_POP_4_start:\n\tOPCODE_USE(JIT_POP_4);\n\tPOP(4);\nJIT_POP_4_end:\n\tGO_NEXT();\n\nJIT_LOAD_I32_start:\nJIT_LOAD_F32_start:\n\tOPCODE_USE(JIT_LOAD_I32);\n\t{\n\t\tI32 value = GET_OP();\n\t\tPUSH_U32(value);\n\t}\nJIT_LOAD_I32_end:\nJIT_LOAD_F32_end:\n\tGO_NEXT();\n\nJIT_LOAD_I4_M1_start:\n\tOPCODE_USE(JIT_LOAD_I4_M1);\n\tPUSH_U32(-1);\nJIT_LOAD_I4_M1_end:\n\tGO_NEXT();\n\nJIT_LOAD_I4_0_start:\n\tOPCODE_USE(JIT_LOAD_I4_0);\n\tPUSH_U32(0);\nJIT_LOAD_I4_0_end:\n\tGO_NEXT();\n\nJIT_LOAD_I4_1_start:\n\tOPCODE_USE(JIT_LOAD_I4_1);\n\tPUSH_U32(1);\nJIT_LOAD_I4_1_end:\n\tGO_NEXT();\n\nJIT_LOAD_I4_2_start:\n\tOPCODE_USE(JIT_LOAD_I4_2);\n\tPUSH_U32(2);\nJIT_LOAD_I4_2_end:\n\tGO_NEXT();\n\nJIT_LOAD_I64_start:\nJIT_LOAD_F64_start:\n\tOPCODE_USE(JIT_LOAD_I64);\n\t{\n\t\tU64 value = *(U64*)pCurOp;\n\t\tpCurOp += 2;\n\t\tPUSH_U64(value);\n\t}\nJIT_LOAD_I64_end:\nJIT_LOAD_F64_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_INT32_start:\nJIT_LOADPARAMLOCAL_F32_start:\nJIT_LOADPARAMLOCAL_O_start:\nJIT_LOADPARAMLOCAL_INTNATIVE_start: // Only on 32-bit\nJIT_LOADPARAMLOCAL_PTR_start: // Only on 32-bit\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_INT32);\n\t{\n\t\tU32 ofs = GET_OP();\n\t\tU32 value = PARAMLOCAL_U32(ofs);\n\t\tPUSH_U32(value);\n\t}\nJIT_LOADPARAMLOCAL_INT32_end:\nJIT_LOADPARAMLOCAL_F32_end:\nJIT_LOADPARAMLOCAL_O_end:\nJIT_LOADPARAMLOCAL_INTNATIVE_end:\nJIT_LOADPARAMLOCAL_PTR_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_INT64_start:\nJIT_LOADPARAMLOCAL_F64_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_INT64);\n\t{\n\t\tU32 ofs = GET_OP();\n\t\tU64 value = PARAMLOCAL_U64(ofs);\n\t\tPUSH_U64(value);\n\t}\nJIT_LOADPARAMLOCAL_INT64_end:\nJIT_LOADPARAMLOCAL_F64_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_VALUETYPE_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_VALUETYPE);\n\t{\n\t\ttMD_TypeDef *pTypeDef;\n\t\tU32 ofs;\n\t\tPTR pMem;\n\n\t\tofs = GET_OP();\n\t\tpTypeDef = (tMD_TypeDef*)GET_OP();\n\t\tpMem = pParamsLocals + ofs;\n\t\tPUSH_VALUETYPE(pMem, pTypeDef->stackSize, pTypeDef->stackSize);\n\t}\nJIT_LOADPARAMLOCAL_VALUETYPE_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_0_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_0);\n\tPUSH_U32(PARAMLOCAL_U32(0));\nJIT_LOADPARAMLOCAL_0_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_1_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_1);\n\tPUSH_U32(PARAMLOCAL_U32(4));\nJIT_LOADPARAMLOCAL_1_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_2_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_2);\n\tPUSH_U32(PARAMLOCAL_U32(8));\nJIT_LOADPARAMLOCAL_2_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_3_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_3);\n\tPUSH_U32(PARAMLOCAL_U32(12));\nJIT_LOADPARAMLOCAL_3_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_4_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_4);\n\tPUSH_U32(PARAMLOCAL_U32(16));\nJIT_LOADPARAMLOCAL_4_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_5_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_5);\n\tPUSH_U32(PARAMLOCAL_U32(20));\nJIT_LOADPARAMLOCAL_5_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_6_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_6);\n\tPUSH_U32(PARAMLOCAL_U32(24));\nJIT_LOADPARAMLOCAL_6_end:\n\tGO_NEXT();\n\nJIT_LOADPARAMLOCAL_7_start:\n\tOPCODE_USE(JIT_LOADPARAMLOCAL_7);\n\tPUSH_U32(PARAMLOCAL_U32(28));\nJIT_LOADPARAMLOCAL_7_end:\n\tGO_NEXT();\n\nJIT_LOAD_PARAMLOCAL_ADDR_start:\n\tOPCODE_USE(JIT_LOAD_PARAMLOCAL_ADDR);\n\t{\n\t\tU32 ofs = GET_OP();\n\t\tPTR pMem = pParamsLocals + ofs;\n\t\tPUSH_PTR(pMem);\n\t}\nJIT_LOAD_PARAMLOCAL_ADDR_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_INT32_start:\nJIT_STOREPARAMLOCAL_F32_start:\nJIT_STOREPARAMLOCAL_O_start:\nJIT_STOREPARAMLOCAL_INTNATIVE_start: // Only on 32-bit\nJIT_STOREPARAMLOCAL_PTR_start: // Onlt on 32-bit\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_INT32);\n\t{\n\t\tU32 ofs = GET_OP();\n\t\tU32 value = POP_U32();\n\t\tPARAMLOCAL_U32(ofs) = value;\n\t}\nJIT_STOREPARAMLOCAL_INT32_end:\nJIT_STOREPARAMLOCAL_F32_end:\nJIT_STOREPARAMLOCAL_O_end:\nJIT_STOREPARAMLOCAL_INTNATIVE_end:\nJIT_STOREPARAMLOCAL_PTR_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_INT64_start:\nJIT_STOREPARAMLOCAL_F64_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_INT64);\n\t{\n\t\tU32 ofs = GET_OP();\n\t\tU64 value = POP_U64();\n\t\tPARAMLOCAL_U64(ofs) = value;\n\t}\nJIT_STOREPARAMLOCAL_INT64_end:\nJIT_STOREPARAMLOCAL_F64_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_VALUETYPE_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_VALUETYPE);\n\t{\n\t\ttMD_TypeDef *pTypeDef;\n\t\tU32 ofs;\n\t\tPTR pMem;\n\n\t\tofs = GET_OP();\n\t\tpTypeDef = (tMD_TypeDef*)GET_OP();\n\t\tpMem = pParamsLocals + ofs;\n\t\tPOP_VALUETYPE(pMem, pTypeDef->stackSize, pTypeDef->stackSize);\n\t}\nJIT_STOREPARAMLOCAL_VALUETYPE_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_0_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_0);\n\tPARAMLOCAL_U32(0) = POP_U32();\nJIT_STOREPARAMLOCAL_0_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_1_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_1);\n\tPARAMLOCAL_U32(4) = POP_U32();\nJIT_STOREPARAMLOCAL_1_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_2_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_2);\n\tPARAMLOCAL_U32(8) = POP_U32();\nJIT_STOREPARAMLOCAL_2_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_3_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_3);\n\tPARAMLOCAL_U32(12) = POP_U32();\nJIT_STOREPARAMLOCAL_3_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_4_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_4);\n\tPARAMLOCAL_U32(16) = POP_U32();\nJIT_STOREPARAMLOCAL_4_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_5_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_5);\n\tPARAMLOCAL_U32(20) = POP_U32();\nJIT_STOREPARAMLOCAL_5_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_6_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_6);\n\tPARAMLOCAL_U32(24) = POP_U32();\nJIT_STOREPARAMLOCAL_6_end:\n\tGO_NEXT();\n\nJIT_STOREPARAMLOCAL_7_start:\n\tOPCODE_USE(JIT_STOREPARAMLOCAL_7);\n\tPARAMLOCAL_U32(28) = POP_U32();\nJIT_STOREPARAMLOCAL_7_end:\n\tGO_NEXT();\n\nJIT_LOADINDIRECT_I8_start:\nJIT_LOADINDIRECT_I16_start:\nJIT_LOADINDIRECT_I32_start:\nJIT_LOADINDIRECT_U8_start:\nJIT_LOADINDIRECT_U16_start:\nJIT_LOADINDIRECT_U32_start:\nJIT_LOADINDIRECT_R32_start:\nJIT_LOADINDIRECT_REF_start:\n\tOPCODE_USE(JIT_LOADINDIRECT_U32);\n\t{\n\t\tPTR pMem = POP_PTR();\n\t\tU32 value = *(U32*)pMem;\n\t\tPUSH_U32(value);\n\t}\nJIT_LOADINDIRECT_I8_end:\nJIT_LOADINDIRECT_I16_end:\nJIT_LOADINDIRECT_I32_end:\nJIT_LOADINDIRECT_U8_end:\nJIT_LOADINDIRECT_U16_end:\nJIT_LOADINDIRECT_U32_end:\nJIT_LOADINDIRECT_R32_end:\nJIT_LOADINDIRECT_REF_end:\n\tGO_NEXT();\n\nJIT_LOADINDIRECT_R64_start:\nJIT_LOADINDIRECT_I64_start:\n\tOPCODE_USE(JIT_LOADINDIRECT_I64);\n\t{\n\t\tPTR pMem = POP_PTR();\n\t\tU64 value = *(U64*)pMem;\n\t\tPUSH_U64(value);\n\t}\nJIT_LOADINDIRECT_R64_end:\nJIT_LOADINDIRECT_I64_end:\n\tGO_NEXT();\n\nJIT_STOREINDIRECT_U8_start:\nJIT_STOREINDIRECT_U16_start:\nJIT_STOREINDIRECT_U32_start:\nJIT_STOREINDIRECT_REF_start:\n\tOPCODE_USE(JIT_STOREINDIRECT_U32);\n\t{\n\t\tU32 value = POP_U32(); // The value to store\n\t\tPTR pMem = POP_PTR(); // The address to store to\n\t\t*(U32*)pMem = value;\n\t}\nJIT_STOREINDIRECT_U8_end:\nJIT_STOREINDIRECT_U16_end:\nJIT_STOREINDIRECT_U32_end:\nJIT_STOREINDIRECT_REF_end:\n\tGO_NEXT();\n\nJIT_STORE_OBJECT_VALUETYPE_start:\n\tOPCODE_USE(JIT_STORE_OBJECT_VALUETYPE);\n\t{\n\t\tU32 size = GET_OP(); // The size, in bytes, of the value-type to store\n\t\tU32 memSize = (size<4)?4:size;\n\t\tPTR pMem = pCurEvalStack - memSize - sizeof(void*);\n\t\tPOP_VALUETYPE(*(void**)pMem, size, memSize);\n\t\tPOP(4);\n\t}\nJIT_STORE_OBJECT_VALUETYPE_end:\n\tGO_NEXT();\n\nJIT_CALL_PINVOKE_start:\n\tOPCODE_USE(JIT_CALL_PINVOKE);\n\t{\n\t\ttJITCallPInvoke *pCallPInvoke;\n\t\tU32 res;\n\n\t\tpCallPInvoke = (tJITCallPInvoke*)(pCurOp - 1);\n\t\tres = PInvoke_Call(pCallPInvoke, pParamsLocals, pCurrentMethodState->pEvalStack);\n\t\tpCurrentMethodState->stackOfs = res;\n\t}\n\tgoto JIT_RETURN_start;\nJIT_CALL_PINVOKE_end:\n\nJIT_CALL_NATIVE_start:\n\tOPCODE_USE(JIT_CALL_NATIVE);\n\t{\n\t\ttJITCallNative *pCallNative;\n\t\tPTR pThis;\n\t\tU32 thisOfs;\n\t\ttAsyncCall *pAsync;\n\n\t\t//pCallNative = (tJITCallNative*)&(pJIT->pOps[pCurrentMethodState->ipOffset - 1]);\n\t\tpCallNative = (tJITCallNative*)(pCurOp - 1);\n\t\tif (METHOD_ISSTATIC(pCallNative->pMethodDef)) {\n\t\t\tpThis = NULL;\n\t\t\tthisOfs = 0;\n\t\t} else {\n\t\t\tpThis = *(PTR*)pCurrentMethodState->pParamsLocals;\n\t\t\tthisOfs = 4;\n\t\t}\n\t\t// Internal constructors MUST leave the newly created object in the return value\n\t\t// (ie on top of the evaluation stack)\n\t\tpAsync = pCallNative->fn(pThis, pCurrentMethodState->pParamsLocals + thisOfs, pCurrentMethodState->pEvalStack);\n\t\tif (pAsync != NULL) {\n\t\t\t// Save the method state\n\t\t\tSAVE_METHOD_STATE();\n\t\t\t// Change the IP pointer to point to the return instruction\n\t\t\tpCurrentMethodState->ipOffset = 3;\n\t\t\t// Handle special async codes\n\t\t\tif (pAsync == ASYNC_LOCK_EXIT) {\n\t\t\t\treturn THREAD_STATUS_LOCK_EXIT;\n\t\t\t}\n\t\t\t// Set the async in the thread\n\t\t\tpThread->pAsync = pAsync;\n\t\t\treturn THREAD_STATUS_ASYNC;\n\t\t}\n\t}\n\t// fall-through\nJIT_CALL_NATIVE_end:\n\nJIT_RETURN_start:\n\tOPCODE_USE(JIT_RETURN);\n\t//printf(\"Returned from %s() to %s()\\n\", pCurrentMethodState->pMethod->name, (pCurrentMethodState->pCaller)?pCurrentMethodState->pCaller->pMethod->name:\"<none>\");\n\tif (pCurrentMethodState->pCaller == NULL) {\n\t\t// End of thread!\n\t\tif (pCurrentMethodState->pMethod->pReturnType == types[TYPE_SYSTEM_INT32]) {\n\t\t\t// If function returned an int32, then make it the thread exit-value\n\t\t\tpThread->threadExitValue = (I32)POP_U32();\n\t\t}\n\t\treturn THREAD_STATUS_EXIT;\n\t}\n\t// Make u32Value the number of bytes of the return value from the function\n\tif (pCurrentMethodState->pMethod->pReturnType != NULL) {\n\t\tu32Value = pCurrentMethodState->pMethod->pReturnType->stackSize;\n\t} else if (pCurrentMethodState->isInternalNewObjCall) {\n\t\tu32Value = sizeof(void*);\n\t} else {\n\t\tu32Value = 0;\n\t}\n\tpMem = pCurrentMethodState->pEvalStack;\n\t{\n\t\ttMethodState *pOldMethodState = pCurrentMethodState;\n\t\tpThread->pCurrentMethodState = pCurrentMethodState->pCaller;\n\t\tLOAD_METHOD_STATE();\n\t\t// Copy return value to callers evaluation stack\n\t\tif (u32Value > 0) {\n\t\t\tmemmove(pCurEvalStack, pMem, u32Value);\n\t\t\tpCurEvalStack += u32Value;\n\t\t}\n\t\t// Delete the current method state and go back to callers method state\n\t\tMethodState_Delete(pThread, &pOldMethodState);\n\t}\n\tif (pCurrentMethodState->pNextDelegate == NULL) {\n\t\tGO_NEXT();\n\t}\n\t// Fall-through if more delegate methods to invoke\nJIT_RETURN_end:\n\nJIT_INVOKE_DELEGATE_start:\n\tOPCODE_USE(JIT_INVOKE_DELEGATE);\n\t{\n\t\ttMD_MethodDef *pDelegateMethod, *pCallMethod;\n\t\tvoid *pDelegate;\n\t\tHEAP_PTR pDelegateThis;\n\t\ttMethodState *pCallMethodState;\n\t\tU32 ofs;\n\n\t\tif (pCurrentMethodState->pNextDelegate == NULL) {\n\t\t\t// First delegate, so get the Invoke() method defined within the delegate class\n\t\t\tpDelegateMethod = (tMD_MethodDef*)GET_OP();\n\t\t\t// Take the params off the stack. This is the pointer to the tDelegate & params\n\t\t\t//pCurrentMethodState->stackOfs -= pDelegateMethod->parameterStackSize;\n\t\t\tpCurEvalStack -= pDelegateMethod->parameterStackSize;\n\t\t\t// Allocate memory for delegate params\n\t\t\tpCurrentMethodState->pDelegateParams = malloc(pDelegateMethod->parameterStackSize - sizeof(void*));\n\t\t\tmemcpy(\n\t\t\t\tpCurrentMethodState->pDelegateParams,\n\t\t\t\t//pCurrentMethodState->pEvalStack + pCurrentMethodState->stackOfs + sizeof(void*),\n\t\t\t\tpCurEvalStack + sizeof(void*),\n\t\t\t\tpDelegateMethod->parameterStackSize - sizeof(void*));\n\t\t\t// Get the actual delegate heap pointer\n\t\t\tpDelegate = *(void**)pCurEvalStack;\n\t\t} else {\n\t\t\tpDelegateMethod = Delegate_GetMethod(pCurrentMethodState->pNextDelegate);\n\t\t\tif (pDelegateMethod->pReturnType != NULL) {\n\t\t\t\tpCurEvalStack -= pDelegateMethod->pReturnType->stackSize;\n\t\t\t}\n\t\t\t// Get the actual delegate heap pointer\n\t\t\tpDelegate = pCurrentMethodState->pNextDelegate;\n\t\t}\n\t\tif (pDelegate == NULL) {\n\t\t\tTHROW(types[TYPE_SYSTEM_NULLREFERENCEEXCEPTION]);\n\t\t}\n\t\t// Get the real method to call; the target of the delegate.\n\t\tpCallMethod = Delegate_GetMethodAndStore(pDelegate, &pDelegateThis, &pCurrentMethodState->pNextDelegate);\n\t\t// Set up the call method state for the call.\n\t\tpCallMethodState = MethodState_Direct(pThread, pCallMethod, pCurrentMethodState, 0);\n\t\tif (pDelegateThis != NULL) {\n\t\t\t*(HEAP_PTR*)pCallMethodState->pParamsLocals = pDelegateThis;\n\t\t\tofs = sizeof(void*);\n\t\t} else {\n\t\t\tofs = 0;\n\t\t}\n\t\tmemcpy(pCallMethodState->pParamsLocals + ofs,\n\t\t\tpCurrentMethodState->pDelegateParams,\n\t\t\tpCallMethod->parameterStackSize - ofs);\n\t\tCHANGE_METHOD_STATE(pCallMethodState);\n\t}\nJIT_INVOKE_DELEGATE_end:\n\tGO_NEXT();\n\nJIT_DEREF_CALLVIRT_start:\n\top = JIT_DEREF_CALLVIRT;\n\tgoto allCallStart;\nJIT_BOX_CALLVIRT_start:\n\top = JIT_BOX_CALLVIRT;\n\tgoto allCallStart;\nJIT_CALL_PTR_start: // Note that JIT_CALL_PTR cannot be virtual\n\top = JIT_CALL_PTR;\n\tgoto allCallStart;\nJIT_CALLVIRT_O_start:\n\top = JIT_CALLVIRT_O;\n\tgoto allCallStart;\nJIT_CALL_O_start:\n\top = JIT_CALL_O;\n\tgoto allCallStart;\nJIT_CALL_INTERFACE_start:\n\top = JIT_CALL_INTERFACE;\nallCallStart:\n\tOPCODE_USE(JIT_CALL_O);\n\t{\n\t\ttMD_MethodDef *pCallMethod;\n\t\ttMethodState *pCallMethodState;\n\t\ttMD_TypeDef *pBoxCallType;\n\n\t\tif (op == JIT_BOX_CALLVIRT) {\n\t\t\tpBoxCallType = (tMD_TypeDef*)GET_OP();\n\t\t}\n\n\t\tpCallMethod = (tMD_MethodDef*)GET_OP();\n\t\theapPtr = NULL;\n\n\t\tif (op == JIT_BOX_CALLVIRT) {\n\t\t\t// Need to de-ref and box the value-type before calling the function\n\t\t\t// TODO: Will this work on value-types that are not 4 bytes long?\n\t\t\tpMem = pCurEvalStack - pCallMethod->parameterStackSize;\n\t\t\theapPtr = Heap_Box(pBoxCallType, *(PTR*)pMem);\n\t\t\t*(HEAP_PTR*)pMem = heapPtr;\n\t\t} else if (op == JIT_DEREF_CALLVIRT) {\n\t\t\tpMem = pCurEvalStack - pCallMethod->parameterStackSize;\n\t\t\t*(HEAP_PTR*)pMem = **(HEAP_PTR**)pMem;\n\t\t}\n\n\t\t// If it's a virtual call then find the real correct method to call\n\t\tif (op == JIT_CALLVIRT_O || op == JIT_BOX_CALLVIRT || op == JIT_DEREF_CALLVIRT) {\n\t\t\ttMD_TypeDef *pThisType;\n\t\t\t// Get the actual object that is becoming 'this'\n\t\t\tif (heapPtr == NULL) {\n\t\t\t\theapPtr = *(HEAP_PTR*)(pCurEvalStack - pCallMethod->parameterStackSize);\n\t\t\t}\n\t\t\tif (heapPtr == NULL) {\n\t\t\t\t//Crash(\"NULL 'this' in Virtual call: %s\", Sys_GetMethodDesc(pCallMethod));\n\t\t\t\tTHROW(types[TYPE_SYSTEM_NULLREFERENCEEXCEPTION]);\n\t\t\t}\n\t\t\tpThisType = Heap_GetType(heapPtr);\n\t\t\tif (METHOD_ISVIRTUAL(pCallMethod)) {\n\t\t\t\tpCallMethod = pThisType->pVTable[pCallMethod->vTableOfs];\n\t\t\t}\n\t\t} else if (op == JIT_CALL_INTERFACE) {\n\t\t\ttMD_TypeDef *pInterface, *pThisType;\n\t\t\tU32 vIndex;\n\t\t\tI32 i;\n\n\t\t\tpInterface = pCallMethod->pParentType;\n\t\t\t// Get the actual object that is becoming 'this'\n\t\t\theapPtr = *(HEAP_PTR*)(pCurEvalStack - pCallMethod->parameterStackSize);\n\t\t\tpThisType = Heap_GetType(heapPtr);\n\t\t\t// Find the interface mapping on the 'this' type.\n\t\t\tvIndex = 0xffffffff;\n\t\t\t// This must be searched backwards so if an interface is implemented more than\n\t\t\t// once in the type hierarchy, the most recent definition gets called\n\t\t\tfor (i=(I32)pThisType->numInterfaces-1; i >= 0; i--) {\n\t\t\t\tif (pThisType->pInterfaceMaps[i].pInterface == pInterface) {\n\t\t\t\t\t// Found the right interface map\n\t\t\t\t\tif (pThisType->pInterfaceMaps[i].pVTableLookup != NULL) {\n\t\t\t\t\t\tvIndex = pThisType->pInterfaceMaps[i].pVTableLookup[pCallMethod->vTableOfs];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tpCallMethod = pThisType->pInterfaceMaps[i].ppMethodVLookup[pCallMethod->vTableOfs];\n\t\t\t\t\tgoto callMethodSet;\n\t\t\t\t}\n\t\t\t}\n\t\t\tAssert(vIndex != 0xffffffff);\n\t\t\tpCallMethod = pThisType->pVTable[vIndex];\n\t\t}\ncallMethodSet:\n\t\t//printf(\"Calling method: %s\\n\", Sys_GetMethodDesc(pCallMethod));\n\t\t// Set up the new method state for the called method\n\t\tpCallMethodState = MethodState_Direct(pThread, pCallMethod, pCurrentMethodState, 0);\n\t\t// Set up the parameter stack for the method being called\n\t\tpTempPtr = pCurEvalStack;\n\t\tCreateParameters(pCallMethodState->pParamsLocals, pCallMethod, &/*pCurEvalStack*/pTempPtr, NULL);\n\t\tpCurEvalStack = pTempPtr;\n\t\t// Set up the local variables for the new method state\n\t\tCHANGE_METHOD_STATE(pCallMethodState);\n\t}\nJIT_DEREF_CALLVIRT_end:\nJIT_BOX_CALLVIRT_end:\nJIT_CALL_PTR_end:\nJIT_CALLVIRT_O_end:\nJIT_CALL_O_end:\nJIT_CALL_INTERFACE_end:\n\tGO_NEXT_CHECK();\n\nJIT_BRANCH_start:\n\tOPCODE_USE(JIT_BRANCH);\n\t{\n\t\tU32 ofs = GET_OP();\n\t\tpCurOp = pOps + ofs;\n\t}\nJIT_BRANCH_end:\n\tGO_NEXT_CHECK();\n\nJIT_SWITCH_start:\n\tOPCODE_USE(JIT_SWITCH);\n\t{\n\t\tU32 ofs;\n\t\t// The number of jump targets\n\t\tU32 numTargets = GET_OP();\n\t\t// The jump target selected\n\t\tU32 target = POP_U32();\n\t\tif (target >= numTargets) {\n\t\t\t// This is not a valid jump target, so fall-through\n\t\t\tpCurOp += numTargets;\n\t\t\tgoto JIT_SWITCH_end;\n\t\t}\n\t\tofs = *(pCurOp + target);\n\t\tpCurOp = pOps + ofs;\n\t}\nJIT_SWITCH_end:\n\tGO_NEXT_CHECK();\n\nJIT_BRANCH_TRUE_start:\n\tOPCODE_USE(JIT_BRANCH_TRUE);\n\t{\n\t\tU32 value = POP_U32();\n\t\tU32 ofs = GET_OP();\n\t\tif (value != 0) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BRANCH_TRUE_end:\n\tGO_NEXT_CHECK();\n\nJIT_BRANCH_FALSE_start:\n\tOPCODE_USE(JIT_BRANCH_FALSE);\n\t{\n\t\tU32 value = POP_U32();\n\t\tU32 ofs = GET_OP();\n\t\tif (value == 0) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BRANCH_FALSE_end:\n\tGO_NEXT_CHECK();\n\nJIT_BEQ_I32I32_start:\n\tOPCODE_USE(JIT_BEQ_I32I32);\n\t{\n\t\tU32 v1, v2, ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I32)v1 == (I32)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BEQ_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BEQ_I64I64_start:\n\tOPCODE_USE(JIT_BEQ_I64I64);\n\t{\n\t\tU64 v1, v2;\n\t\tU32 ofs;\n\t\tPOP_U64_U64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I64)v1 == (I64)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BEQ_I64I64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BEQ_F32F32_start:\n\tOPCODE_USE(JIT_BEQ_F32F32);\n\t{\n\t\tfloat v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F32_F32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 == v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BEQ_F32F32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BEQ_F64F64_start:\n\tOPCODE_USE(JIT_BEQ_F64F64);\n\t{\n\t\tdouble v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F64_F64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 == v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BEQ_F64F64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGE_I32I32_start:\n\tOPCODE_USE(JIT_BGE_I32I32);\n\t{\n\t\tU32 v1, v2, ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I32)v1 >= (I32)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGE_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGE_I64I64_start:\n\tOPCODE_USE(JIT_BGE_I64I64);\n\t{\n\t\tU64 v1, v2;\n\t\tU32 ofs;\n\t\tPOP_U64_U64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I64)v1 >= (I64)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGE_I64I64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGE_F32F32_start:\nJIT_BGE_UN_F32F32_start:\n\tOPCODE_USE(JIT_BGE_F32F32);\n\t{\n\t\tfloat v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F32_F32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 >= v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGE_F32F32_end:\nJIT_BGE_UN_F32F32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGE_F64F64_start:\nJIT_BGE_UN_F64F64_start:\n\tOPCODE_USE(JIT_BGE_F64F64);\n\t{\n\t\tdouble v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F64_F64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 >= v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGE_F64F64_end:\nJIT_BGE_UN_F64F64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGT_I32I32_start:\n\tOPCODE_USE(JIT_BGT_I32I32);\n\t{\n\t\tU32 v1, v2;\n\t\tU32 ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I32)v1 > (I32)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGT_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGT_I64I64_start:\n\tOPCODE_USE(JIT_BGT_I64I64);\n\t{\n\t\tU64 v1, v2;\n\t\tU32 ofs;\n\t\tPOP_U64_U64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I64)v1 > (I64)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGT_I64I64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGT_F32F32_start:\nJIT_BGT_UN_F32F32_start:\n\tOPCODE_USE(JIT_BGT_F32F32);\n\t{\n\t\tfloat v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F32_F32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 > v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGT_F32F32_end:\nJIT_BGT_UN_F32F32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGT_F64F64_start:\nJIT_BGT_UN_F64F64_start:\n\tOPCODE_USE(JIT_BGT_F64F64);\n\t{\n\t\tdouble v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F64_F64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 > v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGT_F64F64_end:\nJIT_BGT_UN_F64F64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLE_I32I32_start:\n\tOPCODE_USE(JIT_BLE_I32I32);\n\t{\n\t\tU32 v1, v2;\n\t\tU32 ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I32)v1 <= (I32)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLE_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLE_I64I64_start:\n\tOPCODE_USE(JIT_BLE_I64I64);\n\t{\n\t\tU64 v1, v2;\n\t\tU32 ofs;\n\t\tPOP_U64_U64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I64)v1 <= (I64)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLE_I64I64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLE_F32F32_start:\nJIT_BLE_UN_F32F32_start:\n\tOPCODE_USE(JIT_BLE_F32F32);\n\t{\n\t\tfloat v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F32_F32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 <= v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLE_F32F32_end:\nJIT_BLE_UN_F32F32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLE_F64F64_start:\nJIT_BLE_UN_F64F64_start:\n\tOPCODE_USE(JIT_BLE_F64F64);\n\t{\n\t\tdouble v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F64_F64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 <= v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLE_F64F64_end:\nJIT_BLE_UN_F64F64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLT_I32I32_start:\n\tOPCODE_USE(JIT_BLT_I32I32);\n\t{\n\t\tU32 v1, v2;\n\t\tU32 ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I32)v1 < (I32)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLT_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLT_I64I64_start:\n\tOPCODE_USE(JIT_BLT_I64I64);\n\t{\n\t\tU64 v1, v2;\n\t\tU32 ofs;\n\t\tPOP_U64_U64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif ((I64)v1 < (I64)v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLT_I64I64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLT_F32F32_start:\nJIT_BLT_UN_F32F32_start:\n\tOPCODE_USE(JIT_BLT_F32F32);\n\t{\n\t\tfloat v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F32_F32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 < v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLT_F32F32_end:\nJIT_BLT_UN_F32F32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLT_F64F64_start:\nJIT_BLT_UN_F64F64_start:\n\tOPCODE_USE(JIT_BLT_F64F64);\n\t{\n\t\tdouble v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F64_F64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 < v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLT_F64F64_end:\nJIT_BLT_UN_F64F64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BNE_UN_I32I32_start:\n\tOPCODE_USE(JIT_BNE_UN_I32I32);\n\t{\n\t\tU32 v1, v2, ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 != v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BNE_UN_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BNE_UN_I64I64_start:\n\tOPCODE_USE(JIT_BNE_UN_I64I64);\n\t{\n\t\tU64 v1, v2;\n\t\tU32 ofs;\n\t\tPOP_U64_U64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 != v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BNE_UN_I64I64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BNE_UN_F32F32_start:\n\tOPCODE_USE(JIT_BNE_UN_F32F32);\n\t{\n\t\tfloat v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F32_F32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 != v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BNE_UN_F32F32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BNE_UN_F64F64_start:\n\tOPCODE_USE(JIT_BNE_UN_F64F64);\n\t{\n\t\tdouble v1, v2;\n\t\tU32 ofs;\n\t\tPOP_F64_F64(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 != v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BNE_UN_F64F64_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGE_UN_I32I32_start:\n\tOPCODE_USE(JIT_BGE_UN_I32I32);\n\t{\n\t\tU32 v1, v2, ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 >= v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGE_UN_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BGT_UN_I32I32_start:\n\tOPCODE_USE(JIT_BGT_UN_I32I32);\n\t{\n\t\tU32 v1, v2, ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 > v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BGT_UN_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLE_UN_I32I32_start:\n\tOPCODE_USE(JIT_BLE_UN_I32I32);\n\t{\n\t\tU32 v1, v2, ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 <= v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLE_UN_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_BLT_UN_I32I32_start:\n\tOPCODE_USE(JIT_BLT_UN_I32I32);\n\t{\n\t\tU32 v1, v2, ofs;\n\t\tPOP_U32_U32(v1, v2);\n\t\tofs = GET_OP();\n\t\tif (v1 < v2) {\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_BLT_UN_I32I32_end:\n\tGO_NEXT_CHECK();\n\nJIT_CEQ_I32I32_start: // Handles I32 and O\n\tOPCODE_USE(JIT_CEQ_I32I32);\n\tBINARY_OP(U32, U32, U32, ==);\nJIT_CEQ_I32I32_end:\n\tGO_NEXT();\n\nJIT_CGT_I32I32_start:\n\tOPCODE_USE(JIT_CGT_I32I32);\n\tBINARY_OP(U32, I32, I32, >);\nJIT_CGT_I32I32_end:\n\tGO_NEXT();\n\nJIT_CGT_UN_I32I32_start: // Handles I32 and O\n\tOPCODE_USE(JIT_CGT_UN_I32I32);\n\tBINARY_OP(U32, U32, U32, >);\nJIT_CGT_UN_I32I32_end:\n\tGO_NEXT();\n\nJIT_CLT_I32I32_start:\n\tOPCODE_USE(JIT_CLT_I32I32);\n\tBINARY_OP(U32, I32, I32, <);\nJIT_CLT_I32I32_end:\n\tGO_NEXT();\n\nJIT_CLT_UN_I32I32_start:\n\tOPCODE_USE(JIT_CLT_UN_I32I32);\n\tBINARY_OP(U32, U32, U32, <);\nJIT_CLT_UN_I32I32_end:\n\tGO_NEXT();\n\nJIT_CEQ_I64I64_start:\n\tOPCODE_USE(JIT_CEQ_I64I64);\n\tBINARY_OP(U32, U64, U64, ==);\nJIT_CEQ_I64I64_end:\n\tGO_NEXT();\n\nJIT_CGT_I64I64_start:\n\tOPCODE_USE(JIT_CGT_I64I64);\n\tBINARY_OP(U32, I64, I64, >);\nJIT_CGT_I64I64_end:\n\tGO_NEXT();\n\nJIT_CGT_UN_I64I64_start:\n\tOPCODE_USE(JIT_CGT_UN_I64I64);\n\tBINARY_OP(U32, U64, U64, >);\nJIT_CGT_UN_I64I64_end:\n\tGO_NEXT();\n\nJIT_CLT_I64I64_start:\n\tOPCODE_USE(JIT_CLT_I64I64);\n\tBINARY_OP(U32, I64, I64, <);\nJIT_CLT_I64I64_end:\n\tGO_NEXT();\n\nJIT_CLT_UN_I64I64_start:\n\tOPCODE_USE(JIT_CLT_UN_I64I64);\n\tBINARY_OP(U32, U64, U64, <);\nJIT_CLT_UN_I64I64_end:\n\tGO_NEXT();\n\nJIT_CEQ_F32F32_start:\n\tOPCODE_USE(JIT_CEQ_F32F32);\n\tBINARY_OP(U32, float, float, ==);\nJIT_CEQ_F32F32_end:\n\tGO_NEXT();\n\nJIT_CEQ_F64F64_start:\n\tOPCODE_USE(JIT_CEQ_F64F64);\n\tBINARY_OP(U32, double, double, ==);\nJIT_CEQ_F64F64_end:\n\tGO_NEXT();\n\nJIT_CGT_F32F32_start:\n\tOPCODE_USE(JIT_CGT_F32F32);\n\tBINARY_OP(U32, float, float, >);\nJIT_CGT_F32F32_end:\n\tGO_NEXT();\n\nJIT_CGT_F64F64_start:\n\tOPCODE_USE(JIT_CGT_F64F64);\n\tBINARY_OP(U32, double, double, >);\nJIT_CGT_F64F64_end:\n\tGO_NEXT();\n\nJIT_CLT_F32F32_start:\n\tOPCODE_USE(JIT_CLT_F32F32);\n\tBINARY_OP(U32, float, float, <);\nJIT_CLT_F32F32_end:\n\tGO_NEXT();\n\nJIT_CLT_F64F64_start:\n\tOPCODE_USE(JIT_CLT_F64F64);\n\tBINARY_OP(U32, double, double, <);\nJIT_CLT_F64F64_end:\n\tGO_NEXT();\n\nJIT_ADD_OVF_I32I32_start:\n\tOPCODE_USE(JIT_ADD_OVF_I32I32);\n\t{\n\t\tU32 v1, v2;\n\t\tI64 res;\n\t\tPOP_U32_U32(v1, v2);\n\t\tres = (I64)(I32)v1 + (I64)(I32)v2;\n\t\tif (res > (I64)0x7fffffff || res < (I64)0xffffffff80000000) {\n\t\t\t// Overflowed, so throw exception\n\t\t\tTHROW(types[TYPE_SYSTEM_OVERFLOWEXCEPTION]);\n\t\t}\n\t\tPUSH_U32((I32)res);\n\t}\nJIT_ADD_OVF_I32I32_end:\n\tGO_NEXT();\n\nJIT_ADD_OVF_UN_I32I32_start:\n\tOPCODE_USE(JIT_ADD_OVF_UN_I32I32);\n\t{\n\t\tU32 v1, v2;\n\t\tU64 res;\n\t\tPOP_U32_U32(v1, v2);\n\t\tres = (U64)v1 + (U64)v2;\n\t\tif (res > (U64)0xffffffff) {\n\t\t\t// Overflowed, so throw exception\n\t\t\tTHROW(types[TYPE_SYSTEM_OVERFLOWEXCEPTION]);\n\t\t}\n\t\tPUSH_U32(res);\n\t}\nJIT_ADD_OVF_UN_I32I32_end:\n\tGO_NEXT();\n\nJIT_MUL_OVF_I32I32_start:\n\tOPCODE_USE(JIT_MUL_OVF_I32I32);\n\t{\n\t\tU32 v1, v2;\n\t\tI64 res;\n\t\tPOP_U32_U32(v1, v2);\n\t\tres = (I64)(I32)v1 * (I64)(I32)v2;\n\t\tif (res > (I64)0x7fffffff || res < (I64)0xffffffff80000000) {\n\t\t\t// Overflowed, so throw exception\n\t\t\tTHROW(types[TYPE_SYSTEM_OVERFLOWEXCEPTION]);\n\t\t}\n\t\tPUSH_U32((I32)res);\n\t}\nJIT_MUL_OVF_I32I32_end:\n\tGO_NEXT();\n\nJIT_MUL_OVF_UN_I32I32_start:\n\tOPCODE_USE(JIT_MUL_OVF_UN_I32I32);\n\t{\n\t\tU32 v1, v2;\n\t\tU64 res;\n\t\tPOP_U32_U32(v1, v2);\n\t\tres = (U64)v1 * (U64)v2;\n\t\tif (res > (U64)0xffffffff) {\n\t\t\t// Overflowed, so throw exception\n\t\t\tTHROW(types[TYPE_SYSTEM_OVERFLOWEXCEPTION]);\n\t\t}\n\t\tPUSH_U32(res);\n\t}\nJIT_MUL_OVF_UN_I32I32_end:\n\tGO_NEXT();\n\nJIT_SUB_OVF_I32I32_start:\n\tOPCODE_USE(JIT_SUB_OVF_I32I32);\n\t{\n\t\tU32 v1, v2;\n\t\tI64 res;\n\t\tPOP_U32_U32(v1, v2);\n\t\tres = (I64)(I32)v1 - (I64)(I32)v2;\n\t\tif (res > (I64)0x7fffffff || res < (I64)0xffffffff80000000) {\n\t\t\t// Overflowed, so throw exception\n\t\t\tTHROW(types[TYPE_SYSTEM_OVERFLOWEXCEPTION]);\n\t\t}\n\t\tPUSH_U32((I32)res);\n\t}\nJIT_SUB_OVF_I32I32_end:\n\tGO_NEXT();\n\nJIT_SUB_OVF_UN_I32I32_start:\n\tOPCODE_USE(JIT_SUB_OVF_UN_I32I32);\n\t{\n\t\tU32 v1, v2;\n\t\tU64 res;\n\t\tPOP_U32_U32(v1, v2);\n\t\tres = (U64)v1 - (U64)v2;\n\t\tif (res > (U64)0xffffffff) {\n\t\t\t// Overflowed, so throw exception\n\t\t\tTHROW(types[TYPE_SYSTEM_OVERFLOWEXCEPTION]);\n\t\t}\n\t\tPUSH_U32(res);\n\t}\nJIT_SUB_OVF_UN_I32I32_end:\n\tGO_NEXT();\n\nJIT_ADD_I32I32_start:\n\tOPCODE_USE(JIT_ADD_I32I32);\n\tBINARY_OP(I32, I32, I32, +);\nJIT_ADD_I32I32_end:\n\tGO_NEXT();\n\nJIT_ADD_I64I64_start:\n\tOPCODE_USE(JIT_ADD_I64I64);\n\tBINARY_OP(I64, I64, I64, +);\nJIT_ADD_I64I64_end:\n\tGO_NEXT();\n\nJIT_ADD_F32F32_start:\n\tOPCODE_USE(JIT_ADD_F32F32);\n\tBINARY_OP(float, float, float, +);\nJIT_ADD_F32F32_end:\n\tGO_NEXT();\n\nJIT_ADD_F64F64_start:\n\tOPCODE_USE(JIT_ADD_F64F64);\n\tBINARY_OP(double, double, double, +);\nJIT_ADD_F64F64_end:\n\tGO_NEXT();\n\nJIT_SUB_I32I32_start:\n\tOPCODE_USE(JIT_SUB_I32I32);\n\tBINARY_OP(I32, I32, I32, -);\nJIT_SUB_I32I32_end:\n\tGO_NEXT();\n\nJIT_SUB_I64I64_start:\n\tOPCODE_USE(JIT_SUB_I64I64);\n\tBINARY_OP(I64, I64, I64, -);\nJIT_SUB_I64I64_end:\n\tGO_NEXT();\n\nJIT_SUB_F32F32_start:\n\tOPCODE_USE(JIT_SUB_F32F32);\n\tBINARY_OP(double, double, double, -);\nJIT_SUB_F32F32_end:\n\tGO_NEXT();\n\nJIT_SUB_F64F64_start:\n\tOPCODE_USE(JIT_SUB_F64F64);\n\tBINARY_OP(double, double, double, -);\nJIT_SUB_F64F64_end:\n\tGO_NEXT();\n\nJIT_MUL_I32I32_start:\n\tOPCODE_USE(JIT_MUL_I32I32);\n\tBINARY_OP(I32, I32, I32, *);\nJIT_MUL_I32I32_end:\n\tGO_NEXT();\n\nJIT_MUL_I64I64_start:\n\tOPCODE_USE(JIT_MUL_I64I64);\n\tBINARY_OP(I64, I64, I64, *);\nJIT_MUL_I64I64_end:\n\tGO_NEXT();\n\nJIT_MUL_F32F32_start:\n\tOPCODE_USE(JIT_MUL_F32F32);\n\tBINARY_OP(float, float, float, *);\nJIT_MUL_F32F32_end:\n\tGO_NEXT();\n\nJIT_MUL_F64F64_start:\n\tOPCODE_USE(JIT_MUL_F64F64);\n\tBINARY_OP(double, double, double, *);\nJIT_MUL_F64F64_end:\n\tGO_NEXT();\n\nJIT_DIV_I32I32_start:\n\tOPCODE_USE(JIT_DIV_I32I32);\n\tBINARY_OP(I32, I32, I32, /);\nJIT_DIV_I32I32_end:\n\tGO_NEXT();\n\nJIT_DIV_I64I64_start:\n\tOPCODE_USE(JIT_DIV_I64I64);\n\tBINARY_OP(I64, I64, I64, /);\nJIT_DIV_I64I64_end:\n\tGO_NEXT();\n\nJIT_DIV_F32F32_start:\n\tOPCODE_USE(JIT_DIV_F32F32);\n\tBINARY_OP(float, float, float, /);\nJIT_DIV_F32F32_end:\n\tGO_NEXT();\n\nJIT_DIV_F64F64_start:\n\tOPCODE_USE(JIT_DIV_F64F64);\n\tBINARY_OP(double, double, double, /);\nJIT_DIV_F64F64_end:\n\tGO_NEXT();\n\nJIT_DIV_UN_I32I32_start:\n\tOPCODE_USE(JIT_DIV_UN_I32I32);\n\tBINARY_OP(U32, U32, U32, /);\nJIT_DIV_UN_I32I32_end:\n\tGO_NEXT();\n\nJIT_DIV_UN_I64I64_start:\n\tOPCODE_USE(JIT_DIV_UN_I64I64);\n\tBINARY_OP(U64, U64, U64, /);\nJIT_DIV_UN_I64I64_end:\n\tGO_NEXT();\n\nJIT_REM_I32I32_start:\n\tOPCODE_USE(JIT_REM_I32I32);\n\tBINARY_OP(I32, I32, I32, %);\nJIT_REM_I32I32_end:\n\tGO_NEXT();\n\nJIT_REM_I64I64_start:\n\tOPCODE_USE(JIT_REM_I64I64);\n\tBINARY_OP(I64, I64, I64, %);\nJIT_REM_I64I64_end:\n\tGO_NEXT();\n\nJIT_REM_UN_I32I32_start:\n\tOPCODE_USE(JIT_REM_UN_I32I32);\n\tBINARY_OP(U32, U32, U32, %);\nJIT_REM_UN_I32I32_end:\n\tGO_NEXT();\n\nJIT_REM_UN_I64I64_start:\n\tOPCODE_USE(JIT_REM_UN_I64I64);\n\tBINARY_OP(U64, U64, U64, %);\nJIT_REM_UN_I64I64_end:\n\tGO_NEXT();\n\nJIT_AND_I32I32_start:\n\tOPCODE_USE(JIT_AND_I32I32);\n\tBINARY_OP(U32, U32, U32, &);\nJIT_AND_I32I32_end:\n\tGO_NEXT();\n\nJIT_AND_I64I64_start:\n\tOPCODE_USE(JIT_AND_I64I64);\n\tBINARY_OP(U64, U64, U64, &);\nJIT_AND_I64I64_end:\n\tGO_NEXT();\n\nJIT_OR_I32I32_start:\n\tOPCODE_USE(JIT_OR_I32I32);\n\tBINARY_OP(U32, U32, U32, |);\nJIT_OR_I32I32_end:\n\tGO_NEXT();\n\nJIT_OR_I64I64_start:\n\tOPCODE_USE(JIT_OR_I64I64);\n\tBINARY_OP(U64, U64, U64, |);\nJIT_OR_I64I64_end:\n\tGO_NEXT();\n\nJIT_XOR_I32I32_start:\n\tOPCODE_USE(JIT_XOR_I32I32);\n\tBINARY_OP(U32, U32, U32, ^);\nJIT_XOR_I32I32_end:\n\tGO_NEXT();\n\nJIT_XOR_I64I64_start:\n\tOPCODE_USE(JIT_XOR_I64I64);\n\tBINARY_OP(U64, U64, U64, ^);\nJIT_XOR_I64I64_end:\n\tGO_NEXT();\n\nJIT_NEG_I32_start:\n\tOPCODE_USE(JIT_NEG_I32);\n\tUNARY_OP(I32, -);\nJIT_NEG_I32_end:\n\tGO_NEXT();\n\nJIT_NEG_I64_start:\n\tOPCODE_USE(JIT_NEG_I64);\n\tUNARY_OP(I64, -);\nJIT_NEG_I64_end:\n\tGO_NEXT();\n\nJIT_NOT_I32_start:\n\tOPCODE_USE(JIT_NOT_I32);\n\tUNARY_OP(U32, ~);\nJIT_NOT_I32_end:\n\tGO_NEXT();\n\nJIT_NOT_I64_start:\n\tOPCODE_USE(JIT_NOT_I64);\n\tUNARY_OP(U64, ~);\nJIT_NOT_I64_end:\n\tGO_NEXT();\n\nJIT_SHL_I32_start:\n\tOPCODE_USE(JIT_SHL_I32);\n\tBINARY_OP(U32, U32, U32, <<);\nJIT_SHL_I32_end:\n\tGO_NEXT();\n\nJIT_SHR_I32_start:\n\tOPCODE_USE(JIT_SHR_I32);\n\tBINARY_OP(I32, I32, U32, >>);\nJIT_SHR_I32_end:\n\tGO_NEXT();\n\nJIT_SHR_UN_I32_start:\n\tOPCODE_USE(JIT_SHR_UN_I32);\n\tBINARY_OP(U32, U32, U32, >>);\nJIT_SHR_UN_I32_end:\n\tGO_NEXT();\n\nJIT_SHL_I64_start:\n\tOPCODE_USE(JIT_SHL_I64);\n\tBINARY_OP(U64, U64, U32, <<);\nJIT_SHL_I64_end:\n\tGO_NEXT();\n\nJIT_SHR_I64_start:\n\tOPCODE_USE(JIT_SHR_I64);\n\tBINARY_OP(I64, I64, U32, >>);\nJIT_SHR_I64_end:\n\tGO_NEXT();\n\nJIT_SHR_UN_I64_start:\n\tOPCODE_USE(JIT_SHR_UN_I64);\n\tBINARY_OP(U64, U64, U32, >>);\nJIT_SHR_UN_I64_end:\n\tGO_NEXT();\n\n\t// Conversion operations\n\nJIT_CONV_U32_U32_start:\nJIT_CONV_I32_U32_start:\n\tOPCODE_USE(JIT_CONV_I32_U32);\n\t{\n\t\tU32 mask = GET_OP();\n\t\tSTACK_ADDR(U32) &= mask;\n\t}\nJIT_CONV_U32_U32_end:\nJIT_CONV_I32_U32_end:\n\tGO_NEXT();\n\nJIT_CONV_U32_I32_start:\nJIT_CONV_I32_I32_start:\n\tOPCODE_USE(JIT_CONV_I32_I32);\n\t{\n\t\tU32 shift = GET_OP();\n\t\tSTACK_ADDR(I32) = (STACK_ADDR(I32) << shift) >> shift;\n\t}\nJIT_CONV_U32_I32_end:\nJIT_CONV_I32_I32_end:\n\tGO_NEXT();\n\nJIT_CONV_I32_I64_start:\n\tOPCODE_USE(JIT_CONV_I32_I64);\n\t{\n\t\tI32 value = (I32)POP_U32();\n\t\tPUSH_U64((I64)value);\n\t}\nJIT_CONV_I32_I64_end:\n\tGO_NEXT();\n\nJIT_CONV_I32_U64_start:\nJIT_CONV_U32_U64_start:\nJIT_CONV_U32_I64_start:\n\tOPCODE_USE(JIT_CONV_U32_I64);\n\t{\n\t\tU32 value = POP_U32();\n\t\tPUSH_U64(value);\n\t}\nJIT_CONV_I32_U64_end:\nJIT_CONV_U32_U64_end:\nJIT_CONV_U32_I64_end:\n\tGO_NEXT();\n\nJIT_CONV_I32_R32_start:\n\tOPCODE_USE(JIT_CONV_I32_R32);\n\t{\n\t\tI32 value = (I32)POP_U32();\n\t\tPUSH_FLOAT(value);\n\t}\nJIT_CONV_I32_R32_end:\n\tGO_NEXT();\n\nJIT_CONV_I32_R64_start:\n\tOPCODE_USE(JIT_CONV_I32_R64);\n\t{\n\t\tI32 value = (I32)POP_U32();\n\t\tPUSH_DOUBLE(value);\n\t}\nJIT_CONV_I32_R64_end:\n\tGO_NEXT();\n\nJIT_CONV_U32_R32_start:\n\tOPCODE_USE(JIT_CONV_U32_R32);\n\t{\n\t\tU32 value = POP_U32();\n\t\tPUSH_FLOAT(value);\n\t}\nJIT_CONV_U32_R32_end:\n\tGO_NEXT();\n\nJIT_CONV_U32_R64_start:\n\tOPCODE_USE(JIT_CONV_U32_R64);\n\t{\n\t\tU32 value = POP_U32();\n\t\tPUSH_DOUBLE(value);\n\t}\nJIT_CONV_U32_R64_end:\n\tGO_NEXT();\n\nJIT_CONV_I64_U32_start:\nJIT_CONV_U64_U32_start:\n\tOPCODE_USE(JIT_CONV_I64_U32);\n\t{\n\t\tU32 mask = GET_OP();\n\t\tU64 value = POP_U64();\n\t\tPUSH_U32(value & mask);\n\t}\nJIT_CONV_I64_U32_end:\nJIT_CONV_U64_U32_end:\n\tGO_NEXT();\n\nJIT_CONV_I64_I32_start:\nJIT_CONV_U64_I32_start:\n\tOPCODE_USE(JIT_CONV_I64_U32);\n\t{\n\t\tU32 shift = GET_OP();\n\t\tI32 value = (I32)POP_U64();\n\t\tvalue = (value << shift) >> shift;\n\t\tPUSH_U32(value);\n\t}\nJIT_CONV_I64_I32_end:\nJIT_CONV_U64_I32_end:\n\tGO_NEXT();\n\nJIT_CONV_I64_R32_start:\n\tOPCODE_USE(JIT_CONV_I64_R32);\n\t{\n\t\tI64 value = (I64)POP_U64();\n\t\tPUSH_FLOAT(value);\n\t}\nJIT_CONV_I64_R32_end:\n\tGO_NEXT();\n\nJIT_CONV_I64_R64_start:\n\tOPCODE_USE(JIT_CONV_I64_R64);\n\t{\n\t\tI64 value = (I64)POP_U64();\n\t\tPUSH_DOUBLE(value);\n\t}\nJIT_CONV_I64_R64_end:\n\tGO_NEXT();\n\nJIT_CONV_U64_R32_start:\n\tOPCODE_USE(JIT_CONV_U64_R32);\n\t{\n\t\tU64 value = POP_U64();\n\t\tPUSH_FLOAT(value);\n\t}\nJIT_CONV_U64_R32_end:\n\tGO_NEXT();\n\nJIT_CONV_U64_R64_start:\n\tOPCODE_USE(JIT_CONV_U64_R64);\n\t{\n\t\tU64 value = POP_U64();\n\t\tPUSH_DOUBLE(value);\n\t}\nJIT_CONV_U64_R64_end:\n\tGO_NEXT();\n\nJIT_CONV_R32_I32_start:\n\tOPCODE_USE(JIT_CONV_R32_I32);\n\t{\n\t\tU32 shift = GET_OP();\n\t\tI32 result;\n\t\tfloat value = POP_FLOAT();\n\t\tresult = (I32)value;\n\t\tresult = (result << shift) >> shift;\n\t\tPUSH_U32(result);\n\t}\nJIT_CONV_R32_I32_end:\n\tGO_NEXT();\n\nJIT_CONV_R32_U32_start:\n\tOPCODE_USE(JIT_CONV_R32_U32);\n\t{\n\t\tU32 mask = GET_OP();\n\t\tfloat value = POP_FLOAT();\n\t\tPUSH_U32(((U32)value) & mask);\n\t}\nJIT_CONV_R32_U32_end:\n\tGO_NEXT();\n\nJIT_CONV_R32_I64_start:\n\tOPCODE_USE(JIT_CONV_R32_I64);\n\t{\n\t\tfloat value = POP_FLOAT();\n\t\tPUSH_U64((I64)value);\n\t}\nJIT_CONV_R32_I64_end:\n\tGO_NEXT();\n\nJIT_CONV_R32_U64_start:\n\tOPCODE_USE(JIT_CONV_R32_U64);\n\t{\n\t\tfloat value = POP_FLOAT();\n\t\tPUSH_U64(value);\n\t}\nJIT_CONV_R32_U64_end:\n\tGO_NEXT();\n\nJIT_CONV_R32_R64_start:\n\tOPCODE_USE(JIT_CONV_R32_R64);\n\t{\n\t\tfloat value = POP_FLOAT();\n\t\tPUSH_DOUBLE(value);\n\t}\nJIT_CONV_R32_R64_end:\n\tGO_NEXT();\n\nJIT_CONV_R64_I32_start:\n\tOPCODE_USE(JIT_CONV_R64_I32);\n\t{\n\t\tU32 shift = GET_OP();\n\t\tI32 result;\n\t\tdouble value = POP_DOUBLE();\n\t\tresult = (I32)value;\n\t\tresult = (result << shift) >> shift;\n\t\tPUSH_U32(result);\n\t}\nJIT_CONV_R64_I32_end:\n\tGO_NEXT();\n\nJIT_CONV_R64_U32_start:\n\tOPCODE_USE(JIT_CONV_R64_U32);\n\t{\n\t\tU32 mask = GET_OP();\n\t\tdouble value = POP_DOUBLE();\n\t\tPUSH_U32(((U32)value) & mask);\n\t}\nJIT_CONV_R64_U32_end:\n\tGO_NEXT();\n\nJIT_CONV_R64_I64_start:\n\tOPCODE_USE(JIT_CONV_R64_I64);\n\t{\n\t\tfloat value = POP_FLOAT();\n\t\tPUSH_U64((I64)value);\n\t}\nJIT_CONV_R64_I64_end:\n\tGO_NEXT();\n\nJIT_CONV_R64_U64_start:\n\tOPCODE_USE(JIT_CONV_R64_U64);\n\t{\n\t\tdouble value = POP_DOUBLE();\n\t\tPUSH_U64(value);\n\t}\nJIT_CONV_R64_U64_end:\n\tGO_NEXT();\n\nJIT_CONV_R64_R32_start:\n\tOPCODE_USE(JIT_CONV_R64_R32);\n\t{\n\t\tfloat value = (float)POP_DOUBLE();\n\t\tPUSH_FLOAT(value);\n\t}\nJIT_CONV_R64_R32_end:\n\tGO_NEXT();\n\nJIT_LOADFUNCTION_start:\n\tOPCODE_USE(JIT_LOADFUNCTION);\n\t{\n\t\t// This is actually a pointer not a U32\n\t\tU32 value = GET_OP();\n\t\tPUSH_U32(value);\n\t}\nJIT_LOADFUNCTION_end:\n\tGO_NEXT();\n\nJIT_LOADOBJECT_start:\n\tOPCODE_USE(JIT_LOADOBJECT);\n\t{\n\t\ttMD_TypeDef *pTypeDef;\n\t\tPTR pMem;\n\n\t\tpMem = POP_PTR(); // address of value-type\n\t\tpTypeDef = (tMD_TypeDef*)GET_OP(); //type of the value-type\n\t\t//if (pTypeDef->stackSize != pTypeDef->arrayElementSize) {\n\t\t\t// For bytes and int16s we need some special code to ensure that the stack\n\t\t\t// does not contain rubbish in the bits unused in this type.\n\t\t\t// But there is no harm in running this for all types, and it's smaller and probably faster\n\t\t\t*(U32*)pCurEvalStack = 0;\n\t\t//}\n\t\tPUSH_VALUETYPE(pMem, pTypeDef->arrayElementSize, pTypeDef->stackSize);\n\t}\nJIT_LOADOBJECT_end:\n\tGO_NEXT();\n\nJIT_LOAD_STRING_start:\n\tOPCODE_USE(JIT_LOAD_STRING);\n\t{\n\t\tU32 value = GET_OP();\n\t\tPTR heapPtr = SystemString_FromUserStrings(pCurrentMethodState->pMetaData, value);\n\t\tPUSH_O(heapPtr);\n\t}\nJIT_LOAD_STRING_end:\n\tGO_NEXT();\n\nJIT_NEWOBJECT_start:\n\tOPCODE_USE(JIT_NEWOBJECT);\n\t{\n\t\ttMD_MethodDef *pConstructorDef;\n\t\tHEAP_PTR obj;\n\t\ttMethodState *pCallMethodState;\n\t\tU32 isInternalConstructor;\n\t\tPTR pTempPtr;\n\n\t\tpConstructorDef = (tMD_MethodDef*)GET_OP();\n\t\tisInternalConstructor = (pConstructorDef->implFlags & METHODIMPLATTRIBUTES_INTERNALCALL) != 0;\n\n\t\tif (!isInternalConstructor) {\n\t\t\t// All internal constructors MUST allocate their own 'this' objects\n\t\t\tobj = Heap_AllocType(pConstructorDef->pParentType);\n\t\t} else {\n\t\t\t// Need to set this to something non-NULL so that CreateParameters() works properly\n\t\t\tobj = (HEAP_PTR)-1;\n\t\t}\n\n\t\t// Set up the new method state for the called method\n\t\tpCallMethodState = MethodState_Direct(pThread, pConstructorDef, pCurrentMethodState, isInternalConstructor);\n\t\t// Fill in the parameters\n\t\tpTempPtr = pCurEvalStack;\n\t\tCreateParameters(pCallMethodState->pParamsLocals, pConstructorDef, &pTempPtr, obj);\n\t\tpCurEvalStack = pTempPtr;\n\t\tif (!isInternalConstructor) {\n\t\t\t// Push the object here, so it's on the stack when the constructor returns\n\t\t\tPUSH_O(obj);\n\t\t}\n\t\t// Set up the local variables for the new method state (for the obj constructor)\n\t\tCHANGE_METHOD_STATE(pCallMethodState);\n\t\t// Run any pending Finalizers\n\t\tRUN_FINALIZER();\n\t}\nJIT_NEWOBJECT_end:\n\tGO_NEXT_CHECK();\n\nJIT_NEWOBJECT_VALUETYPE_start:\n\tOPCODE_USE(JIT_NEWOBJECT_VALUETYPE);\n\t{\n\t\ttMD_MethodDef *pConstructorDef;\n\t\ttMethodState *pCallMethodState;\n\t\tU32 isInternalConstructor;\n\t\tPTR pTempPtr, pMem;\n\n\t\tpConstructorDef = (tMD_MethodDef*)GET_OP();\n\t\tisInternalConstructor = (pConstructorDef->implFlags & METHODIMPLATTRIBUTES_INTERNALCALL) != 0;\n\n\t\t// Allocate space on the eval-stack for the new value-type here\n\t\tpMem = pCurEvalStack - (pConstructorDef->parameterStackSize - sizeof(PTR));\n\n\t\t// Set up the new method state for the called method\n\t\tpCallMethodState = MethodState_Direct(pThread, pConstructorDef, pCurrentMethodState, isInternalConstructor);\n\t\t// Fill in the parameters\n\t\tpTempPtr = pCurEvalStack;\n\t\tCreateParameters(pCallMethodState->pParamsLocals, pConstructorDef, &pTempPtr, pMem);\n\t\tpCurEvalStack = pTempPtr;\n\t\t// Set the stack state so it's correct for the constructor return\n\t\tpCurEvalStack += pConstructorDef->pParentType->stackSize;\n\t\t// Set up the local variables for the new method state\n\t\tCHANGE_METHOD_STATE(pCallMethodState);\n\t\t// Run any pending Finalizers\n\t\tRUN_FINALIZER();\n\t}\nJIT_NEWOBJECT_VALUETYPE_end:\n\tGO_NEXT_CHECK();\n\nJIT_IS_INSTANCE_start:\n\top = JIT_IS_INSTANCE;\n\tgoto jitCastClass;\nJIT_CAST_CLASS_start:\n\top = JIT_CAST_CLASS;\njitCastClass:\n\tOPCODE_USE(JIT_CAST_CLASS);\n\t{\n\t\ttMD_TypeDef *pToType, *pTestType;\n\t\tHEAP_PTR heapPtr;\n\n\t\tpToType = (tMD_TypeDef*)GET_OP();\n\t\theapPtr = POP_O();\n\t\tif (heapPtr == NULL) {\n\t\t\tPUSH_O(NULL);\n\t\t\tgoto JIT_IS_INSTANCE_end;\n\t\t}\n\t\tpTestType = Heap_GetType(heapPtr);\n\t\tif (TYPE_ISARRAY(pTestType) && TYPE_ISARRAY(pToType)) {\n\t\t\t// Arrays are handled specially - check if the element type is compatible\n\t\t\tif (Type_IsAssignableFrom(pToType->pArrayElementType, pTestType->pArrayElementType)) {\n\t\t\t\tPUSH_O(heapPtr);\n\t\t\t\tgoto JIT_IS_INSTANCE_end;\n\t\t\t}\n\t\t} else {\n\t\t\tif (Type_IsAssignableFrom(pToType, pTestType) ||\n\t\t\t\t(pToType->pGenericDefinition == types[TYPE_SYSTEM_NULLABLE] &&\n\t\t\t\tpToType->ppClassTypeArgs[0] == pTestType)) {\n\t\t\t\t// If derived class, interface, or nullable type compatible.\n\t\t\t\tPUSH_O(heapPtr);\n\t\t\t\tgoto JIT_IS_INSTANCE_end;\n\t\t\t}\n\t\t}\n\t\tif (op == JIT_IS_INSTANCE) {\n\t\t\tPUSH_O(NULL);\n\t\t} else {\n\t\t\tTHROW(types[TYPE_SYSTEM_INVALIDCASTEXCEPTION]);\n\t\t}\n\t}\nJIT_IS_INSTANCE_end:\nJIT_CAST_CLASS_end:\n\tGO_NEXT();\n\nJIT_NEW_VECTOR_start: // Array with 1 dimension, zero-based\n\tOPCODE_USE(JIT_NEW_VECTOR);\n\t{\n\t\ttMD_TypeDef *pArrayTypeDef;\n\t\tU32 numElements;\n\t\tHEAP_PTR heapPtr;\n\n\t\tpArrayTypeDef = (tMD_TypeDef*)GET_OP();\n\t\tnumElements = POP_U32();\n\t\theapPtr = SystemArray_NewVector(pArrayTypeDef, numElements);\n\t\tPUSH_O(heapPtr);\n\t\t// Run any pending Finalizers\n\t\tRUN_FINALIZER();\n\t}\nJIT_NEW_VECTOR_end:\n\tGO_NEXT();\n\nJIT_LOAD_VECTOR_LEN_start: // Load the length of a vector array\n\tOPCODE_USE(JIT_LOAD_VECTOR_LEN);\n\t{\n\t\tPTR heapPtr = POP_O();\n\t\tU32 value = SystemArray_GetLength(heapPtr);\n\t\tPUSH_U32(value);\n\t}\nJIT_LOAD_VECTOR_LEN_end:\n\tGO_NEXT();\n\nJIT_LOAD_ELEMENT_I8_start:\n\tOPCODE_USE(JIT_LOAD_ELEMENT_I8);\n\t{\n\t\tU32 value, idx = POP_U32(); // Array index\n\t\tHEAP_PTR heapPtr = POP_O();\n\t\tSystemArray_LoadElement(heapPtr, idx, (PTR)&value);\n\t\tPUSH_U32((I8)value);\n\t}\nJIT_LOAD_ELEMENT_I8_end:\n\tGO_NEXT();\n\nJIT_LOAD_ELEMENT_U8_start:\n\tOPCODE_USE(JIT_LOAD_ELEMENT_U8);\n\t{\n\t\tU32 value, idx = POP_U32(); // Array index\n\t\tHEAP_PTR heapPtr = POP_O();\n\t\tSystemArray_LoadElement(heapPtr, idx, (PTR)&value);\n\t\tPUSH_U32((U8)value);\n\t}\nJIT_LOAD_ELEMENT_U8_end:\n\tGO_NEXT();\n\nJIT_LOAD_ELEMENT_I16_start:\n\tOPCODE_USE(JIT_LOAD_ELEMENT_I16);\n\t{\n\t\tU32 value, idx = POP_U32(); // Array index\n\t\tHEAP_PTR heapPtr = POP_O();\n\t\tSystemArray_LoadElement(heapPtr, idx, (PTR)&value);\n\t\tPUSH_U32((I16)value);\n\t}\nJIT_LOAD_ELEMENT_I16_end:\n\tGO_NEXT();\n\nJIT_LOAD_ELEMENT_U16_start:\n\tOPCODE_USE(JIT_LOAD_ELEMENT_U16);\n\t{\n\t\tU32 value, idx = POP_U32(); // Array index\n\t\tHEAP_PTR heapPtr = POP_O();\n\t\tSystemArray_LoadElement(heapPtr, idx, (PTR)&value);\n\t\tPUSH_U32((U16)value);\n\t}\nJIT_LOAD_ELEMENT_U16_end:\n\tGO_NEXT();\n\nJIT_LOAD_ELEMENT_I32_start:\nJIT_LOAD_ELEMENT_U32_start:\nJIT_LOAD_ELEMENT_R32_start:\n\tOPCODE_USE(JIT_LOAD_ELEMENT_I32);\n\t{\n\t\tU32 value, idx = POP_U32(); // Array index\n\t\tHEAP_PTR heapPtr = POP_O();\n\t\tSystemArray_LoadElement(heapPtr, idx, (PTR)&value);\n\t\tPUSH_U32(value);\n\t}\nJIT_LOAD_ELEMENT_I32_end:\nJIT_LOAD_ELEMENT_U32_end:\nJIT_LOAD_ELEMENT_R32_end:\n\tGO_NEXT();\n\nJIT_LOAD_ELEMENT_I64_start:\nJIT_LOAD_ELEMENT_R64_start:\n\tOPCODE_USE(JIT_LOAD_ELEMENT_I64);\n\t{\n\t\tU32 idx = POP_U32(); // array index\n\t\tHEAP_PTR heapPtr = POP_O();\n\t\tU64 value;\n\t\tSystemArray_LoadElement(heapPtr, idx, (PTR)&value);\n\t\tPUSH_U64(value);\n\t}\nJIT_LOAD_ELEMENT_I64_end:\nJIT_LOAD_ELEMENT_R64_end:\n\tGO_NEXT();\n\nJIT_LOAD_ELEMENT_start:\n\tOPCODE_USE(JIT_LOAD_ELEMENT);\n\t{\n\t\tU32 idx = POP_U32(); // Array index\n\t\tHEAP_PTR heapPtr = POP_O(); // array object\n\t\tU32 size = GET_OP(); // size of type on stack\n\t\t*(U32*)pCurEvalStack = 0; // This is required to zero out the stack for types that are stored in <4 bytes in arrays\n\t\tSystemArray_LoadElement(heapPtr, idx, pCurEvalStack);\n\t\tpCurEvalStack += size;\n\t}\nJIT_LOAD_ELEMENT_end:\n\tGO_NEXT();\n\nJIT_LOAD_ELEMENT_ADDR_start:\n\tOPCODE_USE(JIT_LOAD_ELEMENT_ADDR);\n\t{\n\t\tU32 idx = POP_U32(); // Array index\n\t\tPTR heapPtr = POP_O();\n\t\tPTR pMem = SystemArray_LoadElementAddress(heapPtr, idx);\n\t\tPUSH_PTR(pMem);\n\t}\nJIT_LOAD_ELEMENT_ADDR_end:\n\tGO_NEXT();\n\nJIT_STORE_ELEMENT_32_start:\n\tOPCODE_USE(JIT_STORE_ELEMENT_32);\n\t{\n\t\tU32 value = POP_U32(); // Value\n\t\tU32 idx = POP_U32(); // Array index\n\t\tPTR heapPtr = POP_O();\n\t\tSystemArray_StoreElement(heapPtr, idx, (PTR)&value);\n\t}\nJIT_STORE_ELEMENT_32_end:\n\tGO_NEXT();\n\nJIT_STORE_ELEMENT_64_start:\n\tOPCODE_USE(JIT_STORE_ELEMENT_64);\n\t{\n\t\tU64 value = POP_U64(); // Value\n\t\tU32 idx = POP_U32(); // Array index\n\t\tPTR heapPtr = POP_O();\n\t\tSystemArray_StoreElement(heapPtr, idx, (PTR)&value);\n\t}\nJIT_STORE_ELEMENT_64_end:\n\tGO_NEXT();\n\nJIT_STORE_ELEMENT_start:\n\tOPCODE_USE(JIT_STORE_ELEMENT);\n\t{\n\t\tHEAP_PTR heapPtr;\n\t\tPTR pMem;\n\t\tU32 idx, size = GET_OP(); // Size in bytes of value on stack\n\t\tPOP(size);\n\t\tpMem = pCurEvalStack;\n\t\tidx = POP_U32(); // Array index\n\t\theapPtr = POP_O(); // Array on heap\n\t\tSystemArray_StoreElement(heapPtr, idx, pMem);\n\t}\nJIT_STORE_ELEMENT_end:\n\tGO_NEXT();\n\nJIT_STOREFIELD_INT32_start:\nJIT_STOREFIELD_O_start:\nJIT_STOREFIELD_INTNATIVE_start: // only for 32-bit\nJIT_STOREFIELD_PTR_start: // only for 32-bit\nJIT_STOREFIELD_F32_start:\n\tOPCODE_USE(JIT_STOREFIELD_INT32);\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\t\tPTR pMem;\n\t\tU32 value;\n\t\tHEAP_PTR heapPtr;\n\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\tvalue = POP_U32();\n\t\theapPtr = POP_O();\n\t\tpMem = heapPtr + pFieldDef->memOffset;\n\t\t*(U32*)pMem = value;\n\t}\nJIT_STOREFIELD_INT32_end:\nJIT_STOREFIELD_O_end:\nJIT_STOREFIELD_INTNATIVE_end:\nJIT_STOREFIELD_PTR_end:\nJIT_STOREFIELD_F32_end:\n\tGO_NEXT();\n\nJIT_STOREFIELD_INT64_start:\nJIT_STOREFIELD_F64_start:\n\tOPCODE_USE(JIT_STOREFIELD_F64);\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\t\tPTR pMem;\n\t\tU64 value;\n\t\tHEAP_PTR heapPtr;\n\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\tvalue = POP_U64();\n\t\theapPtr = POP_O();\n\t\tpMem = heapPtr + pFieldDef->memOffset;\n\t\t*(U64*)pMem = value;\n\t}\nJIT_STOREFIELD_INT64_end:\nJIT_STOREFIELD_F64_end:\n\tGO_NEXT();\n\nJIT_STOREFIELD_VALUETYPE_start:\n\tOPCODE_USE(JIT_STOREFIELD_VALUETYPE);\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\t\tPTR pMem;\n\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\tpCurEvalStack -= pFieldDef->memSize;\n\t\tpMem = pCurEvalStack;\n\t\theapPtr = POP_O();\n\t\tmemcpy(heapPtr + pFieldDef->memOffset, pMem, pFieldDef->memSize);\n\t}\nJIT_STOREFIELD_VALUETYPE_end:\n\tGO_NEXT();\n\nJIT_LOADFIELD_start:\n\tOPCODE_USE(JIT_LOADFIELD);\n\t// TODO: Optimize into LOADFIELD of different types O, INT32, INT64, F, etc...)\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\theapPtr = POP_O();\n\t\tpMem = heapPtr + pFieldDef->memOffset;\n\t\t// It may not be a value-type, but this'll work anyway\n\t\tPUSH_VALUETYPE(pMem, pFieldDef->memSize, pFieldDef->memSize);\n\t}\nJIT_LOADFIELD_end:\n\tGO_NEXT();\n\nJIT_LOADFIELD_4_start:\n\tOPCODE_USE(JIT_LOADFIELD_4);\n\t{\n\t\tU32 ofs = GET_OP();\n\t\tPTR heapPtr = POP_O();\n\t\tPUSH_U32(*(U32*)(heapPtr + ofs));\n\t}\nJIT_LOADFIELD_4_end:\n\tGO_NEXT();\n\nJIT_LOADFIELD_VALUETYPE_start:\n\tOPCODE_USE(JIT_LOADFIELD_VALUETYPE);\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\n\t\tu32Value = GET_OP(); // Get the size of the value-type on the eval stack\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\tpCurrentMethodState->stackOfs -= u32Value;\n\t\t//pMem = pEvalStack + pCurrentMethodState->stackOfs + pFieldDef->memOffset;\n\t\tpMem = pCurEvalStack + pFieldDef->memOffset;\n\t\t// It may not be a value-type, but this'll work anyway\n\t\tPUSH_VALUETYPE(pMem, pFieldDef->memSize, pFieldDef->memSize);\n\t}\nJIT_LOADFIELD_VALUETYPE_end:\n\tGO_NEXT();\n\nJIT_LOAD_FIELD_ADDR_start:\n\tOPCODE_USE(JIT_LOAD_FIELD_ADDR);\n\t{\n\t\tU32 ofs = GET_OP();\n\t\tHEAP_PTR heapPtr = POP_O();\n\t\tPTR pMem = heapPtr + ofs;\n\t\tPUSH_PTR(pMem);\n\t}\nJIT_LOAD_FIELD_ADDR_end:\n\tGO_NEXT();\n\nJIT_STORESTATICFIELD_INT32_start:\nJIT_STORESTATICFIELD_F32_start:\nJIT_STORESTATICFIELD_O_start: // only for 32-bit\nJIT_STORESTATICFIELD_INTNATIVE_start: // only for 32-bit\nJIT_STORESTATICFIELD_PTR_start: // only for 32-bit\n\tOPCODE_USE(JIT_STORESTATICFIELD_INT32);\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\t\tPTR pMem;\n\t\tU32 value;\n\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\tvalue = POP_U32();\n\t\tpMem = pFieldDef->pMemory;\n\t\t*(U32*)pMem = value;\n\t}\nJIT_STORESTATICFIELD_INT32_end:\nJIT_STORESTATICFIELD_F32_end:\nJIT_STORESTATICFIELD_O_end:\nJIT_STORESTATICFIELD_INTNATIVE_end:\nJIT_STORESTATICFIELD_PTR_end:\n\tGO_NEXT();\n\nJIT_STORESTATICFIELD_F64_start:\nJIT_STORESTATICFIELD_INT64_start:\n\tOPCODE_USE(JIT_STORESTATICFIELD_INT64);\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\t\tPTR pMem;\n\t\tU64 value;\n\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\tvalue = POP_U64();\n\t\t//pMem = pFieldDef->pParentType->pStaticFields + pFieldDef->memOffset;\n\t\tpMem = pFieldDef->pMemory;\n\t\t*(U64*)pMem = value;\n\t}\nJIT_STORESTATICFIELD_F64_end:\nJIT_STORESTATICFIELD_INT64_end:\n\tGO_NEXT();\n\nJIT_STORESTATICFIELD_VALUETYPE_start:\n\tOPCODE_USE(JIT_STORESTATICFIELD_VALUETYPE);\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\t\tPTR pMem;\n\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\tpMem = pFieldDef->pMemory;\n\t\tPOP_VALUETYPE(pMem, pFieldDef->memSize, pFieldDef->memSize);\n\t}\nJIT_STORESTATICFIELD_VALUETYPE_end:\n\tGO_NEXT();\n\nJIT_LOADSTATICFIELDADDRESS_CHECKTYPEINIT_start:\n\top = JIT_LOADSTATICFIELDADDRESS_CHECKTYPEINIT;\n\tgoto loadStaticFieldStart;\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_VALUETYPE_start:\n\top = JIT_LOADSTATICFIELD_CHECKTYPEINIT_VALUETYPE;\n\tgoto loadStaticFieldStart;\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_F64_start:\n\top = JIT_LOADSTATICFIELD_CHECKTYPEINIT_F64;\n\tgoto loadStaticFieldStart;\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_INT32_start:\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_F32_start:\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_O_start: // Only for 32-bit\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_INTNATIVE_start: // Only for 32-bit\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_PTR_start: // Only for 32-bit\n\top = 0;\nloadStaticFieldStart:\n\tOPCODE_USE(JIT_LOADSTATICFIELD_CHECKTYPEINIT_INT32);\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\t\ttMD_TypeDef *pParentType;\n\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\tpParentType = pFieldDef->pParentType;\n\t\t// Check that any type (static) constructor has been called\n\t\tif (pParentType->isTypeInitialised == 0) {\n\t\t\t// Set the state to initialised\n\t\t\tpParentType->isTypeInitialised = 1;\n\t\t\t// Initialise the type (if there is a static constructor)\n\t\t\tif (pParentType->pStaticConstructor != NULL) {\n\t\t\t\ttMethodState *pCallMethodState;\n\n\t\t\t\t// Call static constructor\n\t\t\t\t// Need to re-run this instruction when we return from static constructor call\n\t\t\t\t//pCurrentMethodState->ipOffset -= 2;\n\t\t\t\tpCurOp -= 2;\n\t\t\t\tpCallMethodState = MethodState_Direct(pThread, pParentType->pStaticConstructor, pCurrentMethodState, 0);\n\t\t\t\t// There can be no parameters, so don't need to set them up\n\t\t\t\tCHANGE_METHOD_STATE(pCallMethodState);\n\t\t\t\tGO_NEXT_CHECK();\n\t\t\t}\n\t\t}\n\t\tif (op == JIT_LOADSTATICFIELD_CHECKTYPEINIT_F64) {\n\t\t\tU64 value;\n\t\t\tvalue = *(U64*)(pFieldDef->pMemory);\n\t\t\tPUSH_U64(value);\n\t\t} else if (op == JIT_LOADSTATICFIELD_CHECKTYPEINIT_VALUETYPE) {\n\t\t\tPUSH_VALUETYPE(pFieldDef->pMemory, pFieldDef->memSize, pFieldDef->memSize);\n\t\t} else {\n\t\t\tU32 value;\n\t\t\tif (op == JIT_LOADSTATICFIELDADDRESS_CHECKTYPEINIT) {\n\t\t\t\tvalue = (U32)(pFieldDef->pMemory);\n\t\t\t} else {\n\t\t\t\tvalue = *(U32*)pFieldDef->pMemory;\n\t\t\t}\n\t\t\tPUSH_U32(value);\n\t\t}\n\t}\nJIT_LOADSTATICFIELDADDRESS_CHECKTYPEINIT_end:\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_VALUETYPE_end:\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_INT32_end:\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_F32_end:\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_F64_end:\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_O_end:\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_INTNATIVE_end:\nJIT_LOADSTATICFIELD_CHECKTYPEINIT_PTR_end:\n\tGO_NEXT();\n\nJIT_INIT_VALUETYPE_start:\n\tOPCODE_USE(JIT_INIT_VALUETYPE);\n\t{\n\t\ttMD_TypeDef *pTypeDef;\n\n\t\tpTypeDef = (tMD_TypeDef*)GET_OP();\n\t\tpMem = POP_PTR();\n\t\tmemset(pMem, 0, pTypeDef->instanceMemSize);\n\t}\nJIT_INIT_VALUETYPE_end:\n\tGO_NEXT();\n\nJIT_INIT_OBJECT_start:\n\tOPCODE_USE(JIT_INIT_OBJECT);\n\t{\n\t\tPTR pMem = POP_PTR();\n\t\t*(void**)pMem = NULL;\n\t}\nJIT_INIT_OBJECT_end:\n\tGO_NEXT();\n\nJIT_BOX_INT32_start:\nJIT_BOX_F32_start:\nJIT_BOX_INTNATIVE_start:\n\tOPCODE_USE(JIT_BOX_INT32);\n\t{\n\t\ttMD_TypeDef *pTypeDef;\n\n\t\tpTypeDef = (tMD_TypeDef*)GET_OP();\n\t\theapPtr = Heap_AllocType(pTypeDef);\n\t\tu32Value = POP_U32();\n\t\t*(U32*)heapPtr = u32Value;\n\t\tPUSH_O(heapPtr);\n\t}\nJIT_BOX_INT32_end:\nJIT_BOX_F32_end:\nJIT_BOX_INTNATIVE_end:\n\tGO_NEXT();\n\nJIT_BOX_INT64_start:\nJIT_BOX_F64_start:\nOPCODE_USE(JIT_BOX_INT64);\n\t{\n\t\ttMD_TypeDef *pTypeDef = (tMD_TypeDef*)GET_OP();\n\t\theapPtr = Heap_AllocType(pTypeDef);\n\t\t*(U64*)heapPtr = POP_U64();\n\t\tPUSH_O(heapPtr);\n\t}\nJIT_BOX_INT64_end:\nJIT_BOX_F64_end:\n\tGO_NEXT();\n\nJIT_BOX_VALUETYPE_start:\n\tOPCODE_USE(JIT_BOX_VALUETYPE);\n\t{\n\t\ttMD_TypeDef *pTypeDef;\n\n\t\tpTypeDef = (tMD_TypeDef*)GET_OP();\n\t\theapPtr = Heap_AllocType(pTypeDef);\n\t\tPOP_VALUETYPE(heapPtr, pTypeDef->stackSize, pTypeDef->stackSize);\n\t\tPUSH_O(heapPtr);\n\t}\nJIT_BOX_VALUETYPE_end:\n\tGO_NEXT();\n\nJIT_BOX_O_start:\n\tpCurOp++;\n\t// Fall-through\nJIT_UNBOX2OBJECT_start: // TODO: This is not correct - it should check the type, just like CAST_CLASS\n\tOPCODE_USE(JIT_UNBOX2OBJECT);\n\t// Nothing to do\nJIT_BOX_O_end:\nJIT_UNBOX2OBJECT_end:\n\tGO_NEXT();\n\nJIT_BOX_NULLABLE_start:\n\tOPCODE_USE(JIT_BOX_NULLABLE);\n\t{\n\t\t// Get the underlying type of the nullable type\n\t\ttMD_TypeDef *pType = (tMD_TypeDef*)GET_OP();\n\n\t\t// Take the nullable type off the stack. The +4 is because the of the HasValue field (Bool, size = 4 bytes)\n\t\tpCurEvalStack -= pType->stackSize + 4;\n\t\t// If .HasValue\n\t\tif (*(U32*)pCurEvalStack) {\n\t\t\t// Box the underlying type\n\t\t\tHEAP_PTR boxed;\n\t\t\tboxed = Heap_Box(pType, pCurEvalStack + 4);\n\t\t\tPUSH_O(boxed);\n\t\t} else {\n\t\t\t// Put a NULL pointer on the stack\n\t\t\tPUSH_O(NULL);\n\t\t}\n\t}\nJIT_BOX_NULLABLE_end:\n\tGO_NEXT();\n\nJIT_UNBOX2VALUETYPE_start:\n\tOPCODE_USE(JIT_UNBOX2VALUETYPE);\n\t{\n\t\ttMD_TypeDef *pTypeDef;\n\t\tHEAP_PTR heapPtr;\n\n\t\theapPtr = POP_O();\n\t\tpTypeDef = Heap_GetType(heapPtr);\n\t\tPUSH_VALUETYPE(heapPtr, pTypeDef->stackSize, pTypeDef->stackSize);\n\t}\nJIT_UNBOX2VALUETYPE_end:\n\tGO_NEXT();\n\nJIT_UNBOX_NULLABLE_start:\n\tOPCODE_USE(JIT_UNBOX_NULLABLE);\n\t{\n\t\ttMD_TypeDef *pTypeDef = (tMD_TypeDef*)GET_OP();\n\t\tHEAP_PTR heapPtr;\n\t\theapPtr = POP_O();\n\t\tif (heapPtr == NULL) {\n\t\t\t// Push .HasValue (= false)\n\t\t\tPUSH_U32(0);\n\t\t\t// And increase the stack pointer by the size of the underlying type\n\t\t\t// (the contents don't matter)\n\t\t\tpCurEvalStack += pTypeDef->stackSize;\n\t\t} else {\n\t\t\t// Push .HasValue (= true)\n\t\t\tPUSH_U32(1);\n\t\t\t// Push the contents of .Value\n\t\t\tPUSH_VALUETYPE(heapPtr, pTypeDef->stackSize, pTypeDef->stackSize);\n\t\t}\n\t}\nJIT_UNBOX_NULLABLE_end:\n\tGO_NEXT();\n\nJIT_LOADTOKEN_TYPE_start:\n\tOPCODE_USE(JIT_LOADTOKEN_TYPE);\n\t{\n\t\ttMD_TypeDef *pTypeDef;\n\n\t\tpTypeDef = (tMD_TypeDef*)GET_OP();\n\t\t// Push new valuetype onto evaluation stack\n\t\tPUSH_PTR((PTR)pTypeDef);\n\t}\nJIT_LOADTOKEN_TYPE_end:\n\tGO_NEXT();\n\nJIT_LOADTOKEN_FIELD_start:\n\tOPCODE_USE(JIT_LOADTOKEN_FIELD);\n\t{\n\t\ttMD_FieldDef *pFieldDef;\n\n\t\tpFieldDef = (tMD_FieldDef*)GET_OP();\n\t\t// Push new valuetype onto evaluation stack - only works on static fields.\n\t\tPUSH_PTR(pFieldDef->pMemory);\n\t}\nJIT_LOADTOKEN_FIELD_end:\n\tGO_NEXT();\n\nJIT_RETHROW_start:\n\top = JIT_RETHROW;\n\tgoto throwStart;\nJIT_THROW_start:\n\top = JIT_THROW;\nthrowStart:\n\tOPCODE_USE(JIT_THROW);\n\t{\n\t\tU32 i;\n\t\ttExceptionHeader *pCatch;\n\t\ttMethodState *pCatchMethodState;\n\t\ttMD_TypeDef *pExType;\n\n\t\t// Get the exception object\n\t\tif (op == JIT_RETHROW) {\n\t\t\theapPtr = pThread->pCurrentExceptionObject;\n\t\t} else {\n\t\t\theapPtr = POP_O();\nthrowHeapPtr:\n\t\t\tpThread->pCurrentExceptionObject = heapPtr;\n\t\t}\n\t\tSAVE_METHOD_STATE();\n\t\tpExType = Heap_GetType(heapPtr);\n\t\t// Find any catch exception clauses; look in the complete call stack\n\t\tpCatch = NULL;\n\t\tpCatchMethodState = pCurrentMethodState;\n\t\tfor(;;) {\n\t\t\tfor (i=0; i<pCatchMethodState->pMethod->pJITted->numExceptionHandlers; i++) {\n\t\t\t\ttExceptionHeader *pEx = &pCatchMethodState->pMethod->pJITted->pExceptionHeaders[i];\n\t\t\t\tif (pEx->flags == COR_ILEXCEPTION_CLAUSE_EXCEPTION &&\n\t\t\t\t\tpCatchMethodState->ipOffset - 1 >= pEx->tryStart &&\n\t\t\t\t\tpCatchMethodState->ipOffset - 1 < pEx->tryEnd &&\n\t\t\t\t\tType_IsDerivedFromOrSame(pEx->u.pCatchTypeDef, pExType)) {\n\t\t\t\t\t\n\t\t\t\t\t// Found the correct catch clause to jump to\n\t\t\t\t\tpCatch = pEx;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pCatch != NULL) {\n\t\t\t\t// Found a suitable exception handler\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpCatchMethodState = pCatchMethodState->pCaller;\n\t\t\tif (pCatchMethodState == NULL) {\n\t\t\t\tCrash(\"Unhandled exception in %s.%s(): %s.%s\",\n\t\t\t\t\tpCurrentMethodState->pMethod->pParentType->name,\n\t\t\t\t\tpCurrentMethodState->pMethod->name, pExType->nameSpace, pExType->name);\n\t\t\t}\n\t\t}\n\t\t// Unwind the stack down to the exception handler's stack frame (MethodState)\n\t\t// Run all finally clauses during unwinding\n\t\tpThread->pCatchMethodState = pCatchMethodState;\n\t\tpThread->pCatchExceptionHandler = pCatch;\n\t\t// Have to use the pThread->pCatchMethodState, as we could be getting here from END_FINALLY\n\t\twhile (pCurrentMethodState != pThread->pCatchMethodState) {\n\t\t\ttMethodState *pPrevState;\n\nfinallyUnwindStack:\n\t\t\tfor (i=pThread->nextFinallyUnwindStack; i<pCurrentMethodState->pMethod->pJITted->numExceptionHandlers; i++) {\n\t\t\t\ttExceptionHeader *pEx;\n\n\t\t\t\tpEx = &pCurrentMethodState->pMethod->pJITted->pExceptionHeaders[i];\n\t\t\t\tif (pEx->flags == COR_ILEXCEPTION_CLAUSE_FINALLY &&\n\t\t\t\t\tpCurrentMethodState->ipOffset - 1 >= pEx->tryStart &&\n\t\t\t\t\tpCurrentMethodState->ipOffset - 1 < pEx->tryEnd) {\n\n\t\t\t\t\t// Found a finally handler\n\t\t\t\t\tPOP_ALL();\n\t\t\t\t\tCHANGE_METHOD_STATE(pCurrentMethodState);\n\t\t\t\t\tpCurrentMethodState->ipOffset = pEx->handlerStart;\n\t\t\t\t\t// Keep track of which finally clause should be executed next\n\t\t\t\t\tpThread->nextFinallyUnwindStack = i + 1;\n\t\t\t\t\tgoto throwEnd;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpPrevState = pCurrentMethodState->pCaller;\n\t\t\tMethodState_Delete(pThread, &pCurrentMethodState);\n\t\t\tpCurrentMethodState = pPrevState;\n\t\t\t// Reset the stack unwind tracker\n\t\t\tpThread->nextFinallyUnwindStack = 0;\n\t\t}\n\t\t// Set the IP to the catch handler\n\t\tpCurrentMethodState->ipOffset = pThread->pCatchExceptionHandler->handlerStart;\n\t\t// Set the current method state\n\t\tLOAD_METHOD_STATE();\n\t\t// Push onto this stack-frame's evaluation stack the opject thrown\n\t\tPOP_ALL();\n\t\tPUSH_O(pThread->pCurrentExceptionObject);\n\t}\nthrowEnd:\nJIT_THROW_end:\nJIT_RETHROW_end:\n\tGO_NEXT_CHECK();\n\nJIT_LEAVE_start:\n\tOPCODE_USE(JIT_LEAVE);\n\t{\n\t\tU32 i;\n\t\ttExceptionHeader *pFinally;\n\n\t\t// Find any finally exception clauses\n\t\tpFinally = NULL;\n\t\tfor (i=0; i<pJIT->numExceptionHandlers; i++) {\n\t\t\tif (pJIT->pExceptionHeaders[i].flags == COR_ILEXCEPTION_CLAUSE_FINALLY &&\n\t\t\t\tpCurrentMethodState->ipOffset - 1 >= pJIT->pExceptionHeaders[i].tryStart &&\n\t\t\t\tpCurrentMethodState->ipOffset - 1 < pJIT->pExceptionHeaders[i].tryEnd) {\n\t\t\t\t// Found the correct finally clause to jump to\n\t\t\t\tpFinally = &pJIT->pExceptionHeaders[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tPOP_ALL();\n\t\tofs = GET_OP();\n\t\tif (pFinally != NULL) {\n\t\t\t// Jump to 'finally' section\n\t\t\tpCurOp = pOps + pFinally->handlerStart;\n\t\t\tpCurrentMethodState->pOpEndFinally = pOps + ofs;\n\t\t} else {\n\t\t\t// just branch\n\t\t\tpCurOp = pOps + ofs;\n\t\t}\n\t}\nJIT_LEAVE_end:\n\tGO_NEXT_CHECK();\n\nJIT_END_FINALLY_start:\n\tOPCODE_USE(JIT_END_FINALLY);\n\tif (pThread->nextFinallyUnwindStack > 0) {\n\t\t// unwinding stack, so jump back to unwind code\n\t\tgoto finallyUnwindStack;\n\t} else {\n\t\t// Just empty the evaluation stack and continue on to the next opcode\n\t\t// (finally blocks are always after catch blocks, so execution can just continue)\n\t\tPOP_ALL();\n\t\t// And jump to the correct instruction, as specified in the leave instruction\n\t\tpCurOp = pCurrentMethodState->pOpEndFinally;\n\t}\nJIT_END_FINALLY_end:\n\tGO_NEXT_CHECK();\n\ndone:\n\tSAVE_METHOD_STATE();\n\n\treturn THREAD_STATUS_RUNNING;\n}\n\nvoid JIT_Execute_Init() {\n\t// Initialise the JIT code addresses\n\tJIT_Execute(NULL, 0);\n}"
  },
  {
    "path": "dna/JIT_OpCodes.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__JIT_OPCODES_H)\n#define __JIT_OPCODES_H\n\n#include \"EvalStack.h\"\n\n// JIT opcodes may be up to 9 bits long\n#define JIT_OPCODE_MAXBITS 9\n#define JIT_OPCODE_MAXNUM (1 << JIT_OPCODE_MAXBITS)\n//#define JIT_OPCODE_MASK ((1 << JIT_OPCODE_MAXBITS) - 1)\n//#define JIT_OPCODE(opCode) ((opCode) & JIT_OPCODE_MASK)\n//#define JIT_PARAM(opCode) ((opCode) >> JIT_OPCODE_MAXBITS)\n\n// Note that the exact order of some of these op-codes matters.\n// This is due to optimisations where groups of opcodes can be handled together\n\n#define JIT_NOP\t\t\t\t\t\t0x0\n#define JIT_RETURN\t\t\t\t\t0x1\n#define JIT_LOAD_I32\t\t\t\t0x2\n#define JIT_BRANCH\t\t\t\t\t0x3\n#define JIT_LOAD_STRING\t\t\t\t0x4\n#define JIT_CALLVIRT_O\t\t\t\t0x5\n#define JIT_CALL_NATIVE\t\t\t\t0x6\n#define JIT_CALL_O\t\t\t\t\t0x7\n#define JIT_NEWOBJECT\t\t\t\t0x8\n#define JIT_LOAD_PARAMLOCAL_ADDR\t0x9\n#define JIT_CALL_PTR\t\t\t\t0xa\n#define JIT_BOX_CALLVIRT\t\t\t0xb\n#define JIT_INIT_VALUETYPE\t\t\t0xc\n#define JIT_NEW_VECTOR\t\t\t\t0xd\n#define JIT_NEWOBJECT_VALUETYPE\t\t0xe\n#define JIT_IS_INSTANCE\t\t\t\t0xf\n#define JIT_LOAD_NULL\t\t\t\t0x10\n#define JIT_UNBOX2VALUETYPE\t\t\t0x11\n#define JIT_UNBOX2OBJECT\t\t\t0x12\n#define JIT_LOAD_FIELD_ADDR\t\t\t0x13\n#define JIT_DUP_GENERAL\t\t\t\t0x14\n#define JIT_POP\t\t\t\t\t\t0x15\n#define JIT_STORE_OBJECT_VALUETYPE\t0x16\n#define JIT_DEREF_CALLVIRT\t\t\t0x17\n#define JIT_STORE_ELEMENT\t\t\t0x18\n#define JIT_LEAVE\t\t\t\t\t0x19\n#define JIT_END_FINALLY\t\t\t\t0x1a\n#define JIT_THROW\t\t\t\t\t0x1b\n#define JIT_RETHROW\t\t\t\t\t0x1c\n#define JIT_LOADOBJECT\t\t\t\t0x1d\n#define JIT_LOAD_VECTOR_LEN\t\t\t0x1e\n#define JIT_SWITCH\t\t\t\t\t0x1f\n#define JIT_LOAD_ELEMENT_ADDR\t\t0x20\n#define JIT_CALL_INTERFACE\t\t\t0x21\n#define JIT_CAST_CLASS\t\t\t\t0x22\n#define JIT_LOAD_ELEMENT\t\t\t0x23\n#define JIT_LOADFIELD_VALUETYPE\t\t0x24\n#define\tJIT_LOADFIELD\t\t\t\t0x25\n#define JIT_LOADFUNCTION\t\t\t0x26\n#define JIT_INVOKE_DELEGATE\t\t\t0x27\n#define JIT_CALL_PINVOKE\t\t\t0x28\n#define JIT_LOAD_I64\t\t\t\t0x29\n#define JIT_INIT_OBJECT\t\t\t\t0x2a\n#define JIT_DUP_4\t\t\t\t\t0x2b\n#define JIT_DUP_8\t\t\t\t\t0x2c\n#define JIT_LOADSTATICFIELDADDRESS_CHECKTYPEINIT\t0x2d\n#define JIT_POP_4\t\t\t\t\t0x2e\n#define JIT_LOAD_F32\t\t\t\t0x2f\n\n#define JIT_LOADPARAMLOCAL_TYPEID\t\t0x30\n#define JIT_LOADPARAMLOCAL_INT64\t\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_INT64)\n#define JIT_LOADPARAMLOCAL_INT32\t\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_INT32)\n#define JIT_LOADPARAMLOCAL_INTNATIVE\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_INTNATIVE)\n//#define JIT_LOADPARAMLOCAL_F\t\t\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_F)\n#define JIT_LOADPARAMLOCAL_F32\t\t\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_F32)\n#define JIT_LOADPARAMLOCAL_PTR\t\t\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_PTR)\n#define JIT_LOADPARAMLOCAL_O\t\t\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_O)\n//#define JIT_LOADPARAMLOCAL_TRANSPTR\t\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_TRANSPTR)\n#define JIT_LOADPARAMLOCAL_F64\t\t\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_F64)\n#define JIT_LOADPARAMLOCAL_VALUETYPE\t(JIT_LOADPARAMLOCAL_TYPEID + EVALSTACK_VALUETYPE)\n\n#define JIT_STOREPARAMLOCAL_TYPEID\t\t0x38\n#define JIT_STOREPARAMLOCAL_INT64\t\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_INT64)\n#define JIT_STOREPARAMLOCAL_INT32\t\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_INT32)\n#define JIT_STOREPARAMLOCAL_INTNATIVE\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_INTNATIVE)\n//#define JIT_STOREPARAMLOCAL_F\t\t\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_F)\n#define JIT_STOREPARAMLOCAL_F32\t\t\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_F32)\n#define JIT_STOREPARAMLOCAL_PTR\t\t\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_PTR)\n#define JIT_STOREPARAMLOCAL_O\t\t\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_O)\n//#define JIT_STOREPARAMLOCAL_TRANSPTR\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_TRANSPTR)\n#define JIT_STOREPARAMLOCAL_F64\t\t\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_F64)\n#define JIT_STOREPARAMLOCAL_VALUETYPE\t(JIT_STOREPARAMLOCAL_TYPEID + EVALSTACK_VALUETYPE)\n\n#define JIT_STOREFIELD_TYPEID\t\t0x48\n#define JIT_STOREFIELD_INT64\t\t(JIT_STOREFIELD_TYPEID + EVALSTACK_INT64)\n#define JIT_STOREFIELD_INT32\t\t(JIT_STOREFIELD_TYPEID + EVALSTACK_INT32)\n#define JIT_STOREFIELD_INTNATIVE\t(JIT_STOREFIELD_TYPEID + EVALSTACK_INTNATIVE)\n//#define JIT_STOREFIELD_F\t\t\t(JIT_STOREFIELD_TYPEID + EVALSTACK_F)\n#define JIT_STOREFIELD_F32\t\t\t(JIT_STOREFIELD_TYPEID + EVALSTACK_F32)\n#define JIT_STOREFIELD_PTR\t\t\t(JIT_STOREFIELD_TYPEID + EVALSTACK_PTR)\n#define JIT_STOREFIELD_O\t\t\t(JIT_STOREFIELD_TYPEID + EVALSTACK_O)\n//#define JIT_STOREFIELD_TRANSPTR\t\t(JIT_STOREFIELD_TYPEID + EVALSTACK_TRANSPTR)\n#define JIT_STOREFIELD_F64\t\t\t(JIT_STOREFIELD_TYPEID + EVALSTACK_F64)\n#define JIT_STOREFIELD_VALUETYPE\t(JIT_STOREFIELD_TYPEID + EVALSTACK_VALUETYPE)\n\n#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID\t0x50\n#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_INT64\t\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_INT64)\n#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_INT32\t\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_INT32)\n#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_INTNATIVE\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_INTNATIVE)\n//#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_F\t\t\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_F)\n#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_F32\t\t\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_F32)\n#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_PTR\t\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_PTR)\n#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_O\t\t\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_O)\n//#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_TRANSPTR\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_TRANSPTR)\n#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_F64\t\t\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_F64)\n#define JIT_LOADSTATICFIELD_CHECKTYPEINIT_VALUETYPE\t(JIT_LOADSTATICFIELD_CHECKTYPEINIT_TYPEID + EVALSTACK_VALUETYPE)\n\n#define JIT_LOADSTATICFIELD_TYPEID\t\t0x58\n#define JIT_LOADSTATICFIELD_INT64\t\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_INT64)\n#define JIT_LOADSTATICFIELD_INT32\t\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_INT32)\n#define JIT_LOADSTATICFIELD_INTNATIVE\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_INTNATIVE)\n//#define JIT_LOADSTATICFIELD_F\t\t\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_F)\n#define JIT_LOADSTATICFIELD_F32\t\t\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_F32)\n#define JIT_LOADSTATICFIELD_PTR\t\t\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_PTR)\n#define JIT_LOADSTATICFIELD_O\t\t\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_O)\n//#define JIT_LOADSTATICFIELD_TRANSPTR\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_TRANSPTR)\n#define JIT_LOADSTATICFIELD_F64\t\t\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_F64)\n#define JIT_LOADSTATICFIELD_VALUEPTYE\t(JIT_LOADSTATICFIELD_TYPEID + EVALSTACK_VALUETYPE)\n\n#define JIT_STORESTATICFIELD_TYPEID\t\t0x60\n#define JIT_STORESTATICFIELD_INT64\t\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_INT64)\n#define JIT_STORESTATICFIELD_INT32\t\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_INT32)\n#define JIT_STORESTATICFIELD_INTNATIVE\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_INTNATIVE)\n//#define JIT_STORESTATICFIELD_F\t\t\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_F)\n#define JIT_STORESTATICFIELD_F32\t\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_F32)\n#define JIT_STORESTATICFIELD_F64\t\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_F64)\n#define JIT_STORESTATICFIELD_PTR\t\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_PTR)\n#define JIT_STORESTATICFIELD_O\t\t\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_O)\n//#define JIT_STORESTATICFIELD_TRANSPTR\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_TRANSPTR)\n#define JIT_STORESTATICFIELD_VALUETYPE\t(JIT_STORESTATICFIELD_TYPEID + EVALSTACK_VALUETYPE)\n\n#define JIT_BOX_TYPEID\t\t0x68\n#define JIT_BOX_INT64\t\t(JIT_BOX_TYPEID + EVALSTACK_INT64)\n#define JIT_BOX_INT32\t\t(JIT_BOX_TYPEID + EVALSTACK_INT32)\n#define JIT_BOX_INTNATIVE\t(JIT_BOX_TYPEID + EVALSTACK_INTNATIVE)\n//#define JIT_BOX_F\t\t\t(JIT_BOX_TYPEID + EVALSTACK_F)\n#define JIT_BOX_F32\t\t\t(JIT_BOX_TYPEID + EVALSTACK_F32)\n#define JIT_BOX_PTR\t\t\t(JIT_BOX_TYPEID + EVALSTACK_PTR)\n#define JIT_BOX_O\t\t\t(JIT_BOX_TYPEID + EVALSTACK_O)\n//#define JIT_BOX_TRANSPTR\t(JIT_BOX_TYPEID + EVALSTACK_TRANSPTR)\n#define JIT_BOX_F64\t\t\t(JIT_BOX_TYPEID + EVALSTACK_F64)\n#define JIT_BOX_VALUETYPE\t(JIT_BOX_TYPEID + EVALSTACK_VALUETYPE)\n\n#define JIT_CEQ_I32I32\t\t\t0x70\n#define JIT_CGT_I32I32\t\t\t0x71\n#define JIT_CGT_UN_I32I32\t\t0x72\n#define JIT_CLT_I32I32\t\t\t0x73\n#define JIT_CLT_UN_I32I32\t\t0x74\n\n#define JIT_CEQ_I64I64\t\t\t0x75\n#define JIT_CGT_I64I64\t\t\t0x76\n#define JIT_CGT_UN_I64I64\t\t0x77\n#define JIT_CLT_I64I64\t\t\t0x78\n#define JIT_CLT_UN_I64I64\t\t0x79\n\n#define JIT_ADD_OVF_I32I32\t\t0x7a\n#define JIT_ADD_OVF_UN_I32I32\t0x7b\n#define JIT_MUL_OVF_I32I32\t\t0x7c\n#define JIT_MUL_OVF_UN_I32I32\t0x7d\n#define JIT_SUB_OVF_I32I32\t\t0x7e\n#define JIT_SUB_OVF_UN_I32I32\t0x7f\n#define JIT_ADD_I32I32\t\t\t0x80\n#define JIT_SUB_I32I32\t\t\t0x81\n#define JIT_MUL_I32I32\t\t\t0x82\n#define JIT_DIV_I32I32\t\t\t0x83\n#define JIT_DIV_UN_I32I32\t\t0x84\n#define JIT_REM_I32I32\t\t\t0x85\n#define JIT_REM_UN_I32I32\t\t0x86\n#define JIT_AND_I32I32\t\t\t0x87\n#define JIT_OR_I32I32\t\t\t0x88\n#define JIT_XOR_I32I32\t\t\t0x89\n\n#define JIT_NEG_I32\t\t\t\t0x8a\n#define JIT_NOT_I32\t\t\t\t0x8b\n#define JIT_NEG_I64\t\t\t\t0x8c\n#define JIT_NOT_I64\t\t\t\t0x8d\n\n#define JIT_BOX_NULLABLE\t\t0x8e\n#define JIT_LOAD_F64\t\t\t0x8f\n\n#define JIT_BEQ_I32I32\t\t\t0x90\n#define JIT_BGE_I32I32\t\t\t0x91\n#define JIT_BGT_I32I32\t\t\t0x92\n#define JIT_BLE_I32I32\t\t\t0x93\n#define JIT_BLT_I32I32\t\t\t0x94\n#define JIT_BNE_UN_I32I32\t\t0x95\n#define JIT_BGE_UN_I32I32\t\t0x96\n#define JIT_BGT_UN_I32I32\t\t0x97\n#define JIT_BLE_UN_I32I32\t\t0x98\n#define JIT_BLT_UN_I32I32\t\t0x99\n\n#define JIT_BEQ_I64I64\t\t\t0x9a\n#define JIT_BGE_I64I64\t\t\t0x9b\n#define JIT_BGT_I64I64\t\t\t0x9c\n#define JIT_BLE_I64I64\t\t\t0x9d\n#define JIT_BLT_I64I64\t\t\t0x9e\n#define JIT_BNE_UN_I64I64\t\t0x9f\n#define JIT_BGE_UN_I64I64\t\t0xa0\n#define JIT_BGT_UN_I64I64\t\t0xa1\n#define JIT_BLE_UN_I64I64\t\t0xa2\n#define JIT_BLT_UN_I64I64\t\t0xa3\n\n#define JIT_SHL_I32\t\t\t\t0xa8\n#define JIT_SHR_I32\t\t\t\t0xa9\n#define JIT_SHR_UN_I32\t\t\t0xaa\n#define JIT_SHL_I64\t\t\t\t0xab\n#define JIT_SHR_I64\t\t\t\t0xac\n#define JIT_SHR_UN_I64\t\t\t0xad\n\n#define JIT_BRANCH_FALSE\t\t0xae\n#define JIT_BRANCH_TRUE\t\t\t0xaf\n\n#define JIT_LOADTOKEN_BASE\t\t0xb0\n#define JIT_LOADTOKEN_TYPE\t\t(JIT_LOADTOKEN_BASE + 0)\n#define JIT_LOADTOKEN_METHOD\t(JIT_LOADTOKEN_BASE + 1)\n#define JIT_LOADTOKEN_FIELD\t\t(JIT_LOADTOKEN_BASE + 2)\n\n#define JIT_LOADINDIRECT_I8\t\t0xb3\n#define JIT_LOADINDIRECT_U8\t\t0xb4\n#define JIT_LOADINDIRECT_I16\t0xb5\n#define JIT_LOADINDIRECT_U16\t0xb6\n#define JIT_LOADINDIRECT_I32\t0xb7\n#define JIT_LOADINDIRECT_U32\t0xb8\n#define JIT_LOADINDIRECT_I64\t0xb9\n#define JIT_LOADINDIRECT_I\t\t0xba\n#define JIT_LOADINDIRECT_R32\t0xbb\n#define JIT_LOADINDIRECT_R64\t0xbc\n#define JIT_LOADINDIRECT_REF\t0xbd\n\n#define JIT_STOREINDIRECT_REF\t0xbe\n#define JIT_STOREINDIRECT_U8\t0xbf\n#define JIT_STOREINDIRECT_U16\t0xc0\n#define JIT_STOREINDIRECT_U32\t0xc1\n#define JIT_STOREINDIRECT_U64\t0xc2\n#define JIT_STOREINDIRECT_R32\t0xc3\n#define JIT_STOREINDIRECT_R64\t0xc4\n\n//#define JIT_CONV_SIGNED32\t\t0xc5\n//#define JIT_CONV_UNSIGNED32\t\t0xc6\n//#define JIT_CONV_INT_I64\t\t0xc7\n\n//#define JIT_CONV_I1\t\t\t\t0xc5\n//#define JIT_CONV_I2\t\t\t\t0xc6\n//#define JIT_CONV_I4\t\t\t\t0xc7\n//#define JIT_CONV_I8\t\t\t\t0xc8\n//#define JIT_CONV_R4\t\t\t\t0xc9\n//#define JIT_CONV_R8\t\t\t\t0xca\n//#define JIT_CONV_U4\t\t\t\t0xcb\n//#define JIT_CONV_U8\t\t\t\t0xcc\n//#define JIT_CONV_U2\t\t\t\t0xcd\n//#define JIT_CONV_U1\t\t\t\t0xce\n//#define JIT_CONV_I_NATIVE\t\t0xcf\n//#define JIT_CONV_U_NATIVE\t\t0xd0\n\n//#define JIT_CONV_OVF_I1\t\t\t0xd1\n//#define JIT_CONV_OVF_U1\t\t\t0xd2\n//#define JIT_CONV_OVF_I2\t\t\t0xd3\n//#define JIT_CONV_OVF_U2\t\t\t0xd4\n//#define JIT_CONV_OVF_I4\t\t\t0xd5\n//#define JIT_CONV_OVF_U4\t\t\t0xd6\n//#define JIT_CONV_OVF_I8\t\t\t0xd7\n//#define JIT_CONV_OVF_U8\t\t\t0xd8\n\n#define JIT_UNBOX_NULLABLE\t\t0xda\n\n#define JIT_STORE_ELEMENT_32\t0xde\n#define JIT_STORE_ELEMENT_64\t0xdf\n\n#define JIT_LOAD_ELEMENT_I8\t\t0xe0\n#define JIT_LOAD_ELEMENT_U8\t\t0xe1\n#define JIT_LOAD_ELEMENT_I16\t0xe2\n#define JIT_LOAD_ELEMENT_U16\t0xe3\n#define JIT_LOAD_ELEMENT_I32\t0xe4\n#define JIT_LOAD_ELEMENT_U32\t0xe5\n#define JIT_LOAD_ELEMENT_I64\t0xe6\n#define JIT_LOAD_ELEMENT_R32\t0xe7\n#define JIT_LOAD_ELEMENT_R64\t0xe8\n\n#define JIT_ADD_OVF_I64I64\t\t0xea\n#define JIT_ADD_OVF_UN_I64I64\t0xeb\n#define JIT_MUL_OVF_I64I64\t\t0xec\n#define JIT_MUL_OVF_UN_I64I64\t0xed\n#define JIT_SUB_OVF_I64I64\t\t0xee\n#define JIT_SUB_OVF_UN_I64I64\t0xef\n#define JIT_ADD_I64I64\t\t\t0xf0\n#define JIT_SUB_I64I64\t\t\t0xf1\n#define JIT_MUL_I64I64\t\t\t0xf2\n#define JIT_DIV_I64I64\t\t\t0xf3\n#define JIT_DIV_UN_I64I64\t\t0xf4\n#define JIT_REM_I64I64\t\t\t0xf5\n#define JIT_REM_UN_I64I64\t\t0xf6\n#define JIT_AND_I64I64\t\t\t0xf7\n#define JIT_OR_I64I64\t\t\t0xf8\n#define JIT_XOR_I64I64\t\t\t0xf9\n\n#define JIT_CEQ_F32F32\t\t\t0xfa\n#define JIT_CGT_F32F32\t\t\t0xfb\n#define JIT_CGT_UN_F32F32\t\t0xfc\n#define JIT_CLT_F32F32\t\t\t0xfd\n#define JIT_CLT_UN_F32F32\t\t0xfe\n\n#define JIT_BEQ_F32F32\t\t\t0xff\n#define JIT_BGE_F32F32\t\t\t0x100\n#define JIT_BGT_F32F32\t\t\t0x101\n#define JIT_BLE_F32F32\t\t\t0x102\n#define JIT_BLT_F32F32\t\t\t0x103\n#define JIT_BNE_UN_F32F32\t\t0x104\n#define JIT_BGE_UN_F32F32\t\t0x105\n#define JIT_BGT_UN_F32F32\t\t0x106\n#define JIT_BLE_UN_F32F32\t\t0x107\n#define JIT_BLT_UN_F32F32\t\t0x108\n\n#define JIT_ADD_F32F32\t\t\t0x109\n#define JIT_SUB_F32F32\t\t\t0x10a\n#define JIT_MUL_F32F32\t\t\t0x10b\n#define JIT_DIV_F32F32\t\t\t0x10c\n#define JIT_DIV_UN_F32F32\t\t0x10d // Never used\n#define JIT_REM_F32F32\t\t\t0x10e\n#define JIT_REM_UN_F32F32\t\t0x10f // Never used\n\n#define JIT_CEQ_F64F64\t\t\t0x110\n#define JIT_CGT_F64F64\t\t\t0x111\n#define JIT_CGT_UN_F64F64\t\t0x112\n#define JIT_CLT_F64F64\t\t\t0x113\n#define JIT_CLT_UN_F64F64\t\t0x114\n\n#define JIT_BEQ_F64F64\t\t\t0x115\n#define JIT_BGE_F64F64\t\t\t0x116\n#define JIT_BGT_F64F64\t\t\t0x117\n#define JIT_BLE_F64F64\t\t\t0x118\n#define JIT_BLT_F64F64\t\t\t0x119\n#define JIT_BNE_UN_F64F64\t\t0x11a\n#define JIT_BGE_UN_F64F64\t\t0x11b\n#define JIT_BGT_UN_F64F64\t\t0x11c\n#define JIT_BLE_UN_F64F64\t\t0x11d\n#define JIT_BLT_UN_F64F64\t\t0x11e\n\n#define JIT_ADD_F64F64\t\t\t0x11f\n#define JIT_SUB_F64F64\t\t\t0x120\n#define JIT_MUL_F64F64\t\t\t0x121\n#define JIT_DIV_F64F64\t\t\t0x122\n#define JIT_DIV_UN_F64F64\t\t0x123 // Never used\n#define JIT_REM_F64F64\t\t\t0x124\n#define JIT_REM_UN_F64F64\t\t0x125 // Never used\n\n#define JIT_LOADPARAMLOCAL_0\t0x127 // Load 4-byte param/local at offset 0\n#define JIT_LOADPARAMLOCAL_1\t0x128 // Load 4-byte param/local at offset 4\n#define JIT_LOADPARAMLOCAL_2\t0x129 // Load 4-byte param/local at offset 8\n#define JIT_LOADPARAMLOCAL_3\t0x12a // Load 4-byte param/local at offset 12\n#define JIT_LOADPARAMLOCAL_4\t0x12b // Load 4-byte param/local at offset 16\n#define JIT_LOADPARAMLOCAL_5\t0x12c // Load 4-byte param/local at offset 20\n#define JIT_LOADPARAMLOCAL_6\t0x12d // Load 4-byte param/local at offset 24\n#define JIT_LOADPARAMLOCAL_7\t0x12e // Load 4-byte param/local at offset 28\n\n#define JIT_STOREPARAMLOCAL_0\t0x12f // Store 4-byte param/local at offset 0\n#define JIT_STOREPARAMLOCAL_1\t0x130 // Store 4-byte param/local at offset 4\n#define JIT_STOREPARAMLOCAL_2\t0x131 // Store 4-byte param/local at offset 8\n#define JIT_STOREPARAMLOCAL_3\t0x132 // Store 4-byte param/local at offset 12\n#define JIT_STOREPARAMLOCAL_4\t0x133 // Store 4-byte param/local at offset 16\n#define JIT_STOREPARAMLOCAL_5\t0x134 // Store 4-byte param/local at offset 20\n#define JIT_STOREPARAMLOCAL_6\t0x135 // Store 4-byte param/local at offset 24\n#define JIT_STOREPARAMLOCAL_7\t0x136 // Store 4-byte param/local at offset 28\n\n#define JIT_LOAD_I4_M1\t\t\t0x137\n#define JIT_LOAD_I4_0\t\t\t0x138\n#define JIT_LOAD_I4_1\t\t\t0x139\n#define JIT_LOAD_I4_2\t\t\t0x13a\n\n#define JIT_LOADFIELD_4\t\t\t0x13b\n\n#define JIT_CONV_OFFSET_I32 0\n#define JIT_CONV_OFFSET_U32 1\n#define JIT_CONV_OFFSET_I64 2\n#define JIT_CONV_OFFSET_U64 3\n#define JIT_CONV_OFFSET_R32 4\n#define JIT_CONV_OFFSET_R64 5\n\n#define JIT_CONV_FROM_I32\t\t0x140\n#define JIT_CONV_I32_I32\t\t(JIT_CONV_FROM_I32 + JIT_CONV_OFFSET_I32)\n#define JIT_CONV_I32_U32\t\t(JIT_CONV_FROM_I32 + JIT_CONV_OFFSET_U32)\n#define JIT_CONV_I32_I64\t\t(JIT_CONV_FROM_I32 + JIT_CONV_OFFSET_I64)\n#define JIT_CONV_I32_U64\t\t(JIT_CONV_FROM_I32 + JIT_CONV_OFFSET_U64)\n#define JIT_CONV_I32_R32\t\t(JIT_CONV_FROM_I32 + JIT_CONV_OFFSET_R32)\n#define JIT_CONV_I32_R64\t\t(JIT_CONV_FROM_I32 + JIT_CONV_OFFSET_R64)\n\n#define JIT_CONV_FROM_U32\t\t0x146\n#define JIT_CONV_U32_I32\t\t(JIT_CONV_FROM_U32 + JIT_CONV_OFFSET_I32)\n#define JIT_CONV_U32_U32\t\t(JIT_CONV_FROM_U32 + JIT_CONV_OFFSET_U32)\n#define JIT_CONV_U32_I64\t\t(JIT_CONV_FROM_U32 + JIT_CONV_OFFSET_I64)\n#define JIT_CONV_U32_U64\t\t(JIT_CONV_FROM_U32 + JIT_CONV_OFFSET_U64)\n#define JIT_CONV_U32_R32\t\t(JIT_CONV_FROM_U32 + JIT_CONV_OFFSET_R32)\n#define JIT_CONV_U32_R64\t\t(JIT_CONV_FROM_U32 + JIT_CONV_OFFSET_R64)\n\n#define JIT_CONV_FROM_I64\t\t0x14c\n#define JIT_CONV_I64_I32\t\t(JIT_CONV_FROM_I64 + JIT_CONV_OFFSET_I32)\n#define JIT_CONV_I64_U32\t\t(JIT_CONV_FROM_I64 + JIT_CONV_OFFSET_U32)\n#define JIT_CONV_I64_I64\t\t(JIT_CONV_FROM_I64 + JIT_CONV_OFFSET_I64) // Not used\n#define JIT_CONV_I64_U64\t\t(JIT_CONV_FROM_I64 + JIT_CONV_OFFSET_U64) // Not used\n#define JIT_CONV_I64_R32\t\t(JIT_CONV_FROM_I64 + JIT_CONV_OFFSET_R32)\n#define JIT_CONV_I64_R64\t\t(JIT_CONV_FROM_I64 + JIT_CONV_OFFSET_R64)\n\n#define JIT_CONV_FROM_U64\t\t0x152\n#define JIT_CONV_U64_I32\t\t(JIT_CONV_FROM_U64 + JIT_CONV_OFFSET_I32)\n#define JIT_CONV_U64_U32\t\t(JIT_CONV_FROM_U64 + JIT_CONV_OFFSET_U32)\n#define JIT_CONV_U64_I64\t\t(JIT_CONV_FROM_U64 + JIT_CONV_OFFSET_I64) // Not used\n#define JIT_CONV_U64_U64\t\t(JIT_CONV_FROM_U64 + JIT_CONV_OFFSET_U64) // Not used\n#define JIT_CONV_U64_R32\t\t(JIT_CONV_FROM_U64 + JIT_CONV_OFFSET_R32)\n#define JIT_CONV_U64_R64\t\t(JIT_CONV_FROM_U64 + JIT_CONV_OFFSET_R64)\n\n#define JIT_CONV_FROM_R32\t\t0x158\n#define JIT_CONV_R32_I32\t\t(JIT_CONV_FROM_R32 + JIT_CONV_OFFSET_I32)\n#define JIT_CONV_R32_U32\t\t(JIT_CONV_FROM_R32 + JIT_CONV_OFFSET_U32)\n#define JIT_CONV_R32_I64\t\t(JIT_CONV_FROM_R32 + JIT_CONV_OFFSET_I64)\n#define JIT_CONV_R32_U64\t\t(JIT_CONV_FROM_R32 + JIT_CONV_OFFSET_U64)\n#define JIT_CONV_R32_R32\t\t(JIT_CONV_FROM_R32 + JIT_CONV_OFFSET_R32)\n#define JIT_CONV_R32_R64\t\t(JIT_CONV_FROM_R32 + JIT_CONV_OFFSET_R64)\n\n#define JIT_CONV_FROM_R64\t\t0x15e\n#define JIT_CONV_R64_I32\t\t(JIT_CONV_FROM_R64 + JIT_CONV_OFFSET_I32)\n#define JIT_CONV_R64_U32\t\t(JIT_CONV_FROM_R64 + JIT_CONV_OFFSET_U32)\n#define JIT_CONV_R64_I64\t\t(JIT_CONV_FROM_R64 + JIT_CONV_OFFSET_I64)\n#define JIT_CONV_R64_U64\t\t(JIT_CONV_FROM_R64 + JIT_CONV_OFFSET_U64)\n#define JIT_CONV_R64_R32\t\t(JIT_CONV_FROM_R64 + JIT_CONV_OFFSET_R32)\n#define JIT_CONV_R64_R64\t\t(JIT_CONV_FROM_R64 + JIT_CONV_OFFSET_R64)\n\n\n#endif\n"
  },
  {
    "path": "dna/Makefile",
    "content": ".include <N750.prog.mk>\n\nPROG=\tdna\n\nSRCS=\tCLIFile.c\nSRCS+=\tDelegate.c\nSRCS+=\tdna.c\nSRCS+=\tFinalizer.c\nSRCS+=\tGenerics.c\nSRCS+=\tHeap.c\nSRCS+=\tInternalCall.c\nSRCS+=\tJIT.c\nSRCS+=\tJIT_Execute.c\nSRCS+=\tMetaData.c\nSRCS+=\tMetaData_Fill.c\nSRCS+=\tMetaData_Search.c\nSRCS+=\tMethodState.c\nSRCS+=\tPInvoke.c\nSRCS+=\tRVA.c\nSRCS+=\tSys.c\nSRCS+=\tThread.c\nSRCS+=\tType.c\n\nSRCS+=\tSystem.Array.c\nSRCS+=\tSystem.Char.c\nSRCS+=\tSystem.Console.c\nSRCS+=\tSystem.DateTime.c\nSRCS+=\tSystem.Diagnostics.Debugger.c\nSRCS+=\tSystem.Environment.c\nSRCS+=\tSystem.Enum.c\nSRCS+=\tSystem.GC.c\nSRCS+=\tSystem.IO.FileInternal.c\nSRCS+=\tSystem.Math.c\nSRCS+=\tSystem.Net.Dns.c\nSRCS+=\tSystem.Net.Sockets.Socket.c\nSRCS+=\tSystem.Object.c\nSRCS+=\tSystem.Runtime.CompilerServices.RuntimeHelpers.c\nSRCS+=\tSystem.RuntimeType.c\nSRCS+=\tSystem.String.c\nSRCS+=\tSystem.Type.c\nSRCS+=\tSystem.Threading.Interlocked.c\nSRCS+=\tSystem.Threading.Monitor.c\nSRCS+=\tSystem.Threading.Thread.c\nSRCS+=\tSystem.ValueType.c\nSRCS+=\tSystem.WeakReference.c\n\n#CFLAGS= -O0 -g -I. -Wall -Werror \n#-mips2 -mcpu=r3900\n#CFLAGS= -Os -g -I. -Wall -Werror -mips2 -mcpu=r3900\nCFLAGS= -Os -I. -Wall -Werror\n\nLDFLAGS+=--no-undefined\nLDADD+=-s\nLDADD+=-lm\n\n.include <bsd.prog.mk>\n\n"
  },
  {
    "path": "dna/MetaData.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"MetaData.h\"\n\n#include \"Types.h\"\n#include \"Type.h\"\n#include \"RVA.h\"\n\nunsigned int MetaData_DecodeSigEntry(SIG *pSig) {\n\tunsigned char a,b,c,d;\n\ta = *((unsigned char*)*pSig)++;\n\tif ((a & 0x80) == 0) {\n\t\t// 1-byte entry\n\t\treturn a;\n\t}\n\t// Special case\n\tif (a == 0xff) {\n\t\treturn 0;\n\t}\n\n\tb = *((unsigned char*)*pSig)++;\n\tif ((a & 0xc0) == 0x80) {\n\t\t// 2-byte entry\n\t\treturn ((int)(a & 0x3f)) << 8 | b;\n\t}\n\t// 4-byte entry\n\tc = *((unsigned char*)*pSig)++;\n\td = *((unsigned char*)*pSig)++;\n\treturn ((int)(a & 0x1f)) << 24 | ((int)b) << 16 | ((int)c) << 8 | d;\n}\n\nIDX_TABLE MetaData_DecodeSigEntryToken(SIG *pSig) {\n\tstatic U8 tableID[4] = {MD_TABLE_TYPEDEF, MD_TABLE_TYPEREF, MD_TABLE_TYPESPEC, 0};\n\n\tU32 entry = MetaData_DecodeSigEntry(pSig);\n\treturn MAKE_TABLE_INDEX(tableID[entry & 0x3], entry >> 2);\n}\n\ntMetaData* MetaData() {\n\ttMetaData *pRet = TMALLOC(tMetaData);\n\tmemset(pRet, 0, sizeof(tMetaData));\n\treturn pRet;\n}\n\nvoid MetaData_LoadStrings(tMetaData *pThis, void *pStream, unsigned int streamLen) {\n\tpThis->strings.pStart = (unsigned char*)pStream;\n\n\tlog_f(1, \"Loaded strings\\n\");\n}\n\nunsigned int MetaData_DecodeHeapEntryLength(unsigned char **ppHeapEntry) {\n\treturn MetaData_DecodeSigEntry((SIG*)ppHeapEntry);\n}\n\nvoid MetaData_LoadBlobs(tMetaData *pThis, void *pStream, unsigned int streamLen) {\n\tpThis->blobs.pStart = (unsigned char*)pStream;\n\n\tlog_f(1, \"Loaded blobs\\n\");\n\n}\n\nvoid MetaData_LoadUserStrings(tMetaData *pThis, void *pStream, unsigned int streamLen) {\n\tpThis->userStrings.pStart = (unsigned char*)pStream;\n\n\tlog_f(1, \"Loaded User Strings\\n\");\n\n}\n\nvoid MetaData_LoadGUIDs(tMetaData *pThis, void *pStream, unsigned int streamLen) {\n\tpThis->GUIDs.numGUIDs = streamLen / 16;\n\n\t// This is stored -16 because numbering starts from 1. This means that a simple indexing calculation\n\t// can be used, as if it started from 0\n\tpThis->GUIDs.pGUID1 = (unsigned char*)pStream;\n\n\tlog_f(1, \"Read %d GUIDs\\n\", pThis->GUIDs.numGUIDs);\n}\n\n/*\nFormat of definition strings:\nAlways 2 characters to togther. 1st character defines source, 2nd defines destination.\nSources:\n\tc: 8-bit value\n\ts: 16-bit short\n\ti: 32-bit int\n\tS: Index into string heap\n\tG: Index into GUID heap\n\tB: Index into BLOB heap\n\t0: Coded index: TypeDefOrRef\n\t1: Coded index: HasConstant\n\t2: Coded index: HasCustomAttribute\n\t3: Coded index: HasFieldMarshall\n\t4: Coded index: HasDeclSecurity\n\t5: Coded index: MemberRefParent\n\t6: Coded index: HasSemantics\n\t7: Coded index: MethodDefOrRef\n\t8: Coded index: MemberForwarded\n\t9: Coded index: Implementation\n\t:: Coded index: CustomAttributeType\n\t;: Coded index: ResolutionScope\n\t<: Coded index: TypeOrMethodDef\n\t\\x00 - \\x2c: Simple indexes into the respective table\n\t^: RVA: Convert to pointer\n\tx: Nothing, use 0\n\tm: This metadata pointer\n\tl: (lower case L) Boolean, is this the last entry in this table?\n\tI: The original table index for this table item\nDestination:\n\tx: nowhere, ignore\n\t*: 32-bit index into relevant heap;\n\t\tOr coded index - MSB = which table, other 3 bytes = table index\n\t\tOr 32-bit int\n\t\tOr pointer (also RVA)\n\ts: 16-bit value\n\tc: 8-bit value\n*/\nstatic char* tableDefs[] = {\n\t// 0x00\n\t\"sxS*G*GxGx\",\n\t// 0x01\n\t\"x*;*S*S*\",\n\t// 0x02\n\t\"x*m*i*S*S*0*\\x04*\\x06*xclcxcxcx*x*x*x*x*x*x*x*x*x*x*I*x*x*x*x*x*x*x*x*x*x*x*x*\",\n\t// 0x03\n\tNULL,\n\t// 0x04\n\t\"x*m*ssxsS*B*x*x*x*x*I*x*\",\n\t// 0x05\n\tNULL,\n\t// 0x06\n\t\"x*m*^*ssssS*B*\\x08*x*x*x*x*x*x*I*x*x*x*\"\n#ifdef GEN_COMBINED_OPCODES\n\t\"x*x*x*x*x*x*\"\n#endif\n#ifdef DIAG_METHOD_CALLS\n\t\"x*x*x*\"\n#endif\n\t,\n\t// 0x07\n\tNULL,\n\t// 0x08\n\t\"ssssS*\",\n\t// 0x09\n\t\"\\x02*0*\",\n\t// 0x0A\n\t\"x*5*S*B*\",\n\t// 0x0B\n\t\"ccccxs1*B*\",\n\t// 0x0C\n\t\"2*:*B*\",\n\t// 0x0D\n\tNULL,\n\t// 0x0E\n\t\"ssxs4*B*\",\n\t// 0x0F\n\t\"ssxsi*\\x02*\",\n\t// 0x10\n\tNULL,\n\t// 0x11\n\t\"B*\",\n\t// 0x12\n\t\"\\x02*\\x14*\",\n\t// 0x13\n\tNULL,\n\t// 0x14\n\t\"ssxsS*0*\",\n\t// 0x15\n\t\"\\x02*\\x17*\",\n\t// 0x16\n\tNULL,\n\t// 0x17\n\t\"ssxsS*B*\",\n\t// 0x18\n\t\"ssxs\\06*6*\",\n\t// 0x19\n\t\"\\x02*7*7*\",\n\t// 0x1A\n\t\"S*\",\n\t// 0x1B\n\t\"x*m*B*\",\n\t// 0x1C\n\t\"ssxs8*S*\\x1a*\",\n\t// 0x1D\n\t\"^*\\x04*\",\n\t// 0x1E\n\tNULL,\n\t// 0x1F\n\tNULL,\n\t// 0x20\n\t\"i*ssssssssi*B*S*S*\",\n\t// 0x21\n\tNULL,\n\t// 0x22\n\tNULL,\n\t// 0x23\n\t\"ssssssssi*B*S*S*B*\",\n\t// 0x24\n\tNULL,\n\t// 0x25\n\tNULL,\n\t// 0x26\n\tNULL,\n\t// 0x27\n\tNULL,\n\t// 0x28\n\tNULL,\n\t// 0x29\n\t\"\\x02*\\x02*\",\n\t// 0x2A\n\t\"ssss<*S*\",\n\t// 0x2B\n\t\"x*m*7*B*\",\n\t// 0x2C\n\t\"\\x2a*0*\",\n};\n\n// Coded indexes use this lookup table.\n// Note that the extra 'z' characters are important!\n// (Because of how the lookup works each string must be a power of 2 in length)\nstatic unsigned char* codedTags[] = {\n\t// TypeDefOrRef\n\t\"\\x02\\x01\\x1Bz\",\n\t// HasConstant\n\t\"\\x04\\x08\\x17z\",\n\t// HasCustomAttribute\n\t\"\\x06\\x04\\x01\\x02\\x08\\x09\\x0A\\x00\\x0E\\x17\\x14\\x11\\x1A\\x1B\\x20\\x23\\x26\\x27\\x28zzzzzzzzzzzzz\",\n\t// HasFieldMarshall\n\t\"\\x04\\x08\",\n\t// HasDeclSecurity\n\t\"\\x02\\x06\\x20z\",\n\t// MemberRefParent\n\t\"z\\x01\\x1A\\x06\\x1Bzzz\",\n\t// HasSemantics\n\t\"\\x14\\x17\",\n\t// MethodDefOrRef\n\t\"\\x06\\x0A\",\n\t// MemberForwarded\n\t\"\\x04\\x06\",\n\t// Implementation\n\t\"\\x26\\x23\\x27z\",\n\t// CustomAttributeType\n\t\"zz\\x06\\x0Azzzz\",\n\t// ResolutionScope\n\t\"\\x00\\x1A\\x23\\x01\",\n\t// TypeOrMethodDef\n\t\"\\x02\\x06\",\n};\n\nstatic unsigned char codedTagBits[] = {\n\t2, 2, 5, 1, 2, 3, 1, 1, 1, 2, 3, 2, 1\n};\n\nstatic unsigned char tableRowSize[MAX_TABLES];\n\nvoid MetaData_Init() {\n\tU32 i;\n\tfor (i=0; i<MAX_TABLES; i++) {\n\t\ttableRowSize[i] = 0;\n\t}\n}\n\nstatic unsigned int GetU16(unsigned char *pSource) {\n\tunsigned int a,b;\n\n\ta = pSource[0];\n\tb = pSource[1];\n\treturn a | (b << 8);\n}\n\nstatic unsigned int GetU32(unsigned char *pSource) {\n\tunsigned int a,b,c,d;\n\n\ta = pSource[0];\n\tb = pSource[1];\n\tc = pSource[2];\n\td = pSource[3];\n\treturn a | (b << 8) | (c << 16) | (d << 24);\n}\n\n// Loads a single table, returns pointer to table in memory.\nstatic void* LoadSingleTable(tMetaData *pThis, tRVA *pRVA, int tableID, void **ppTable) {\n\tint numRows = pThis->tables.numRows[tableID];\n\tint rowLen = 0; // Number of bytes taken by each row in memory.\n\tint i, row;\n\tchar *pDef = tableDefs[tableID];\n\tint defLen = (int)strlen(pDef);\n\tvoid *pRet;\n\tunsigned char *pSource = *ppTable;\n\tunsigned char *pDest;\n\tunsigned int v;\n\n\t// Calculate the destination row size from table definition, if it hasn't already been calculated\n\tif (tableRowSize[tableID] == 0) {\n\t\tfor (i=0; i<defLen; i += 2) {\n\t\t\tswitch (pDef[i+1]) {\n\t\t\t\tcase '*':\n\t\t\t\t\trowLen += 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 's':\n\t\t\t\t\trowLen += 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'c':\n\t\t\t\t\trowLen++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'x':\n\t\t\t\t\t// Do nothing\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tCrash(\"Cannot determine length of MetaData destination definition character '%c'\\n\", pDef[i+1]);\n\t\t\t}\n\t\t}\n\t\ttableRowSize[tableID] = rowLen;\n\t} else {\n\t\trowLen = tableRowSize[tableID];\n\t}\n\n\t// Allocate memory for destination table\n\tpDest = pRet = malloc(numRows * rowLen);\n\n\t// Load table\n\tfor (row=0; row<numRows; row++) {\n\t\tfor (i=0; i<defLen; i += 2) {\n\t\t\tunsigned char d = pDef[i];\n\t\t\tif (d < MAX_TABLES) {\n\t\t\t\tif (pThis->tables.numRows[d] < 0x10000) {\n\t\t\t\t\t// Use 16-bit offset\n\t\t\t\t\tv = GetU16(pSource);\n\t\t\t\t\tpSource += 2;\n\t\t\t\t} else {\n\t\t\t\t\t// Use 32-bit offset\n\t\t\t\t\tv = GetU32(pSource);\n\t\t\t\t\tpSource += 4;\n\t\t\t\t}\n\t\t\t\tv |= d << 24;\n\t\t\t} else {\n\t\t\t\tswitch (d) {\n\t\t\t\t\tcase 'c': // 8-bit value\n\t\t\t\t\t\tv = *(U8*)pSource;\n\t\t\t\t\t\tpSource++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 's': // 16-bit short\n\t\t\t\t\t\tv = GetU16(pSource);\n\t\t\t\t\t\tpSource += 2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'i': // 32-bit int\n\t\t\t\t\t\tv = GetU32(pSource);\n\t\t\t\t\t\tpSource += 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '0':\n\t\t\t\t\tcase '1':\n\t\t\t\t\tcase '2':\n\t\t\t\t\tcase '3':\n\t\t\t\t\tcase '4':\n\t\t\t\t\tcase '5':\n\t\t\t\t\tcase '6':\n\t\t\t\t\tcase '7':\n\t\t\t\t\tcase '8':\n\t\t\t\t\tcase '9':\n\t\t\t\t\tcase ':':\n\t\t\t\t\tcase ';':\n\t\t\t\t\tcase '<':\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tint ofs = pDef[i] - '0';\n\t\t\t\t\t\t\tchar* pCoding = codedTags[ofs];\n\t\t\t\t\t\t\tint tagBits = codedTagBits[ofs];\n\t\t\t\t\t\t\tunsigned char tag = *pSource & ((1 << tagBits) - 1);\n\t\t\t\t\t\t\tint idxIntoTableID = pCoding[tag]; // The actual table index that we're looking for\n\t\t\t\t\t\t\tif (idxIntoTableID < 0 || idxIntoTableID > MAX_TABLES) {\n\t\t\t\t\t\t\t\tprintf(\"Error: Bad table index: 0x%02x\\n\", idxIntoTableID);\n\t\t\t\t\t\t\t\texit(1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (pThis->tables.codedIndex32Bit[ofs]) {\n\t\t\t\t\t\t\t\t// Use 32-bit number\n\t\t\t\t\t\t\t\tv = GetU32(pSource) >> tagBits;\n\t\t\t\t\t\t\t\tpSource += 4;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// Use 16-bit number\n\t\t\t\t\t\t\t\tv = GetU16(pSource) >> tagBits;\n\t\t\t\t\t\t\t\tpSource += 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tv |= idxIntoTableID << 24;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'S': // index into string heap\n\t\t\t\t\t\tif (pThis->index32BitString) {\n\t\t\t\t\t\t\tv = GetU32(pSource);\n\t\t\t\t\t\t\tpSource += 4;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tv = GetU16(pSource);\n\t\t\t\t\t\t\tpSource += 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tv = (unsigned int)(pThis->strings.pStart + v);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'G': // index into GUID heap\n\t\t\t\t\t\tif (pThis->index32BitGUID) {\n\t\t\t\t\t\t\tv = GetU32(pSource);\n\t\t\t\t\t\t\tpSource += 4;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tv = GetU16(pSource);\n\t\t\t\t\t\t\tpSource += 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tv = (unsigned int)(pThis->GUIDs.pGUID1 + ((v-1) * 16));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'B': // index into BLOB heap\n\t\t\t\t\t\tif (pThis->index32BitBlob) {\n\t\t\t\t\t\t\tv = GetU32(pSource);\n\t\t\t\t\t\t\tpSource += 4;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tv = GetU16(pSource);\n\t\t\t\t\t\t\tpSource += 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tv = (unsigned int)(pThis->blobs.pStart + v);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '^': // RVA to convert to pointer\n\t\t\t\t\t\tv = GetU32(pSource);\n\t\t\t\t\t\tpSource += 4;\n\t\t\t\t\t\tv = (unsigned int)RVA_FindData(pRVA, v);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'm': // Pointer to this metadata\n\t\t\t\t\t\tv = (unsigned int)pThis;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'l': // Is this the last table entry?\n\t\t\t\t\t\tv = (row == numRows - 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'I': // Original table index\n\t\t\t\t\t\tv = MAKE_TABLE_INDEX(tableID, row + 1);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'x': // Nothing, use 0\n\t\t\t\t\t\tv = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tCrash(\"Cannot handle MetaData source definition character '%c' (0x%02X)\\n\", d, d);\n\t\t\t\t}\n\t\t\t}\n\t\t\tswitch (pDef[i+1]) {\n\t\t\t\tcase '*':\n\t\t\t\t\t*(unsigned int*)pDest = v;\n\t\t\t\t\tpDest += 4;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 's':\n\t\t\t\t\t*(unsigned short*)pDest = (unsigned short)v;\n\t\t\t\t\tpDest += 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'c':\n\t\t\t\t\t*(unsigned char*)pDest = (unsigned char)v;\n\t\t\t\t\tpDest++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'x':\n\t\t\t\t\t// Do nothing\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tCrash(\"Cannot handle MetaData destination definition character '%c'\\n\", pDef[i+1]);\n\t\t\t}\n\t\t}\n\t}\n\n\tlog_f(1, \"Loaded MetaData table 0x%02X; %d rows\\n\", tableID, numRows);\n\n\t// Update the parameter to the position after this table\n\t*ppTable = pSource;\n\t// Return new table information\n\treturn pRet;\n}\n\nvoid MetaData_LoadTables(tMetaData *pThis, tRVA *pRVA, void *pStream, unsigned int streamLen) {\n\tU64 valid, j;\n\tunsigned char c;\n\tint i, k, numTables;\n\tvoid *pTable;\n\n\tc = *(unsigned char*)&((char*)pStream)[6];\n\tpThis->index32BitString = (c & 1) > 0;\n\tpThis->index32BitGUID = (c & 2) > 0;\n\tpThis->index32BitBlob = (c & 4) > 0;\n\n\tvalid = *(U64*)&((char*)pStream)[8];\n\n\t// Count how many tables there are, and read in all the number of rows of each table.\n\tnumTables = 0;\n\tfor (i=0, j=1; i<MAX_TABLES; i++, j <<= 1) {\n\t\tif (valid & j) {\n\t\t\tpThis->tables.numRows[i] = *(unsigned int*)&((char*)pStream)[24 + numTables * 4];\n\t\t\tnumTables++;\n\t\t} else {\n\t\t\tpThis->tables.numRows[i] = 0;\n\t\t\tpThis->tables.data[i] = NULL;\n\t\t}\n\t}\n\n\t// Determine if each coded index lookup type needs to use 16 or 32 bit indexes\n\tfor (i=0; i<13; i++) {\n\t\tchar* pCoding = codedTags[i];\n\t\tint tagBits = codedTagBits[i];\n\t\t// Discover max table size\n\t\tunsigned int maxTableLen = 0;\n\t\tfor (k=0; k < (1<<tagBits); k++) {\n\t\t\tunsigned char t = pCoding[k];\n\t\t\tif (t != 'z') {\n\t\t\t\tif (pThis->tables.numRows[t] > maxTableLen) {\n\t\t\t\t\tmaxTableLen = pThis->tables.numRows[t];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (maxTableLen < (unsigned)(1 << (16 - tagBits))) {\n\t\t\t// Use 16-bit number\n\t\t\tpThis->tables.codedIndex32Bit[i] = 0;\n\t\t} else {\n\t\t\t// Use 32-bit number\n\t\t\tpThis->tables.codedIndex32Bit[i] = 1;\n\t\t}\n\t}\n\n\tpTable = &((char*)pStream)[24 + numTables * 4];\n\n\tfor (i=0; i<MAX_TABLES; i++) {\n\t\tif (pThis->tables.numRows[i] > 0) {\n\t\t\tif (i*4 >= sizeof(tableDefs) || tableDefs[i] == NULL) {\n\t\t\t\tprintf(\"No table definition for MetaData table 0x%02x\\n\", i);\n\t\t\t\texit(1);\n\t\t\t}\n\t\t\tpThis->tables.data[i] = LoadSingleTable(pThis, pRVA, i, &pTable);\n\t\t}\n\t}\n}\n\nPTR MetaData_GetBlob(BLOB_ blob, U32 *pBlobLength) {\n\tunsigned int len = MetaData_DecodeHeapEntryLength(&blob);\n\tif (pBlobLength != NULL) {\n\t\t*pBlobLength = len;\n\t}\n\treturn blob;\n}\n\n// Returns length in bytes, not characters\nSTRING2 MetaData_GetUserString(tMetaData *pThis, IDX_USERSTRINGS index, unsigned int *pStringLength) {\n\tunsigned char *pString = pThis->userStrings.pStart + (index & 0x00ffffff);\n\tunsigned int len = MetaData_DecodeHeapEntryLength(&pString);\n\tif (pStringLength != NULL) {\n\t\t// -1 because of extra terminating character in the heap\n\t\t*pStringLength = len - 1;\n\t}\n\treturn (STRING2)pString;\n}\n\nvoid* MetaData_GetTableRow(tMetaData *pThis, IDX_TABLE index) {\n\tchar *pData;\n\t\n\tif (TABLE_OFS(index) == 0) {\n\t\treturn NULL;\n\t}\n\tpData = (char*)pThis->tables.data[TABLE_ID(index)];\n\t// Table indexes start at one, hence the -1 here.\n\treturn pData + (TABLE_OFS(index) - 1) * tableRowSize[TABLE_ID(index)];\n}\n\nvoid MetaData_GetConstant(tMetaData *pThis, IDX_TABLE idx, PTR pResultMem) {\n\ttMD_Constant *pConst;\n\n\tswitch (TABLE_ID(idx)) {\n\tcase MD_TABLE_FIELDDEF:\n\t\t{\n\t\t\ttMD_FieldDef *pField = (tMD_FieldDef*)MetaData_GetTableRow(pThis, idx);\n\t\t\tpConst = (tMD_Constant*)pField->pMemory;\n\t\t}\n\t\tbreak;\n\tdefault:\n\t\tCrash(\"MetaData_GetConstant() Cannot handle idx: 0x%08x\", idx);\n\t}\n\n\tswitch (pConst->type) {\n\tcase ELEMENT_TYPE_I4:\n\t\t//*(U32*)pReturnMem = MetaData_DecodeSigEntry(\n\t\tmemcpy(pResultMem, pConst->value+1, 4);\n\t\treturn;\n\tdefault:\n\t\tCrash(\"MetaData_GetConstant() Cannot handle value type: 0x%02x\", pConst->type);\n\t}\n\n}\n\nvoid MetaData_GetHeapRoots(tHeapRoots *pHeapRoots, tMetaData *pMetaData) {\n\tU32 i, top;\n\t// Go through all types, getting their static variables.\n\n\ttop = pMetaData->tables.numRows[MD_TABLE_TYPEDEF];\n\tfor (i=1; i<=top; i++) {\n\t\ttMD_TypeDef *pTypeDef;\n\n\t\tpTypeDef = (tMD_TypeDef*)MetaData_GetTableRow(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_TYPEDEF, i));\n\t\tif (pTypeDef->isGenericDefinition) {\n\t\t\tGeneric_GetHeapRoots(pHeapRoots, pTypeDef);\n\t\t} else {\n\t\t\tif (pTypeDef->staticFieldSize > 0) {\n\t\t\t\tHeap_SetRoots(pHeapRoots, pTypeDef->pStaticFields, pTypeDef->staticFieldSize);\n\t\t\t}\n\t\t}\n\t}\n}"
  },
  {
    "path": "dna/MetaData.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__METADATA_H)\n#define __METADATA_H\n\n#include \"Types.h\"\n#include \"RVA.h\"\n\n#define MAX_TABLES 48\n\nstruct tMetaDataStrings_ {\n\t// The start of the string heap\n\tunsigned char *pStart;\n};\ntypedef struct tMetaDataStrings_ tMetaDataStrings;\n\nstruct tMetaDataBlobs_ {\n\t// The start of the blob heap\n\tunsigned char *pStart;\n};\ntypedef struct tMetaDataBlobs_ tMetaDataBlobs;\n\nstruct tMetaDataUserStrings_ {\n\t// The start of the user string heap\n\tunsigned char *pStart;\n};\ntypedef struct tMetaDataUserStrings_ tMetaDataUserStrings;\n\nstruct tMetaDataGUIDs_ {\n\t// The total number of GUIDs\n\tunsigned int numGUIDs;\n\t// Pointer to the first GUID\n\tunsigned char *pGUID1;\n};\ntypedef struct tMetaDataGUIDs_ tMetaDataGUIDs;\n\ntypedef struct tTables_ tTables;\nstruct tTables_ {\n\t// The number of rows in each table\n\tunsigned int numRows[MAX_TABLES];\n\t// The table data itself. 64 pointers to table data\n\t// See MetaDataTables.h for each table structure\n\tvoid* data[MAX_TABLES];\n\n\t// Should each coded index lookup type use 16 or 32 bit indexes?\n\tunsigned char codedIndex32Bit[13];\n};\n\ntypedef struct tMetaData_ tMetaData;\nstruct tMetaData_ {\n\ttMetaDataStrings strings;\n\ttMetaDataBlobs blobs;\n\ttMetaDataUserStrings userStrings;\n\ttMetaDataGUIDs GUIDs;\n\ttTables tables;\n\n\tunsigned char index32BitString, index32BitBlob, index32BitGUID;\n};\n\n#define TYPEATTRIBUTES_INTERFACE 0x20\n\n#define METHODATTRIBUTES_STATIC 0x10\n#define METHODATTRIBUTES_VIRTUAL 0x40\n#define METHODATTRIBUTES_NEWSLOT 0x100\n#define METHODATTRIBUTES_PINVOKEIMPL 0x2000\n\n#define METHODIMPLATTRIBUTES_CODETYPE_MASK 0x3\n#define METHODIMPLATTRIBUTES_CODETYPE_RUNTIME 0x3\n#define METHODIMPLATTRIBUTES_INTERNALCALL 0x1000\n\n#define FIELDATTRIBUTES_STATIC 0x10\n#define FIELDATTRIBUTES_LITERAL 0x40 // compile-time constant\n#define FIELDATTRIBUTES_HASFIELDRVA 0x100\n\n#define SIG_METHODDEF_GENERIC 0x10\n#define SIG_METHODDEF_HASTHIS 0x20\n\n#define IMPLMAP_FLAGS_CHARSETMASK 0x0006\n#define IMPLMAP_FLAGS_CHARSETNOTSPEC 0x0000\n#define IMPLMAP_FLAGS_CHARSETANSI 0x0002\n#define IMPLMAP_FLAGS_CHARSETUNICODE 0x0004\n#define IMPLMAP_FLAGS_CHARSETAUTO 0x0006\n\n#define TYPE_ISARRAY(pType) ((pType)->pArrayElementType != NULL)\n#define TYPE_ISINTERFACE(pType) ((pType)->flags & TYPEATTRIBUTES_INTERFACE)\n#define TYPE_ISGENERICINSTANCE(pType) ((pType)->pGenericDefinition != NULL)\n\n#define METHOD_ISVIRTUAL(pMethod) ((pMethod)->flags & METHODATTRIBUTES_VIRTUAL)\n#define METHOD_ISSTATIC(pMethod) ((pMethod)->flags & METHODATTRIBUTES_STATIC)\n#define METHOD_ISNEWSLOT(pMethod) ((pMethod)->flags & METHODATTRIBUTES_NEWSLOT)\n\n#define FIELD_HASFIELDRVA(pField) ((pField)->flags & FIELDATTRIBUTES_HASFIELDRVA)\n#define FIELD_ISLITERAL(pField) ((pField)->flags & FIELDATTRIBUTES_LITERAL)\n#define FIELD_ISSTATIC(pField) ((pField)->flags & FIELDATTRIBUTES_STATIC)\n\n#define IMPLMAP_ISCHARSET_NOTSPEC(pImplMap) (((pImplMap)->mappingFlags & IMPLMAP_FLAGS_CHARSETMASK) == IMPLMAP_FLAGS_CHARSETNOTSPEC)\n#define IMPLMAP_ISCHARSET_ANSI(pImplMap) (((pImplMap)->mappingFlags & IMPLMAP_FLAGS_CHARSETMASK) == IMPLMAP_FLAGS_CHARSETANSI)\n#define IMPLMAP_ISCHARSET_UNICODE(pImplMap) (((pImplMap)->mappingFlags & IMPLMAP_FLAGS_CHARSETMASK) == IMPLMAP_FLAGS_CHARSETUNICODE)\n#define IMPLMAP_ISCHARSET_AUTO(pImplMap) (((pImplMap)->mappingFlags & IMPLMAP_FLAGS_CHARSETMASK) == IMPLMAP_FLAGS_CHARSETAUTO)\n\n#define TABLE_ID(index) ((index) >> 24)\n#define TABLE_OFS(index) ((index) & 0x00ffffff)\n#define MAKE_TABLE_INDEX(table, index) ((IDX_TABLE)(((table) << 24) | ((index) & 0x00ffffff)))\n\ntypedef struct tParameter_ tParameter;\ntypedef struct tInterfaceMap_ tInterfaceMap;\n\n#include \"MetaDataTables.h\"\n\nstruct tParameter_ {\n\t// The type of the parameter\n\ttMD_TypeDef *pTypeDef;\n\t// The offset for this parameter into the paramater stack (in bytes)\n\tU32 offset;\n\t// The size of this value on the parameter stack (in bytes)\n\tU32 size;\n};\n\nstruct tInterfaceMap_ {\n\t// The interface this is implementing\n\ttMD_TypeDef *pInterface;\n\t// The vTable for this interface implementation\n\tU32 *pVTableLookup;\n\t// The direct method table for this interface. This is only used for special auto-generated interfaces\n\ttMD_MethodDef **ppMethodVLookup;\n};\n\n// static functions\nvoid MetaData_Init();\nunsigned int MetaData_DecodeSigEntry(SIG *pSig);\nIDX_TABLE MetaData_DecodeSigEntryToken(SIG *pSig);\nunsigned int MetaData_DecodeHeapEntryLength(unsigned char **ppHeapEntry);\n\nvoid MetaData_GetHeapRoots(tHeapRoots *pHeapRoots, tMetaData *pMetaData);\n\n// Meta-data filling extra information\n\n#define MetaData_Fill_TypeDef(pTypeDef, ppClassTypeArgs, ppMethodTypeArgs) if ((pTypeDef)->isFilled == 0) MetaData_Fill_TypeDef_(pTypeDef, ppClassTypeArgs, ppMethodTypeArgs)\nvoid MetaData_Fill_TypeDef_(tMD_TypeDef *pTypeDef, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\nvoid MetaData_Fill_FieldDef(tMD_TypeDef *pParentType, tMD_FieldDef *pFieldDef, U32 memOffset, tMD_TypeDef **ppClassTypeArgs);\nvoid MetaData_Fill_MethodDef(tMD_TypeDef *pParentType, tMD_MethodDef *pMethodDef, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\n\n// Meta-data searching\n\nU32 MetaData_CompareNameAndSig(STRING name, BLOB_ sigBlob, tMetaData *pSigMetaData, tMD_TypeDef **ppSigClassTypeArgs, tMD_TypeDef **ppSigMethodTypeArgs, tMD_MethodDef *pMethod, tMD_TypeDef **ppMethodClassTypeArgs, tMD_TypeDef **ppMethodMethodTypeArgs);\n\ntMetaData* MetaData_GetResolutionScopeMetaData(tMetaData *pMetaData, IDX_TABLE resolutionScopeToken, tMD_TypeDef **ppInNestedType);\n\nPTR MetaData_GetTypeMethodField(tMetaData *pMetaData, IDX_TABLE token, U32 *pObjectType, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\n\ntMD_TypeDef* MetaData_GetTypeDefFromName(tMetaData *pMetaData, STRING nameSpace, STRING name, tMD_TypeDef *pInNestedClass);\ntMD_TypeDef* MetaData_GetTypeDefFromFullName(STRING assemblyName, STRING nameSpace, STRING name);\ntMD_TypeDef* MetaData_GetTypeDefFromDefRefOrSpec(tMetaData *pMetaData, IDX_TABLE token, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\ntMD_TypeDef* MetaData_GetTypeDefFromMethodDef(tMD_MethodDef *pMethodDef);\ntMD_TypeDef* MetaData_GetTypeDefFromFieldDef(tMD_FieldDef *pFieldDef);\n\ntMD_MethodDef* MetaData_GetMethodDefFromDefRefOrSpec(tMetaData *pMetaData, IDX_TABLE token, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\n\ntMD_FieldDef* MetaData_GetFieldDefFromDefOrRef(tMetaData *pMetaData, IDX_TABLE token, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\n\ntMD_ImplMap* MetaData_GetImplMap(tMetaData *pMetaData, IDX_TABLE memberForwardedToken);\nSTRING MetaData_GetModuleRefName(tMetaData *pMetaData, IDX_TABLE memberRefToken);\n\n// instance functions\ntMetaData* MetaData();\nvoid MetaData_LoadStrings(tMetaData *pThis, void *pStream, unsigned int streamLen);\nvoid MetaData_LoadBlobs(tMetaData *pThis, void *pStream, unsigned int streamLen);\nvoid MetaData_LoadUserStrings(tMetaData *pThis, void *pStream, unsigned int streamLen);\nvoid MetaData_LoadGUIDs(tMetaData *pThis, void *pStream, unsigned int streamLen);\nvoid MetaData_LoadTables(tMetaData *pThis, tRVA *pRVA, void *pStream, unsigned int streamLen);\n\nPTR MetaData_GetBlob(BLOB_ blob, U32 *pBlobLength);\nSTRING2 MetaData_GetUserString(tMetaData *pThis, IDX_USERSTRINGS index, unsigned int *pStringLength);\n\nvoid* MetaData_GetTableRow(tMetaData *pThis, IDX_TABLE index);\n\nvoid MetaData_GetConstant(tMetaData *pThis, IDX_TABLE idx, PTR pResultMem);\n\n#endif\n"
  },
  {
    "path": "dna/MetaDataTables.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__METADATATABLES_H)\n#define __METADATATABLES_H\n\n// Forward typedef's (anything used in MetaData.h must be here)\ntypedef struct tMD_MethodDef_ tMD_MethodDef;\ntypedef struct tMD_FieldDef_ tMD_FieldDef;\ntypedef struct tMD_TypeDef_ tMD_TypeDef;\ntypedef struct tMD_MethodSpec_ tMD_MethodSpec;\ntypedef struct tMD_ImplMap_ tMD_ImplMap;\n\n#include \"Types.h\"\n#include \"JIT.h\"\n#include \"MetaData.h\"\n#include \"Generics.h\"\n\n// First, the combined tables\n\ntypedef struct tMDC_ToFieldDef_ tMDC_ToFieldDef;\nstruct tMDC_ToFieldDef_ {\n\ttMD_FieldDef *pFieldDef;\n};\n\ntypedef struct tMDC_ToMethodDef_ tMDC_ToMethodDef;\nstruct tMDC_ToMethodDef_ {\n\ttMD_MethodDef *pMethodDef;\n};\n\ntypedef struct tMDC_ToTypeDef_ tMDC_ToTypeDef;\nstruct tMDC_ToTypeDef_ {\n\ttMD_TypeDef *pTypeDef;\n};\n\n\n// Second, the raw metadata tables\n\n// Table 0x00 - Module\nstruct tMD_Module_ {\n\t// Module name - index into string heap\n\tSTRING name;\n\t// GUID for module version - index into GUID heap\n\tGUID_ mvID;\n};\ntypedef struct tMD_Module_ tMD_Module;\n\n// Table 0x01 - TypeRef\nstruct tMD_TypeRef_ {\n\t// Combined\n\ttMD_TypeDef *pTypeDef;\n\n\t// Table index into various tables\n\tIDX_TABLE resolutionScope;\n\t// Name of type ref - index into string heap\n\tSTRING name;\n\t// Namespace of type ref - index into string heap\n\tSTRING nameSpace;\n};\ntypedef struct tMD_TypeRef_ tMD_TypeRef;\n#define MD_TABLE_TYPEREF 0x01\n\n// Table 0x02 - TypeDef\nstruct tMD_TypeDef_ {\n\t// Combined\n\ttMD_TypeDef *pTypeDef;\n\t// MetaData pointer\n\ttMetaData *pMetaData;\n\n\t// Type attribute flags\n\tFLAGS32 flags;\n\t// Name of type def - index into string heap\n\tSTRING name;\n\t// Namespace of type def - index into string heap\n\tSTRING nameSpace;\n\t// The type that this type extends (inherits from)\n\tIDX_TABLE extends;\n\t// The first entry in the Field table of the fields of this type def\n\tIDX_TABLE fieldList;\n\t// The first entry in the Method table of the methods of this type def\n\tIDX_TABLE methodList;\n\n\t// Has this entry had its extended info filled?\n\tU8 isFilled;\n\t// Is this the last entry in this table?\n\tU8 isLast;\n\t// Is this a value type?\n\tU8 isValueType;\n\t// The type of evaluation stack entry needed for this type\n\tU8 stackType;\n\t// Total memory size of instances of this type (its in-memory representation) (not static fields)\n\tU32 instanceMemSize;\n\t// The parent type definition\n\ttMD_TypeDef *pParent;\n\t// The virtual method table\n\ttMD_MethodDef **pVTable;\n\t// The number of virtual methods in the vTable\n\tU32 numVirtualMethods;\n\t// Pointer to the memory for any static fields in this type. This will be NULL if type has no static fields\n\tPTR pStaticFields;\n\t// Has the static constructor been executed yet?\n\tU8 isTypeInitialised;\n\t// Is this a generic definition (a generic core type)?\n\tU8 isGenericDefinition;\n\t// Is this TypeDef primed - this means that:\n\t// numPrimedFields, numPrimedMethods, numVirtualMethods\n\t// have been pre-set.\n\tU8 isPrimed;\n\t// padding\n\tU8 padding0[1];\n\t// If this type has a static constructor, then store it here. NULL if no static constructor\n\ttMD_MethodDef *pStaticConstructor;\n\t// The size of this type when in an array\n\tU32 arrayElementSize;\n\t// The size of this type when on the stack (or in a field)\n\tU32 stackSize;\n\t// How many interfaces does this type implement\n\tU32 numInterfaces;\n\t// All interfaces that this type implements are mapped here\n\ttInterfaceMap *pInterfaceMaps;\n\t// The original table index of this TypeDef\n\tIDX_TABLE tableIndex;\n\t// If this is a generic type definition, then store any instantiatations here (in a linked list)\n\ttGenericInstance *pGenericInstances;\n\t// If this is a generic instance, then store link to its core definition type\n\ttMD_TypeDef *pGenericDefinition;\n\t// If this is a generic instance, then store the class type args\n\ttMD_TypeDef **ppClassTypeArgs;\n\t// If this type is System.Array, then this stores the element type\n\ttMD_TypeDef *pArrayElementType;\n\t// The number of fields in this type. This includes and static fields, but not inherited fields\n\tU32 numFields;\n\t// Links to all the fields (in memory order), including statics (not inherited)\n\ttMD_FieldDef **ppFields;\n\t// The memory needed for static fields, in bytes\n\tU32 staticFieldSize;\n\t// The number of methods in this type. This includes static methods, but not inherited methods\n\tU32 numMethods;\n\t// Links to all method in this type, including statics, not inherited\n\ttMD_MethodDef **ppMethods;\n\t// If this is a nested class, this records which type it is nested within.\n\ttMD_TypeDef *pNestedIn;\n\t// If this type has a finalizer, point to it here\n\ttMD_MethodDef *pFinalizer;\n\t// Pointer to the heap object which is the Type class object for this type.\n\t// This is only allocated as needed, so defaults to NULL\n\tHEAP_PTR typeObject;\n};\n#define MD_TABLE_TYPEDEF 0x02\n\nstruct tMD_FieldDef_ {\n\t// Combined\n\ttMD_FieldDef *pFieldDef;\n\t// MetaData pointer\n\ttMetaData *pMetaData;\n\n\t// Flags - FieldAttributes\n\tFLAGS16 flags;\n\t// Padding dummy entry\n\tI16 padding0;\n\t// Name of the field\n\tSTRING name;\n\t// Signature of the field\n\tBLOB_ signature;\n\n\t// The type of this field\n\ttMD_TypeDef *pType;\n\t// The type that contains this field\n\ttMD_TypeDef *pParentType;\n\t// The field offset within its containing type\n\tU32 memOffset;\n\t// The size in bytes that this field takes up in the memory representation\n\tU32 memSize;\n\t// The original table index of this FieldDef\n\tIDX_TABLE tableIndex;\n\t// If this is a static field, then the absolute address of this field is stored here.\n\t// If this field has an RVA, then the pointer to the memory location is stored here.\n\t// If this is a literal field, then this is a pointer to the tMD_Constant literal definition.\n\tPTR pMemory;\n};\n#define MD_TABLE_FIELDDEF 0x04\n\n// Table 0x06 - MethodDef\nstruct tMD_MethodDef_ {\n\t// Combined\n\ttMD_MethodDef *pMethodDef;\n\t// MetaData pointer\n\ttMetaData *pMetaData;\n\n\t// RVA converted to pointer. Code for this method\n\tU8 *pCIL;\n\t// Flags - MethodImplAttributes\n\tFLAGS16 implFlags;\n\t// Flags - MethodAttribute\n\tFLAGS16 flags;\n\t// Name of method\n\tSTRING name;\n\t// Signature of method\n\tBLOB_ signature;\n\t// The first entry in the Param table of the parameters of this method def\n\tIDX_TABLE paramList;\n\n\t// If this method has been JITted, then this points to it\n\ttJITted *pJITted;\n\t// Has the extra infomation in this method been filled in yet?\n\tU8 isFilled;\n\t// Set true if this method has generic parameters\n\tU8 isGenericDefinition;\n\t// The number of parameters for this method. This includes the 'this' parameter if non-static method\n\tU16 numberOfParameters;\n\t// The parameter information for this method, including the 'this' parameter if non-static method\n\ttParameter *pParams;\n\t// The size in bytes needed for the parameters, including the 'this' parameter if non-static method\n\tU32 parameterStackSize;\n\t// The method return type\n\ttMD_TypeDef *pReturnType;\n\t// The type that this method is a part of\n\ttMD_TypeDef *pParentType;\n\t// The original table index of this MethodDef\n\tIDX_TABLE tableIndex;\n\t// If this is a virtual method then this contains the offset into the vTable for this method.\n\t// This offset is the table index - not the byte offset.\n\tU32 vTableOfs;\n\t// If this is method has generic parameters, then store the method type args\n\ttMD_TypeDef **ppMethodTypeArgs;\n\t// If this is a generic core method, then store type instances here.\n\ttGenericMethodInstance *pGenericMethodInstances;\n\n#ifdef GEN_COMBINED_OPCODES\n\t// The number of times this method is on the call stack of all threads\n\tU32 callStackCount;\n\t// The number of times this method has been called\n\tU64 genCallCount;\n\t// Pointer to the method that has the next highest number of calls\n\ttMD_MethodDef *pNextHighestCalls;\n\t// Pointer to the method that has the prev highest number of calls\n\ttMD_MethodDef *pPrevHighestCalls;\n\t// If this method currently has a combined opcode JIT version, then point to it here.\n\ttJITted *pJITtedCombined;\n#endif\n\n#ifdef DIAG_METHOD_CALLS\n\t// Number of times this method has been called\n\tU32 callCount;\n\t// Total time (inclusive of children) in this function\n\tU64 totalTime;\n#endif\n};\n#define MD_TABLE_METHODDEF 0x06\n\n// Table 0x08 - Param\n#define MD_TABLE_PARAM 0x08\ntypedef struct tMD_Param_ tMD_Param;\nstruct tMD_Param_ {\n\t// Flags - ParamAttributes\n\tFLAGS16 flags;\n\t// The sequence number of the parameter. 0 is the return value, 1+ are the parameters\n\tU16 sequence;\n\t// The name of the parameter (optional)\n\tSTRING name;\n};\n\n// Table 0x09 - InterfaceImpl\n#define MD_TABLE_INTERFACEIMPL 0x09\ntypedef struct tMD_InterfaceImpl_ tMD_InterfaceImpl;\nstruct tMD_InterfaceImpl_ {\n\t// The class that implements...\n\tIDX_TABLE class_;\n\t// ...this interface\n\tIDX_TABLE interface_;\n};\n\n// Table 0x0A - MemberRef\nstruct tMD_MemberRef_ {\n\t// Combined\n\tunion {\n\t\ttMD_MethodDef *pMethodDef;\n\t\ttMD_FieldDef *pFieldDef;\n\t} u;\n\n\t// Type of member, coded index: MemberRefParent\n\tIDX_TABLE class_;\n\t// Name of the member\n\tSTRING name;\n\t// Signature of the member\n\tBLOB_ signature;\n};\ntypedef struct tMD_MemberRef_ tMD_MemberRef;\n#define MD_TABLE_MEMBERREF 0x0a\n\n// Table 0x0B - Constant\nstruct tMD_Constant_ {\n\t// The ELEMENT_TYPE of the constant - 'void' is ELEMENT_TYPE_CLASS with a 0 blob index\n\tU8 type;\n\t// Padding\n\tU8 padding0[3];\n\t// The parent of this constant - HasConstant encoded table index\n\tIDX_TABLE parent;\n\t// The value of the constant, index in the BLOB heap\n\tBLOB_ value;\n};\ntypedef struct tMD_Constant_ tMD_Constant;\n#define MD_TABLE_CONSTANT 0x0b\n\n// Table 0x0C - CustomAttribute\nstruct tMD_CustomAttribute_ {\n\t// Parent\n\tIDX_TABLE parent;\n\t// Type\n\tIDX_TABLE type;\n\t// value of attribute\n\tBLOB_ value;\n};\ntypedef struct tMD_CustomAttribute_ tMD_CustomAttribute;\n#define MD_TABLE_CUSTOMATTRIBUTE 0x0c\n\n#define MD_TABLE_DECLSECURITY 0x0e\ntypedef struct tMD_DeclSecurity_ tMD_DeclSecurity;\nstruct tMD_DeclSecurity_ {\n\t// The security action\n\tU16 action;\n\t// Padding\n\tU16 padding0;\n\t// The parent typedef, methoddef or assembly of this security info - HasDeclSecurity coded index\n\tIDX_TABLE parent;\n\t// The security permission set\n\tBLOB_ permissionSet;\n};\n\n// Table 0x0F - ClassLayout\nstruct tMD_ClassLayout_ {\n\t// The packing size\n\tU16 packingSize;\n\t// Padding\n\tU16 padding0;\n\t// The class size\n\tU32 classSize;\n\t// The parent TypeDef\n\tIDX_TABLE parent;\n};\ntypedef struct tMD_ClassLayout_ tMD_ClassLayout;\n\n// Table 0x11 - StandAloneSig\nstruct tMD_StandAloneSig_ {\n\tBLOB_ signature;\n};\ntypedef struct tMD_StandAloneSig_ tMD_StandAloneSig;\n\n// Table 0x12 - EventMap\nstruct tMD_EventMap_ {\n\t// Index into TypeDef table\n\tIDX_TABLE parent;\n\t// Index into Event table. Marks the start of a continuous run of events owned by this type.\n\tIDX_TABLE eventList;\n};\ntypedef struct tMD_EventMap_ tMD_EventMap;\n\n// Table 0x14 - Event\nstruct tMD_Event_ {\n\t// Flags of type eventAttributes\n\tFLAGS16 eventFlags;\n\t// Padding\n\tU16 padding0;\n\t// The name of the event\n\tSTRING name;\n\t// The type of this event. A TypeDefOrRef index. This is NOT the type to which this event belongs.\n\tIDX_TABLE eventType;\n};\ntypedef struct tMD_Event_ tMD_Event;\n\n// Table 0x15 - PropertyMap\nstruct tMD_PropertyMap_ {\n\t// Parent - index into TypeDef table\n\tIDX_TABLE parent;\n\t// PropertyList - index into Property table\n\tIDX_TABLE propertyList;\n};\ntypedef struct tMD_PropertyMap tMD_PropertyMap;\n\n// Table 0x17 - Property\nstruct tMD_Property_ {\n\t// Flags - PropertyAttributes\n\tFLAGS16 flags;\n\t// Padding dummy entry\n\tI16 padding0;\n\t// Name\n\tSTRING name;\n\t// The type signature\n\tBLOB_ typeSig;\n};\ntypedef struct tMD_Property_ tMD_Property;\n#define MD_TABLE_PROPERTY 0x17\n\n// Table 0x18 - MethodSemantics\nstruct tMD_MethodSemantics_ {\n\t// semantics flags - MethodSemanticsAttributes\n\tFLAGS16 semantics;\n\t// Padding dummy entry\n\tI16 padding0;\n\t// method - entry into MethodDef table\n\tIDX_TABLE method;\n\t// HasSemantics coded entry - index into Event or Property tables\n\tIDX_TABLE association;\n};\ntypedef struct tMD_MethodSemantics_ tMD_MethodSemantics;\n#define MD_TABLE_METHODSEMANTICS 0x18\n\n// Table 0x19 - MethodImpl\n#define MD_TABLE_METHODIMPL 0x19\ntypedef struct tMD_MethodImpl_ tMD_MethodImpl;\nstruct tMD_MethodImpl_ {\n\t// Index into TypeDef table\n\tIDX_TABLE class_;\n\t// The method to use as the interface implementation. Coded index MethodDefOrRef\n\tIDX_TABLE methodBody;\n\t// The method declaration that is being overriden. Coded index MethodDefOrRef\n\tIDX_TABLE methodDeclaration;\n};\n\n#define MD_TABLE_MODULEREF 0x1a\ntypedef struct tMD_ModuleRef_ tMD_ModuleRef;\nstruct tMD_ModuleRef_ {\n\t// The module name referenced\n\tSTRING name;\n};\n\n// Table 0x1B - TypeSpec\n#define MD_TABLE_TYPESPEC 0x1b\ntypedef struct tMD_TypeSpec_ tMD_TypeSpec;\nstruct tMD_TypeSpec_ {\n\t// Combined\n\ttMD_TypeDef *pTypeDef;\n\t// MetaData pointer\n\ttMetaData *pMetaData;\n\n\t// The signature of the type\n\tBLOB_ signature;\n};\n\n#define MD_TABLE_IMPLMAP 0x1c\nstruct tMD_ImplMap_ {\n\t// Mapping flags of type PInvokeAttributes\n\tU16 mappingFlags;\n\t// padding\n\tU16 padding;\n\t// A MemberForwarded coded index, specifying which member is forwarded. Note that only members are allowed.\n\tIDX_TABLE memberForwarded;\n\t// The import name\n\tSTRING importName;\n\t// The module ref (scope) of the import\n\tIDX_TABLE importScope;\n};\n\n// Table 0x1D - FieldRVA\nstruct tMD_FieldRVA_ {\n\t// The RVA of the initial data for the field\n\tU32 rva;\n\t// Index into the field table\n\tIDX_TABLE field;\n};\ntypedef struct tMD_FieldRVA_ tMD_FieldRVA;\n#define MD_TABLE_FIELDRVA 0x1d\n\n// Table 0x20 - Assembly\nstruct tMD_Assembly_ {\n\t// Hash algorithm ID of type AssemblyHashAlgorithm\n\tU32 hashAlgID;\n\t// Version info\n\tU16 majorVersion, minorVersion, buildNumber, revisionNumber;\n\t// Flags - AssemblyFlags\n\tFLAGS32 flags;\n\t// Public key\n\tBLOB_ publicKey;\n\t// Name\n\tSTRING name;\n\t// Culture\n\tSTRING culture;\n};\ntypedef struct tMD_Assembly_ tMD_Assembly;\n#define MD_TABLE_ASSEMBLY 0x20\n\nstruct tMD_AssemblyRef_ {\n\t// Version info\n\tU16 majorVersion, minorVersion, buildNumber, revisionNumber;\n\t// Flags - AssemblyFlags\n\tFLAGS32 flags;\n\t// Public key or token\n\tBLOB_ publicKeyOrToken;\n\t// Name\n\tSTRING name;\n\t// Culture\n\tSTRING culture;\n\t// Hash value\n\tBLOB_ hashValue;\n};\ntypedef struct tMD_AssemblyRef_ tMD_AssemblyRef;\n#define MD_TABLE_ASSEMBLYREF 0x23\n\ntypedef struct tMD_NestedClass_ tMD_NestedClass;\nstruct tMD_NestedClass_ {\n\t// The TypeDef of the class that is nested\n\tIDX_TABLE nestedClass;\n\t// The TypeDef of the class in which nestedClass is enclosed\n\tIDX_TABLE enclosingClass;\n};\n#define MD_TABLE_NESTEDCLASS 0x29\n\n// Table 0x2A - Generic param\n#define MD_TABLE_GENERICPARAM 0x2A\ntypedef struct tMD_GenericParam_ tMD_GenericParam;\nstruct tMD_GenericParam_ {\n\t// The number of this generic parameter. Numbered left-to-right, starting from 0\n\tU16 number;\n\t// Flags - GenericParamAttributes\n\tFLAGS16 flags;\n\t// Owner - the TypeDef or MethodDef that owns this parameter - TypeOrMethodDef coded index\n\tIDX_TABLE owner;\n\t// The name of the parameter\n\tSTRING name;\n};\n\n// Table 0x2B - MethodSpec\n#define MD_TABLE_METHODSPEC 0x2B\nstruct tMD_MethodSpec_ {\n\t// Combined\n\ttMD_MethodDef *pMethodDef;\n\t// MetaData pointer\n\ttMetaData *pMetaData;\n\n\t// Index into MethodDef or MethodRef specifying which method this spec refers to\n\tIDX_TABLE method;\n\t// Index into blob heap, holding the signature of this instantiation\n\tBLOB_ instantiation;\n};\n\n// Table 0x2C - GenericParamConstraint\n#define MD_TABLE_GENERICPARAMCONSTRAINT 0x2C\ntypedef struct tMD_GenericParamConstraint_ tMD_GenericParamConstraint;\nstruct tMD_GenericParamConstraint_ {\n\t// The generic param that this constraint applies to\n\ttMD_GenericParam *pGenericParam;\n\t// The type of the constraint (coded index TypeDefOrRef)\n\tIDX_TABLE constraint;\n};\n\n#endif\n"
  },
  {
    "path": "dna/MetaData_Fill.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"MetaData.h\"\n#include \"CLIFile.h\"\n#include \"Type.h\"\n#include \"EvalStack.h\"\n\nvoid MetaData_Fill_FieldDef(tMD_TypeDef *pParentType, tMD_FieldDef *pFieldDef, U32 memOffset, tMD_TypeDef **ppClassTypeArgs) {\n\tU32 sigLength;\n\tPTR sig;\n\ttMetaData *pMetaData;\n\n\tpFieldDef->pParentType = pParentType;\n\n\tsig = MetaData_GetBlob(pFieldDef->signature, &sigLength);\n\n\tMetaData_DecodeSigEntry(&sig); // First entry always 0x06\n\tpFieldDef->pType = Type_GetTypeFromSig(pFieldDef->pMetaData, &sig, ppClassTypeArgs, NULL);\n\tif (pFieldDef->pType == NULL) {\n\t\t// If the field is a core generic type definition, then we can't do anything more\n\t\treturn;\n\t}\n\tMetaData_Fill_TypeDef(pFieldDef->pType, NULL, NULL);\n\t// A check for 0 is done so if a type has a field of it's own type it is handled correctly.\n\tpFieldDef->memSize = (pFieldDef->pType->stackSize>0)?pFieldDef->pType->stackSize:sizeof(void*);\n\tpFieldDef->memOffset = memOffset;\n\tpFieldDef->pFieldDef = pFieldDef;\n\n\tpMetaData = pFieldDef->pMetaData;\n\tif (FIELD_HASFIELDRVA(pFieldDef)) {\n\t\tU32 i, top;\n\n\t\t// Field has RVA, so load it from FieldRVA\n\t\ttop = pMetaData->tables.numRows[MD_TABLE_FIELDRVA];\n\t\tfor (i=1; i<=top; i++) {\n\t\t\ttMD_FieldRVA *pFieldRVA;\n\n\t\t\tpFieldRVA = (tMD_FieldRVA*)MetaData_GetTableRow(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_FIELDRVA, i));\n\t\t\tif (pFieldRVA->field == pFieldDef->tableIndex) {\n\t\t\t\tpFieldDef->pMemory = (PTR)pFieldRVA->rva;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} else if (FIELD_ISLITERAL(pFieldDef)) {\n\t\t// Field is literal, so make pMemory point to the value signature\n\t\tU32 i, top;\n\n\t\ttop = pMetaData->tables.numRows[MD_TABLE_CONSTANT];\n\t\tfor (i=1; i<=top; i++) {\n\t\t\ttMD_Constant *pConst;\n\t\t\tpConst = (tMD_Constant*)MetaData_GetTableRow(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_CONSTANT, i));\n\t\t\tif (pConst->parent == pFieldDef->tableIndex) {\n\t\t\t\t// Found the field\n\t\t\t\tpFieldDef->pMemory = (PTR)pConst;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n}\n\nvoid MetaData_Fill_MethodDef(tMD_TypeDef *pParentType, tMD_MethodDef *pMethodDef, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\tSIG sig;\n\tU32 i, entry, totalSize;\n\n\tpMethodDef->pParentType = pParentType;\n\tpMethodDef->pMethodDef = pMethodDef;\n\tpMethodDef->isFilled = 1;\n\n\tif (pMethodDef->isGenericDefinition) {\n\t\t// Generic definition method, so can't do any more.\n\t\t//log_f(\"Method<>: %s.%s.%s()\\n\", pParentType->nameSpace, pParentType->name, pMethodDef->name);\n\t\treturn;\n\t}\n\n\tsig = MetaData_GetBlob(pMethodDef->signature, NULL);\n\tentry = MetaData_DecodeSigEntry(&sig);\n\tif (entry & SIG_METHODDEF_GENERIC) {\n\t\t// Has generic parameters. Read how many, but don't care about the answer\n\t\tMetaData_DecodeSigEntry(&sig);\n\t}\n\tpMethodDef->numberOfParameters = MetaData_DecodeSigEntry(&sig) + (METHOD_ISSTATIC(pMethodDef)?0:1);\n\tpMethodDef->pReturnType = Type_GetTypeFromSig(pMethodDef->pMetaData, &sig, ppClassTypeArgs, ppMethodTypeArgs);\n\tif (pMethodDef->pReturnType != NULL) {\n\t\tMetaData_Fill_TypeDef(pMethodDef->pReturnType, NULL, NULL);\n\t}\n\tpMethodDef->pParams = (tParameter*)malloc(pMethodDef->numberOfParameters * sizeof(tParameter));\n\ttotalSize = 0;\n\tif (!METHOD_ISSTATIC(pMethodDef)) {\n\t\t// Fill in parameter info for the 'this' pointer\n\t\tpMethodDef->pParams->offset = 0;\n\t\tif (pParentType->isValueType) {\n\t\t\t// If this is a value-type then the 'this' pointer is actually an IntPtr to the value-type's location\n\t\t\tpMethodDef->pParams->size = 4;\n\t\t\tpMethodDef->pParams->pTypeDef = types[TYPE_SYSTEM_INTPTR];\n\t\t} else {\n\t\t\tpMethodDef->pParams->size = 4;\n\t\t\tpMethodDef->pParams->pTypeDef = pParentType;\n\t\t}\n\t\ttotalSize = 4;\n\t}\n\tfor (i=totalSize>>2; i<pMethodDef->numberOfParameters; i++) {\n\t\ttMD_TypeDef *pTypeDef;\n\t\tU32 size;\n\n\t\tpTypeDef = Type_GetTypeFromSig(pMethodDef->pMetaData, &sig, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t//if (pTypeDef != NULL) {\n\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\tsize = pTypeDef->stackSize;\n\t\t//} else {\n\t\t//\t// If this method has generic-type-argument arguments, then we can't do anything very sensible yet\n\t\t//\tsize = 0;\n\t\t//}\n\t\tpMethodDef->pParams[i].pTypeDef = pTypeDef;\n\t\tpMethodDef->pParams[i].offset = totalSize;\n\t\tpMethodDef->pParams[i].size = size;\n\t\ttotalSize += size;\n\t}\n\tpMethodDef->parameterStackSize = totalSize;\n}\n\n// Find the method that has been overridden by pMethodDef.\n// This is to get the correct vTable offset for the method.\n// This must search the MethodImpl table to see if the default inheritence rules are being overridden.\n// Return NULL if this method does not override anything.\nstatic tMD_MethodDef* FindVirtualOverriddenMethod(tMD_TypeDef *pTypeDef, tMD_MethodDef *pMethodDef) {\n\tU32 i;\n\n\tdo {\n\t\t// Search MethodImpl table\n\t\tfor (i=pTypeDef->pMetaData->tables.numRows[MD_TABLE_METHODIMPL]; i>0; i--) {\n\t\t\ttMD_MethodImpl *pMethodImpl;\n\n\t\t\tpMethodImpl = (tMD_MethodImpl*)MetaData_GetTableRow(pTypeDef->pMetaData, MAKE_TABLE_INDEX(MD_TABLE_METHODIMPL, i));\n\t\t\tif (pMethodImpl->class_ == pTypeDef->tableIndex) {\n\t\t\t\ttMD_MethodDef *pMethodDeclDef;\n\n\t\t\t\tpMethodDeclDef = MetaData_GetMethodDefFromDefRefOrSpec(pTypeDef->pMetaData, pMethodImpl->methodDeclaration, pTypeDef->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs);\n\t\t\t\tif (pMethodDeclDef->tableIndex == pMethodDef->tableIndex) {\n\t\t\t\t\tIDX_TABLE methodToken;\n\t\t\t\t\ttMD_MethodDef *pMethod;\n\n\t\t\t\t\tmethodToken = pMethodImpl->methodBody;\n\t\t\t\t\tpMethod = (tMD_MethodDef*)MetaData_GetTableRow(pTypeDef->pMetaData, methodToken);\n\t\t\t\t\treturn pMethod;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Use normal inheritence rules\n\t\t// It must be a virtual method that's being overridden.\n\t\tfor (i=pTypeDef->numVirtualMethods - 1; i != 0xffffffff; i--) {\n\t\t\tif (MetaData_CompareNameAndSig(pMethodDef->name, pMethodDef->signature, pMethodDef->pMetaData, pMethodDef->pParentType->ppClassTypeArgs, pMethodDef->ppMethodTypeArgs, pTypeDef->pVTable[i], pTypeDef->ppClassTypeArgs, NULL)) {\n\t\t\t\treturn pTypeDef->pVTable[i];\n\t\t\t}\n\t\t}\n\t\tpTypeDef = pTypeDef->pParent;\n\t} while (pTypeDef != NULL);\n\n\treturn NULL;\n}\n\nvoid MetaData_Fill_TypeDef_(tMD_TypeDef *pTypeDef, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\tIDX_TABLE firstIdx, lastIdx, token;\n\tU32 instanceMemSize, staticMemSize, virtualOfs, i, j;\n\ttMetaData *pMetaData;\n\ttMD_TypeDef *pParent;\n\n\tpMetaData = pTypeDef->pMetaData;\n\tpTypeDef->isFilled = 1;\n\tpTypeDef->pTypeDef = pTypeDef;\n\n\tpTypeDef->pParent = MetaData_GetTypeDefFromDefRefOrSpec(pMetaData, pTypeDef->extends, ppClassTypeArgs, ppMethodTypeArgs);\n\tpParent = pTypeDef->pParent;\n\n\tif (pParent != NULL) {\n\t\tMetaData_Fill_TypeDef(pParent, NULL, NULL);\n\t\tvirtualOfs = pParent->numVirtualMethods;\n\t} else {\n\t\tvirtualOfs = 0;\n\t}\n\tpTypeDef->isValueType = (U8)Type_IsValueType(pTypeDef);\n\n\t// If not primed, then work out how many methods & fields there are.\n\tif (!pTypeDef->isPrimed) {\n\t\t// Methods\n\t\tlastIdx = (pTypeDef->isLast)?\n\t\t\tMAKE_TABLE_INDEX(MD_TABLE_METHODDEF, pTypeDef->pMetaData->tables.numRows[MD_TABLE_METHODDEF]):\n\t\t\t(pTypeDef[1].methodList - 1);\n\t\tpTypeDef->numMethods = lastIdx - pTypeDef->methodList + 1;\n\t\t// Fields\n\t\tlastIdx = (pTypeDef->isLast)?\n\t\t\tMAKE_TABLE_INDEX(MD_TABLE_FIELDDEF, pTypeDef->pMetaData->tables.numRows[MD_TABLE_FIELDDEF]):\n\t\t\t(pTypeDef[1].fieldList - 1);\n\t\tpTypeDef->numFields = lastIdx - pTypeDef->fieldList + 1;\n\t}\n\n\t// Must create the virtual method table BEFORE any other type resolution is done\n\t// Note that this must not do ANY filling of types or methods.\n\t// This is to ensure that the parent object(s) in any type inheritance hierachy are allocated\n\t// their virtual method offset before derived types.\n\tfirstIdx = pTypeDef->methodList;\n\tlastIdx = firstIdx + pTypeDef->numMethods - 1;\n\t// This only needs to be done for non-generic types, or for generic types that are not a definition\n\t// I.e. Fully instantiated generic types\n\tif (!pTypeDef->isGenericDefinition) {\n\t\tfor (token = firstIdx; token <= lastIdx; token++) {\n\t\t\ttMD_MethodDef *pMethodDef;\n\n\t\t\tpMethodDef = MetaData_GetMethodDefFromDefRefOrSpec(pMetaData, token, ppClassTypeArgs, ppMethodTypeArgs);\n\n\t\t\t// This is needed, so array resolution can work correctly and FindVirtualOverriddenMethod() can work.\n\t\t\tpMethodDef->pParentType = pTypeDef;\n\n\t\t\tif (METHOD_ISVIRTUAL(pMethodDef)) {\n\t\t\t\tif (METHOD_ISNEWSLOT(pMethodDef) || pTypeDef->pParent == NULL) {\n\t\t\t\t\t// Allocate a new vTable slot if method is explicitly marked as NewSlot, or\n\t\t\t\t\t// this is of type Object.\n\t\t\t\t\tpMethodDef->vTableOfs = virtualOfs++;\n\t\t\t\t} else {\n\t\t\t\t\ttMD_MethodDef *pVirtualOveriddenMethod;\n\n\t\t\t\t\tpVirtualOveriddenMethod = FindVirtualOverriddenMethod(pTypeDef->pParent, pMethodDef);\n\t\t\t\t\tAssert(pVirtualOveriddenMethod != NULL);\n\t\t\t\t\tpMethodDef->vTableOfs = pVirtualOveriddenMethod->vTableOfs;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Dummy value - make it obvious it's not valid!\n\t\t\t\tpMethodDef->vTableOfs = 0xffffffff;\n\t\t\t}\n\n\t\t}\n\t\t// Create the virtual method table\n\t\tpTypeDef->numVirtualMethods = virtualOfs;\n\n\t\t// Resolve fields, members, interfaces.\n\t\t// Only needs to be done if it's not a generic definition type\n\n\t\t// It it's not a value-type and the stack-size is not preset, then set it up now.\n\t\t// It needs to be done here as non-static fields in non-value types can point to the containing type\n\t\tif (pTypeDef->stackSize == 0 && !pTypeDef->isValueType) {\n\t\t\tpTypeDef->stackType = EVALSTACK_O;\n\t\t\tpTypeDef->stackSize = sizeof(void*);\n\t\t}\n\t\t// Resolve all fields - instance ONLY at this point,\n\t\t// because static fields in value-types can be of the containing type, and the size is not yet known.\n\t\tfirstIdx = pTypeDef->fieldList;\n\t\tlastIdx = firstIdx + pTypeDef->numFields - 1;\n\t\tstaticMemSize = 0;\n\t\tif (pTypeDef->numFields > 0) {\n\t\t\tpTypeDef->ppFields = mallocForever(pTypeDef->numFields * sizeof(tMD_FieldDef*));\n\t\t}\n\t\tinstanceMemSize = (pTypeDef->pParent == NULL)?0:pTypeDef->pParent->instanceMemSize;\n\t\tfor (token = firstIdx, i=0; token <= lastIdx; token++, i++) {\n\t\t\ttMD_FieldDef *pFieldDef;\n\n\t\t\tpFieldDef = MetaData_GetFieldDefFromDefOrRef(pMetaData, token, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\tif (!FIELD_ISSTATIC(pFieldDef)) {\n\t\t\t\t// Only handle non-static fields at the moment\n\t\t\t\tif (pTypeDef->pGenericDefinition != NULL) {\n\t\t\t\t\t// If this is a generic instantiation type, then all field defs need to be copied,\n\t\t\t\t\t// as there will be lots of different instantiations.\n\t\t\t\t\ttMD_FieldDef *pFieldCopy = TMALLOCFOREVER(tMD_FieldDef);\n\t\t\t\t\tmemcpy(pFieldCopy, pFieldDef, sizeof(tMD_FieldDef));\n\t\t\t\t\tpFieldDef = pFieldCopy;\n\t\t\t\t}\n\t\t\t\tif (FIELD_ISLITERAL(pFieldDef) || FIELD_HASFIELDRVA(pFieldDef)) {\n\t\t\t\t\t// If it's a literal, then analyse the field, but don't include it in any memory allocation\n\t\t\t\t\t// If is has an RVA, then analyse the field, but don't include it in any memory allocation\n\t\t\t\t\tMetaData_Fill_FieldDef(pTypeDef, pFieldDef, 0, ppClassTypeArgs);\n\t\t\t\t} else {\n\t\t\t\t\tMetaData_Fill_FieldDef(pTypeDef, pFieldDef, instanceMemSize, ppClassTypeArgs);\n\t\t\t\t\tinstanceMemSize += pFieldDef->memSize;\n\t\t\t\t}\n\t\t\t\tpTypeDef->ppFields[i] = pFieldDef;\n\t\t\t}\n\t\t}\n\t\tif (pTypeDef->instanceMemSize == 0) {\n\t\t\tpTypeDef->instanceMemSize = instanceMemSize;\n\t\t}\n\n\t\t// Sort out stack type and size.\n\t\t// Note that this may already be set, as some basic types have this preset;\n\t\t// or if it's not a value-type it'll already be set\n\t\tif (pTypeDef->stackSize == 0) {\n\t\t\t// if it gets here then it must be a value type\n\t\t\tpTypeDef->stackType = EVALSTACK_VALUETYPE;\n\t\t\tpTypeDef->stackSize = pTypeDef->instanceMemSize;\n\t\t}\n\t\t// Sort out array element size. Note that some basic types will have this preset.\n\t\tif (pTypeDef->arrayElementSize == 0) {\n\t\t\tpTypeDef->arrayElementSize = pTypeDef->stackSize;\n\t\t}\n\n\t\t// Handle static fields\n\t\tfor (token = firstIdx, i=0; token <= lastIdx; token++, i++) {\n\t\t\ttMD_FieldDef *pFieldDef;\n\n\t\t\tpFieldDef = MetaData_GetFieldDefFromDefOrRef(pMetaData, token, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\tif (FIELD_ISSTATIC(pFieldDef)) {\n\t\t\t\t// Only handle static fields here\n\t\t\t\tif (pTypeDef->pGenericDefinition != NULL) {\n\t\t\t\t\t// If this is a generic instantiation type, then all field defs need to be copied,\n\t\t\t\t\t// as there will be lots of different instantiations.\n\t\t\t\t\ttMD_FieldDef *pFieldCopy = TMALLOCFOREVER(tMD_FieldDef);\n\t\t\t\t\tmemcpy(pFieldCopy, pFieldDef, sizeof(tMD_FieldDef));\n\t\t\t\t\tpFieldDef = pFieldCopy;\n\t\t\t\t}\n\t\t\t\tif (FIELD_ISLITERAL(pFieldDef) || FIELD_HASFIELDRVA(pFieldDef)) {\n\t\t\t\t\t// If it's a literal, then analyse the field, but don't include it in any memory allocation\n\t\t\t\t\t// If is has an RVA, then analyse the field, but don't include it in any memory allocation\n\t\t\t\t\tMetaData_Fill_FieldDef(pTypeDef, pFieldDef, 0, ppClassTypeArgs);\n\t\t\t\t} else {\n\t\t\t\t\tMetaData_Fill_FieldDef(pTypeDef, pFieldDef, staticMemSize, ppClassTypeArgs);\n\t\t\t\t\tstaticMemSize += pFieldDef->memSize;\n\t\t\t\t}\n\t\t\t\tpTypeDef->ppFields[i] = pFieldDef;\n\t\t\t}\n\t\t}\n\t\tif (staticMemSize > 0) {\n\t\t\tpTypeDef->pStaticFields = mallocForever(staticMemSize);\n\t\t\tmemset(pTypeDef->pStaticFields, 0, staticMemSize);\n\t\t\t// Set the field addresses (->pMemory) of all static fields\n\t\t\tfor (i = 0; i<pTypeDef->numFields; i++) {\n\t\t\t\ttMD_FieldDef *pFieldDef;\n\n\t\t\t\tpFieldDef = pTypeDef->ppFields[i];\n\t\t\t\tif (FIELD_ISSTATIC(pFieldDef) && pFieldDef->pMemory == NULL) {\n\t\t\t\t\t// Only set it if it isn't already set. It will be already set if this field has an RVA\n\t\t\t\t\tpFieldDef->pMemory = pTypeDef->pStaticFields + pFieldDef->memOffset;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpTypeDef->staticFieldSize = staticMemSize;\n\t\t}\n\n\t\t// Resolve all members\n\t\tfirstIdx = pTypeDef->methodList;\n\t\tlastIdx = firstIdx + pTypeDef->numMethods - 1;\n\t\tpTypeDef->ppMethods = mallocForever(pTypeDef->numMethods * sizeof(tMD_MethodDef*));\n\t\tpTypeDef->pVTable = mallocForever(pTypeDef->numVirtualMethods * sizeof(tMD_MethodDef*));\n\t\t// Copy initial vTable from parent\n\t\tif (pTypeDef->pParent != NULL) {\n\t\t\tmemcpy(pTypeDef->pVTable, pTypeDef->pParent->pVTable, pTypeDef->pParent->numVirtualMethods * sizeof(tMD_MethodDef*));\n\t\t}\n\t\tfor (token = firstIdx, i = 0; token <= lastIdx; token++, i++) {\n\t\t\ttMD_MethodDef *pMethodDef;\n\n\t\t\tpMethodDef = MetaData_GetMethodDefFromDefRefOrSpec(pMetaData, token, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\tif (pTypeDef->pGenericDefinition != NULL) {\n\t\t\t\t// If this is a generic instantiation type, then all method defs need to be copied,\n\t\t\t\t// as there will be lots of different instantiations.\n\t\t\t\ttMD_MethodDef *pMethodCopy = TMALLOCFOREVER(tMD_MethodDef);\n\t\t\t\tmemcpy(pMethodCopy, pMethodDef, sizeof(tMD_MethodDef));\n\t\t\t\tpMethodDef = pMethodCopy;\n\t\t\t}\n\t\t\tif (METHOD_ISSTATIC(pMethodDef) && strcmp(pMethodDef->name, \".cctor\") == 0) {\n\t\t\t\t// This is a static constructor\n\t\t\t\tpTypeDef->pStaticConstructor = pMethodDef;\n\t\t\t}\n\t\t\tif (!METHOD_ISSTATIC(pMethodDef) && pTypeDef->pParent != NULL &&\n\t\t\t\tstrcmp(pMethodDef->name, \"Finalize\") == 0) {\n\t\t\t\t// This is a Finalizer method, but not for Object.\n\t\t\t\t// Delibrately miss out Object's Finalizer because it's empty and will cause every object\n\t\t\t\t// of any type to have a Finalizer which will be terrible for performance.\n\t\t\t\tpTypeDef->pFinalizer = pMethodDef;\n\t\t\t}\n\t\t\tif (METHOD_ISVIRTUAL(pMethodDef)) {\n\t\t\t\t// This is a virtual method, so enter it in the vTable\n\t\t\t\tpTypeDef->pVTable[pMethodDef->vTableOfs] = pMethodDef;\n\t\t\t}\n\t\t\tpTypeDef->ppMethods[i] = pMethodDef;\n\t\t}\n\t\t// Find inherited Finalizer, if this type doesn't have an explicit Finalizer, and if there is one\n\t\tif (pTypeDef->pFinalizer == NULL) {\n\t\t\ttMD_TypeDef *pInheritedType = pTypeDef->pParent;\n\t\t\twhile (pInheritedType != NULL) {\n\t\t\t\tif (pInheritedType->pFinalizer != NULL) {\n\t\t\t\t\tpTypeDef->pFinalizer = pInheritedType->pFinalizer;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tpInheritedType = pInheritedType->pParent;\n\t\t\t}\n\t\t}\n\t\t// Fill all method definitions for this type\n\t\tfor (i=0; i<pTypeDef->numMethods; i++) {\n\t\t\tMetaData_Fill_MethodDef(pTypeDef, pTypeDef->ppMethods[i], ppClassTypeArgs, ppMethodTypeArgs);\n\t\t}\n\n\t\t// Map all interface method calls. This only needs to be done for Classes, not Interfaces\n\t\t// And is not done for generic definitions.\n\t\tif (!TYPE_ISINTERFACE(pTypeDef)) {\n\t\t\tfirstIdx = 0;\n\t\t\tif (pTypeDef->pParent != NULL) {\n\t\t\t\tj = pTypeDef->numInterfaces = pTypeDef->pParent->numInterfaces;\n\t\t\t} else {\n\t\t\t\tj = 0;\n\t\t\t}\n\t\t\t// TODO: Better to do this once during file load (the bit in this for loop)\n\t\t\tfor (i=1; i<=pMetaData->tables.numRows[MD_TABLE_INTERFACEIMPL]; i++) {\n\t\t\t\ttMD_InterfaceImpl *pInterfaceImpl;\n\n\t\t\t\tpInterfaceImpl = (tMD_InterfaceImpl*)MetaData_GetTableRow(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_INTERFACEIMPL, i));\n\t\t\t\tif (pInterfaceImpl->class_ == pTypeDef->tableIndex) {\n\t\t\t\t\t// count how many interfaces are implemented\n\t\t\t\t\tpTypeDef->numInterfaces++;\n\t\t\t\t\tif (firstIdx == 0) {\n\t\t\t\t\t\tfirstIdx = MAKE_TABLE_INDEX(MD_TABLE_INTERFACEIMPL, i);\n\t\t\t\t\t}\n\t\t\t\t\tlastIdx = MAKE_TABLE_INDEX(MD_TABLE_INTERFACEIMPL, i);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (pTypeDef->numInterfaces > 0 && !pTypeDef->isGenericDefinition) {\n\t\t\t\tU32 mapNum;\n\n\t\t\t\tpTypeDef->pInterfaceMaps = (tInterfaceMap*)mallocForever(pTypeDef->numInterfaces * sizeof(tInterfaceMap));\n\t\t\t\t// Copy interface maps from parent type\n\t\t\t\tif (j > 0) {\n\t\t\t\t\tmemcpy(pTypeDef->pInterfaceMaps, pTypeDef->pParent->pInterfaceMaps, j * sizeof(tInterfaceMap));\n\t\t\t\t}\n\t\t\t\tmapNum = j;\n\t\t\t\tif (firstIdx > 0) {\n\t\t\t\t\tfor (token=firstIdx; token<=lastIdx; token++, mapNum++) {\n\t\t\t\t\t\ttMD_InterfaceImpl *pInterfaceImpl;\n\n\t\t\t\t\t\tpInterfaceImpl = (tMD_InterfaceImpl*)MetaData_GetTableRow(pMetaData, token);\n\t\t\t\t\t\tif (pInterfaceImpl->class_ == pTypeDef->tableIndex) {\n\t\t\t\t\t\t\ttMD_TypeDef *pInterface;\n\t\t\t\t\t\t\ttInterfaceMap *pMap;\n\n\t\t\t\t\t\t\t// Get the interface that this type implements\n\t\t\t\t\t\t\tpInterface = MetaData_GetTypeDefFromDefRefOrSpec(pMetaData, pInterfaceImpl->interface_, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\t\t\t\tMetaData_Fill_TypeDef(pInterface, NULL, NULL);\n\t\t\t\t\t\t\tpMap = &pTypeDef->pInterfaceMaps[mapNum];\n\t\t\t\t\t\t\tpMap->pInterface = pInterface;\n\t\t\t\t\t\t\tpMap->pVTableLookup = (U32*)mallocForever(pInterface->numVirtualMethods * sizeof(U32));\n\t\t\t\t\t\t\tpMap->ppMethodVLookup = NULL;\n\t\t\t\t\t\t\t// Discover interface mapping for each interface method\n\t\t\t\t\t\t\tfor (i=0; i<pInterface->numVirtualMethods; i++) {\n\t\t\t\t\t\t\t\ttMD_MethodDef *pInterfaceMethod, *pOverriddenMethod;\n\n\t\t\t\t\t\t\t\tpInterfaceMethod = pInterface->pVTable[i];\n\t\t\t\t\t\t\t\tpOverriddenMethod = FindVirtualOverriddenMethod(pTypeDef, pInterfaceMethod);\n\t\t\t\t\t\t\t\tAssert(pOverriddenMethod != NULL);\n\t\t\t\t\t\t\t\tpMap->pVTableLookup[i] = pOverriddenMethod->vTableOfs;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tCrash(\"Problem with interface class\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If this is an enum type, then pretend its stack type is its underlying type\n\t\tif (pTypeDef->pParent == types[TYPE_SYSTEM_ENUM]) {\n\t\t\tpTypeDef->stackType = EVALSTACK_INT32;\n\t\t}\n\t}\n\n\t// If this is a nested type, then find the namespace of it\n\tif (pTypeDef->pNestedIn != NULL) {\n\t\ttMD_TypeDef *pRootTypeDef = pTypeDef->pNestedIn;\n\t\twhile (pRootTypeDef->pNestedIn != NULL) {\n\t\t\tpRootTypeDef = pRootTypeDef->pNestedIn;\n\t\t}\n\t\tpTypeDef->nameSpace = pRootTypeDef->nameSpace;\n\t}\n\n\tlog_f(2, \"Type:  %s.%s\\n\", pTypeDef->nameSpace, pTypeDef->name);\n}\n\n"
  },
  {
    "path": "dna/MetaData_Search.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"MetaData.h\"\n#include \"CLIFile.h\"\n#include \"Type.h\"\n#include \"Types.h\"\n\nU32 MetaData_CompareNameAndSig(STRING name, BLOB_ sigBlob, tMetaData *pSigMetaData, tMD_TypeDef **ppSigClassTypeArgs, tMD_TypeDef **ppSigMethodTypeArgs, tMD_MethodDef *pMethod, tMD_TypeDef **ppMethodClassTypeArgs, tMD_TypeDef **ppMethodMethodTypeArgs) {\n\tif (strcmp(name, pMethod->name) == 0) {\n\t\tSIG sig, thisSig;\n\t\tU32 e, thisE, paramCount, i;\n\n\t\tsig = MetaData_GetBlob(sigBlob, NULL);\n\t\tthisSig = MetaData_GetBlob(pMethod->signature, NULL);\n\n\t\te = MetaData_DecodeSigEntry(&sig);\n\t\tthisE = MetaData_DecodeSigEntry(&thisSig);\n\t\t// Check method call type (static, etc...)\n\t\tif (e != thisE) {\n\t\t\treturn 0;\n\t\t}\n\n\t\t// If method has generic arguments, check the generic type argument count\n\t\tif (e & SIG_METHODDEF_GENERIC) {\n\t\t\te = MetaData_DecodeSigEntry(&sig);\n\t\t\tthisE = MetaData_DecodeSigEntry(&thisSig);\n\t\t\t// Generic argument count\n\t\t\tif (e != thisE) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\te = MetaData_DecodeSigEntry(&sig);\n\t\tthisE = MetaData_DecodeSigEntry(&thisSig);\n\t\t// check parameter count\n\t\tif (e != thisE) {\n\t\t\treturn 0;\n\t\t}\n\t\tparamCount = e + 1; // +1 to include the return type\n\n\t\t// check all parameters\n\t\tfor (i=0; i<paramCount; i++) {\n\t\t\ttMD_TypeDef *pParamType, *pThisParamType;\n\n\t\t\tpParamType = Type_GetTypeFromSig(pSigMetaData, &sig, ppSigClassTypeArgs, ppSigMethodTypeArgs);\n\t\t\tpThisParamType = Type_GetTypeFromSig(pMethod->pMetaData, &thisSig, ppMethodClassTypeArgs, ppMethodMethodTypeArgs);\n\t\t\tif (pParamType != pThisParamType) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t// All parameters the same, so found the right method\n\t\treturn 1;\n\t}\n\treturn 0;\n}\n\nstatic tMD_MethodDef* FindMethodInType(tMD_TypeDef *pTypeDef, STRING name, tMetaData *pSigMetaData, BLOB_ sigBlob, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\tU32 i;\n\ttMD_TypeDef *pLookInType = pTypeDef;\n\n\tdo {\n\t\tfor (i=0; i<pLookInType->numMethods; i++) {\n\t\t\tif (MetaData_CompareNameAndSig(name, sigBlob, pSigMetaData, ppClassTypeArgs, ppMethodTypeArgs, pLookInType->ppMethods[i], pLookInType->ppClassTypeArgs, NULL)) {\n\t\t\t\treturn pLookInType->ppMethods[i];\n\t\t\t}\n\t\t}\n\t\tpLookInType = pLookInType->pParent;\n\t} while (pLookInType != NULL);\n\n\t{\n\t\t// Error reporting!!\n\t\tU32 entry, numParams, i;\n\t\tSIG sig;\n\t\tchar *pMsg;\n\t\ttMD_TypeDef *pParamTypeDef;\n\n\t\tpMsg = (char*)malloc(2048);\n\t\t*pMsg = 0;\n\t\tsig = MetaData_GetBlob(sigBlob, &i);\n\t\tentry = MetaData_DecodeSigEntry(&sig);\n\t\tif ((entry & SIG_METHODDEF_HASTHIS) == 0) {\n\t\t\tsprintf(strchr(pMsg, 0), \"static \");\n\t\t}\n\t\tif (entry & SIG_METHODDEF_GENERIC) {\n\t\t\t// read number of generic type args - don't care what it is\n\t\t\tMetaData_DecodeSigEntry(&sig);\n\t\t}\n\t\tnumParams = MetaData_DecodeSigEntry(&sig);\n\t\tpParamTypeDef = Type_GetTypeFromSig(pSigMetaData, &sig, ppClassTypeArgs, ppMethodTypeArgs); // return type\n\t\tif (pParamTypeDef != NULL) {\n\t\t\tsprintf(strchr(pMsg, 0), \"%s \", pParamTypeDef->name);\n\t\t}\n\t\tsprintf(strchr(pMsg, 0), \"%s.%s.%s(\", pTypeDef->nameSpace, pTypeDef->name, name);\n\t\tfor (i=0; i<numParams; i++) {\n\t\t\tpParamTypeDef = Type_GetTypeFromSig(pSigMetaData, &sig, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\tif (i > 0) {\n\t\t\t\tsprintf(strchr(pMsg, 0), \",\");\n\t\t\t}\n\t\t\tif (pParamTypeDef != NULL) {\n\t\t\t\tsprintf(strchr(pMsg, 0), pParamTypeDef->name);\n\t\t\t} else {\n\t\t\t\tsprintf(strchr(pMsg, 0), \"???\");\n\t\t\t}\n\t\t}\n\t\tCrash(\"FindMethodInType(): Cannot find method %s)\", pMsg);\n\t}\n\tFAKE_RETURN;\n}\n\nstatic tMD_FieldDef* FindFieldInType(tMD_TypeDef *pTypeDef, STRING name) {\n\tU32 i;\n\n\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\n\tfor (i=0; i<pTypeDef->numFields; i++) {\n\t\tif (strcmp(pTypeDef->ppFields[i]->name, name) == 0) {\n\t\t\treturn pTypeDef->ppFields[i];\n\t\t}\n\t}\n\n\tCrash(\"FindFieldInType(): Cannot find field '%s' in type %s.%s\", name, pTypeDef->nameSpace, pTypeDef->name);\n\tFAKE_RETURN;\n}\n\ntMetaData* MetaData_GetResolutionScopeMetaData(tMetaData *pMetaData, IDX_TABLE resolutionScopeToken, tMD_TypeDef **ppInNestedType) {\n\tswitch (TABLE_ID(resolutionScopeToken)) {\n\t\tcase MD_TABLE_ASSEMBLYREF:\n\t\t\t{\n\t\t\t\ttMD_AssemblyRef *pAssemblyRef;\n\n\t\t\t\tpAssemblyRef = (tMD_AssemblyRef*)MetaData_GetTableRow(pMetaData, resolutionScopeToken);\n\t\t\t\t*ppInNestedType = NULL;\n\t\t\t\treturn CLIFile_GetMetaDataForAssembly(pAssemblyRef->name);\n\t\t\t}\n\t\tcase MD_TABLE_TYPEREF:\n\t\t\t{\n\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMetaData, resolutionScopeToken, NULL, NULL);\n\t\t\t\t*ppInNestedType = pTypeDef;\n\t\t\t\treturn pTypeDef->pMetaData;\n\t\t\t}\n\t\tdefault:\n\t\t\tCrash(\"MetaData_GetResolutionScopeMetaData(): Cannot resolve token: 0x%08x\", resolutionScopeToken);\n\t\t\tFAKE_RETURN;\n\t}\n}\n\ntMD_TypeDef* MetaData_GetTypeDefFromName(tMetaData *pMetaData, STRING nameSpace, STRING name, tMD_TypeDef *pInNestedClass) {\n\tU32 i;\n\n\tfor (i=1; i<=pMetaData->tables.numRows[MD_TABLE_TYPEDEF]; i++) {\n\t\ttMD_TypeDef *pTypeDef;\n\n\t\tpTypeDef = (tMD_TypeDef*)MetaData_GetTableRow(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_TYPEDEF, i));\n\t\tif (pInNestedClass == pTypeDef->pNestedIn &&\n\t\t\tstrcmp(name, pTypeDef->name) == 0 &&\n\t\t\t(pInNestedClass != NULL || strcmp(nameSpace, pTypeDef->nameSpace) == 0)) {\n\t\t\treturn pTypeDef;\n\t\t}\n\t}\n\n\tCrash(\"MetaData_GetTypeDefFromName(): Cannot find type %s.%s\", nameSpace, name);\n\tFAKE_RETURN;\n}\n\ntMD_TypeDef* MetaData_GetTypeDefFromFullName(STRING assemblyName, STRING nameSpace, STRING name) {\n\ttMetaData *pTypeMetaData;\n\n\tpTypeMetaData = CLIFile_GetMetaDataForAssembly(assemblyName);\n\n\t// Note that this cannot get a nested class, as this final parameter is always NULL\n\treturn MetaData_GetTypeDefFromName(pTypeMetaData, nameSpace, name, NULL);\n}\n\ntMD_TypeDef* MetaData_GetTypeDefFromDefRefOrSpec(tMetaData *pMetaData, IDX_TABLE token, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\tvoid *pTableEntry;\n\n\tpTableEntry = MetaData_GetTableRow(pMetaData, token);\n\tif (pTableEntry == NULL) {\n\t\treturn NULL;\n\t}\n\tif (((tMDC_ToTypeDef*)pTableEntry)->pTypeDef != NULL) {\n\t\treturn ((tMDC_ToTypeDef*)pTableEntry)->pTypeDef;\n\t}\n\n\tswitch (TABLE_ID(token)) {\n\t\tcase MD_TABLE_TYPEDEF:\n\t\t\t((tMDC_ToTypeDef*)pTableEntry)->pTypeDef = (tMD_TypeDef*)pTableEntry;\n\t\t\treturn (tMD_TypeDef*)pTableEntry;\n\t\tcase MD_TABLE_TYPEREF:\n\t\t\t{\n\t\t\t\ttMetaData *pTypeDefMetaData;\n\t\t\t\ttMD_TypeRef *pTypeRef;\n\t\t\t\ttMD_TypeDef *pTypeDef;\n\t\t\t\ttMD_TypeDef *pInNestedClass;\n\n\t\t\t\tpTypeRef = (tMD_TypeRef*)pTableEntry;\n\t\t\t\tpTypeDefMetaData = MetaData_GetResolutionScopeMetaData(pMetaData, pTypeRef->resolutionScope, &pInNestedClass);\n\t\t\t\tpTypeDef = MetaData_GetTypeDefFromName(pTypeDefMetaData, pTypeRef->nameSpace, pTypeRef->name, pInNestedClass);\n\t\t\t\tpTypeRef->pTypeDef = pTypeDef;\n\t\t\t\treturn pTypeDef;\n\t\t\t}\n\t\tcase MD_TABLE_TYPESPEC:\n\t\t\t{\n\t\t\t\ttMD_TypeSpec *pTypeSpec;\n\t\t\t\ttMD_TypeDef *pTypeDef;\n\t\t\t\tSIG sig;\n\n\t\t\t\tpTypeSpec = (tMD_TypeSpec*)pTableEntry;\n\t\t\t\tsig = MetaData_GetBlob(pTypeSpec->signature, NULL);\n\t\t\t\tpTypeDef = Type_GetTypeFromSig(pTypeSpec->pMetaData, &sig, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\t// Note: Cannot cache the TypeDef for this TypeSpec because it\n\t\t\t\t// can change depending on class arguemnts given.\n\n\t\t\t\treturn pTypeDef;\n\t\t\t}\n\t\t\treturn NULL;\n\t\tdefault:\n\t\t\tCrash(\"MetaData_GetTypeDefFromDefRefOrSpec(): Cannot handle token: 0x%08x\", token);\n\t\t\tFAKE_RETURN;\n\t}\n}\n\ntMD_TypeDef* MetaData_GetTypeDefFromMethodDef(tMD_MethodDef *pMethodDef) {\n\ttMetaData *pMetaData;\n\tU32 i;\n\n\tpMetaData = pMethodDef->pMetaData;\n\tfor (i=pMetaData->tables.numRows[MD_TABLE_TYPEDEF]; i>0; i--) {\n\t\ttMD_TypeDef *pTypeDef;\n\n\t\tpTypeDef = (tMD_TypeDef*)MetaData_GetTableRow(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_TYPEDEF, i));\n\t\tif (pTypeDef->methodList <= pMethodDef->tableIndex) {\n\t\t\treturn pTypeDef;\n\t\t}\n\t}\n\n\tCrash(\"MetaData_GetTypeDefFromMethodDef(): Cannot find type for method: %s\", pMethodDef->name);\n\tFAKE_RETURN;\n}\n\ntMD_TypeDef* MetaData_GetTypeDefFromFieldDef(tMD_FieldDef *pFieldDef) {\n\ttMetaData *pMetaData;\n\tU32 i;\n\n\tpMetaData = pFieldDef->pMetaData;\n\tfor (i=pMetaData->tables.numRows[MD_TABLE_TYPEDEF]; i>0; i--) {\n\t\ttMD_TypeDef *pTypeDef;\n\n\t\tpTypeDef = (tMD_TypeDef*)MetaData_GetTableRow(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_TYPEDEF, i));\n\t\tif (pTypeDef->fieldList <= pFieldDef->tableIndex) {\n\t\t\treturn pTypeDef;\n\t\t}\n\t}\n\n\tCrash(\"MetaData_GetTypeDefFromFieldDef(): Cannot find type for field: %s\", pFieldDef->name);\n\tFAKE_RETURN;\n}\n\ntMD_MethodDef* MetaData_GetMethodDefFromDefRefOrSpec(tMetaData *pMetaData, IDX_TABLE token, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\tvoid *pTableEntry;\n\n\tpTableEntry = MetaData_GetTableRow(pMetaData, token);\n\tif (((tMDC_ToMethodDef*)pTableEntry)->pMethodDef != NULL) {\n\t\treturn ((tMDC_ToMethodDef*)pTableEntry)->pMethodDef;\n\t}\n\n\tswitch (TABLE_ID(token)) {\n\t\tcase MD_TABLE_METHODDEF:\n\t\t\t((tMDC_ToMethodDef*)pTableEntry)->pMethodDef = (tMD_MethodDef*)pTableEntry;\n\t\t\treturn (tMD_MethodDef*)pTableEntry;\n\t\tcase MD_TABLE_MEMBERREF:\n\t\t\t{\n\t\t\t\ttMD_MemberRef *pMemberRef;\n\n\t\t\t\tpMemberRef = (tMD_MemberRef*)pTableEntry;\n\t\t\t\tswitch (TABLE_ID(pMemberRef->class_))\n\t\t\t\t{\n\t\t\t\tcase MD_TABLE_TYPEREF:\n\t\t\t\tcase MD_TABLE_TYPESPEC:\n\t\t\t\t\t{\n\t\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\t\t\t\t\t\ttMD_MethodDef *pMethodDef;\n\n\t\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMetaData, pMemberRef->class_, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t\t\tpMethodDef = FindMethodInType(pTypeDef, pMemberRef->name, pMetaData, pMemberRef->signature, pTypeDef->ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\t\t\t//pMethodDef->pMethodDef = pMethodDef;\n\t\t\t\t\t\treturn pMethodDef;\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tCrash(\"MetaData_GetMethodDefFromMethodDefOrRef(): Cannot handle pMemberRef->class_=0x%08x\", pMemberRef->class_);\n\t\t\t\t}\n\t\t\t}\n\t\tcase MD_TABLE_METHODSPEC:\n\t\t\t{\n\t\t\t\ttMD_MethodSpec *pMethodSpec;\n\t\t\t\ttMD_MethodDef *pMethodDef;\n\n\t\t\t\tpMethodSpec = (tMD_MethodSpec*)pTableEntry;\n\t\t\t\tpMethodDef = Generics_GetMethodDefFromSpec(pMethodSpec, ppClassTypeArgs, ppMethodTypeArgs);\n\n\t\t\t\t// Note: Cannot cache the MethodDef from the MethodSpec, as class generic arguments\n\t\t\t\t// may be different.\n\t\t\t\t\n\t\t\t\treturn pMethodDef;\n\t\t\t}\n\t}\n\n\tCrash(\"MetaData_GetMethodDefFromMethodDefOrRef(): Cannot handle token: 0x%08x\", token);\n\tFAKE_RETURN;\n}\n\ntMD_FieldDef* MetaData_GetFieldDefFromDefOrRef(tMetaData *pMetaData, IDX_TABLE token, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\tvoid *pTableEntry;\n\n\tpTableEntry = MetaData_GetTableRow(pMetaData, token);\n\tif (((tMDC_ToFieldDef*)pTableEntry)->pFieldDef != NULL) {\n\t\treturn ((tMDC_ToFieldDef*)pTableEntry)->pFieldDef;\n\t}\n\n\tswitch (TABLE_ID(token)) {\n\t\tcase MD_TABLE_FIELDDEF:\n\t\t\t((tMDC_ToFieldDef*)pTableEntry)->pFieldDef = (tMD_FieldDef*)pTableEntry;\n\t\t\treturn (tMD_FieldDef*)pTableEntry;\n\t\tcase MD_TABLE_MEMBERREF:\n\t\t\t{\n\t\t\t\ttMD_MemberRef *pMemberRef;\n\n\t\t\t\tpMemberRef = (tMD_MemberRef*)pTableEntry;\n\t\t\t\tswitch (TABLE_ID(pMemberRef->class_))\n\t\t\t\t{\n\t\t\t\tcase MD_TABLE_TYPEREF:\n\t\t\t\tcase MD_TABLE_TYPESPEC:\n\t\t\t\t\t{\n\t\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\t\t\t\t\t\ttMD_FieldDef *pFieldDef;\n\n\t\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMetaData, pMemberRef->class_, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\t\t\tpFieldDef = FindFieldInType(pTypeDef, pMemberRef->name);\n\t\t\t\t\t\tif (TABLE_ID(pMemberRef->class_) == MD_TABLE_TYPEREF) {\n\t\t\t\t\t\t\t// Can't do this for TypeSpec because the resulting TypeDef will change\n\t\t\t\t\t\t\t// depending on what the class type arguments are.\n\t\t\t\t\t\t\t((tMDC_ToFieldDef*)pTableEntry)->pFieldDef = pFieldDef;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn pFieldDef;\n\t\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\tCrash(\"MetaData_GetMethodDefFromMethodDefOrRef(): Cannot handle pMemberRef->class_=0x%08x\", pMemberRef->class_);\n\t\t\t\t}\n\t\t\t}\n\t}\n\n\tCrash(\"MetaData_GetFieldDefFromDefOrRef(): Cannot handle token: 0x%08x\", token);\n\tFAKE_RETURN;\n}\n\n// Return pointer to the relevant Def structure.\n// pObjectType returns:\n// 0 - tMD_TypeDef\n// 1 - tMD_MethodDef\n// 2 - tMD_FieldDef\n// (These link up with the JIT_LOADTOKEN_* opcodes)\nPTR MetaData_GetTypeMethodField(tMetaData *pMetaData, IDX_TABLE token, U32 *pObjectType, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\tswitch (TABLE_ID(token)) {\n\t\tcase MD_TABLE_TYPEDEF:\n\t\tcase MD_TABLE_TYPEREF:\n\t\tcase MD_TABLE_TYPESPEC:\n\t\t\t{\n\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pMetaData, token, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t*pObjectType = 0;\n\t\t\t\treturn (PTR)pTypeDef;\n\t\t\t}\n\t\tcase MD_TABLE_METHODDEF:\nmethod:\n\t\t\t{\n\t\t\t\ttMD_MethodDef *pMethodDef;\n\n\t\t\t\tpMethodDef = MetaData_GetMethodDefFromDefRefOrSpec(pMetaData, token, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\tif (pMethodDef->isFilled == 0) {\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromMethodDef(pMethodDef);\n\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t}\n\t\t\t\t*pObjectType = 1;\n\t\t\t\treturn (PTR)pMethodDef;\n\t\t\t}\n\t\tcase MD_TABLE_FIELDDEF:\nfield:\n\t\t\t{\n\t\t\t\ttMD_FieldDef *pFieldDef;\n\n\t\t\t\tpFieldDef = MetaData_GetFieldDefFromDefOrRef(pMetaData, token, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\tif (pFieldDef->pParentType == NULL) {\n\t\t\t\t\ttMD_TypeDef *pTypeDef;\n\n\t\t\t\t\tpTypeDef = MetaData_GetTypeDefFromFieldDef(pFieldDef);\n\t\t\t\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t\t\t\t}\n\t\t\t\t*pObjectType = 2;\n\t\t\t\treturn (PTR)pFieldDef;\n\t\t\t}\n\t\tcase MD_TABLE_MEMBERREF:\n\t\t\t{\n\t\t\t\ttMD_MemberRef *pMemberRef;\n\t\t\t\tSIG sig;\n\n\t\t\t\tpMemberRef = (tMD_MemberRef*)MetaData_GetTableRow(pMetaData, token);\n\t\t\t\tsig = MetaData_GetBlob(pMemberRef->signature, NULL);\n\t\t\t\tif (*(U8*)sig == 0x06) {\n\t\t\t\t\t// Field\n\t\t\t\t\tgoto field;\n\t\t\t\t} else {\n\t\t\t\t\t// Method\n\t\t\t\t\tgoto method;\n\t\t\t\t}\n\t\t\t}\n\t}\n\n\tCrash(\"MetaData_GetTypeMethodField(): Cannot handle token: 0x%08x\", token);\n\tFAKE_RETURN;\n}\n\ntMD_ImplMap* MetaData_GetImplMap(tMetaData *pMetaData, IDX_TABLE memberForwardedToken) {\n\tU32 i;\n\n\tfor (i=pMetaData->tables.numRows[MD_TABLE_IMPLMAP]; i >= 1; i--) {\n\t\ttMD_ImplMap *pImplMap = (tMD_ImplMap*)MetaData_GetTableRow(pMetaData, MAKE_TABLE_INDEX(MD_TABLE_IMPLMAP, i));\n\t\tif (pImplMap->memberForwarded == memberForwardedToken) {\n\t\t\treturn pImplMap;\n\t\t}\n\t}\n\n\tCrash(\"MetaData_GetImplMap() Cannot find mapping for token: 0x%08x\", memberForwardedToken);\n\tFAKE_RETURN;\n}\n\nSTRING MetaData_GetModuleRefName(tMetaData *pMetaData, IDX_TABLE memberRefToken) {\n\ttMD_ModuleRef *pModRef = (tMD_ModuleRef*)MetaData_GetTableRow(pMetaData, memberRefToken);\n\treturn pModRef->name;\n}\n"
  },
  {
    "path": "dna/MethodState.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"Thread.h\"\n#include \"MethodState.h\"\n#include \"JIT.h\"\n\n#ifdef GEN_COMBINED_OPCODES\n\n// Pointer to the least called method\nstatic tMD_MethodDef *pLeastCalledMethod = NULL;\n// Amount of memory currently used by combined JITted methods\nstatic U32 combinedJITSize = 0;\n\nstatic void AddCall(tMD_MethodDef *pMethod) {\n\tpMethod->genCallCount++;\n\t// See if this method needs moving in the 'call quantity' linked-list,\n\t// or if this method needs adding to the list for the first time\n\tif (pMethod->genCallCount == 1) {\n\t\t// Add for the first time\n\t\tpMethod->pNextHighestCalls = pLeastCalledMethod;\n\t\tpMethod->pPrevHighestCalls = NULL;\n\t\tif (pLeastCalledMethod != NULL) {\n\t\t\tpLeastCalledMethod->pPrevHighestCalls = pMethod;\n\t\t}\n\t\tpLeastCalledMethod = pMethod;\n\t} else {\n\t\t// See if this method needs moving up the linked-list\n\t\ttMD_MethodDef *pCheckMethod = pMethod;\n\t\tU64 numCalls = pMethod->genCallCount;\n\t\twhile (pCheckMethod->pNextHighestCalls != NULL && numCalls > pCheckMethod->pNextHighestCalls->genCallCount) {\n\t\t\tpCheckMethod = pCheckMethod->pNextHighestCalls;\n\t\t}\n\t\tif (numCalls > pCheckMethod->genCallCount) {\n\t\t\t// Swap the two methods in the linked-list\n\t\t\ttMD_MethodDef *pT1, *pT2;\n\t\t\tU32 adjacent = pCheckMethod->pPrevHighestCalls == pMethod;\n\n\t\t\tif (pCheckMethod->pNextHighestCalls != NULL) {\n\t\t\t\tpCheckMethod->pNextHighestCalls->pPrevHighestCalls = pMethod;\n\t\t\t}\n\t\t\tpT1 = pMethod->pNextHighestCalls;\n\t\t\tpMethod->pNextHighestCalls = pCheckMethod->pNextHighestCalls;\n\n\t\t\tif (pMethod->pPrevHighestCalls != NULL) {\n\t\t\t\tpMethod->pPrevHighestCalls->pNextHighestCalls = pCheckMethod;\n\t\t\t} else {\n\t\t\t\tpLeastCalledMethod = pCheckMethod;\n\t\t\t}\n\t\t\tpT2 = pCheckMethod->pPrevHighestCalls;\n\t\t\tpCheckMethod->pPrevHighestCalls = pMethod->pPrevHighestCalls;\n\n\t\t\tif (!adjacent) {\n\t\t\t\tpT2->pNextHighestCalls = pMethod;\n\t\t\t\tpMethod->pPrevHighestCalls = pT2;\n\t\t\t\tpT1->pPrevHighestCalls = pCheckMethod;\n\t\t\t\tpCheckMethod->pNextHighestCalls = pT1;\n\t\t\t} else {\n\t\t\t\tpMethod->pPrevHighestCalls = pCheckMethod;\n\t\t\t\tpCheckMethod->pNextHighestCalls = pMethod;\n\t\t\t}\n\t\t}\n\t}\t\n}\n\nstatic void DeleteCombinedJIT(tMD_MethodDef *pMethod) {\n\ttCombinedOpcodesMem *pCOM;\n\ttJITted *pJIT = pMethod->pJITtedCombined;\n\tfree(pJIT->pExceptionHeaders);\n\tfree(pJIT->pOps);\n\tpCOM = pJIT->pCombinedOpcodesMem;\n\twhile (pCOM != NULL) {\n\t\ttCombinedOpcodesMem *pT = pCOM;\n\t\tfree(pCOM->pMem);\n\t\tpCOM = pCOM->pNext;\n\t\tfree(pT);\n\t}\n}\n\nstatic void RemoveCombinedJIT(tMD_MethodDef *pMethod) {\n\tif (pMethod->callStackCount == 0) {\n\t\tDeleteCombinedJIT(pMethod);\n\t} else {\n\t\t// Mark this JIT for removal. Don't quite know how to do this!\n\t\tlog_f(0, \"!!! CANNOT REMOVE COMBINED JIT !!!\\n\");\n\t}\n\tcombinedJITSize -= pMethod->pJITtedCombined->opsMemSize;\n\tpMethod->pJITtedCombined = NULL;\n\tlog_f(1, \"Removing Combined JIT: %s\\n\", Sys_GetMethodDesc(pMethod));\n}\n\nstatic void AddCombinedJIT(tMD_MethodDef *pMethod) {\n\tJIT_Prepare(pMethod, 1);\n\tcombinedJITSize += pMethod->pJITtedCombined->opsMemSize;\n\tlog_f(1, \"Creating Combined JIT: %s\\n\", Sys_GetMethodDesc(pMethod));\n}\n\n#endif\n\ntMethodState* MethodState_Direct(tThread *pThread, tMD_MethodDef *pMethod, tMethodState *pCaller, U32 isInternalNewObjCall) {\n\ttMethodState *pThis;\n\n\tif (!pMethod->isFilled) {\n\t\ttMD_TypeDef *pTypeDef;\n\n\t\tpTypeDef = MetaData_GetTypeDefFromMethodDef(pMethod);\n\t\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\t}\n\n\tpThis = (tMethodState*)Thread_StackAlloc(pThread, sizeof(tMethodState));\n\tpThis->finalizerThis = NULL;\n\tpThis->pCaller = pCaller;\n\tpThis->pMetaData = pMethod->pMetaData;\n\tpThis->pMethod = pMethod;\n\tif (pMethod->pJITted == NULL) {\n\t\t// If method has not already been JITted\n\t\tJIT_Prepare(pMethod, 0);\n\t}\n\tpThis->pJIT = pMethod->pJITted;\n\tpThis->ipOffset = 0;\n\tpThis->pEvalStack = (PTR)Thread_StackAlloc(pThread, pThis->pMethod->pJITted->maxStack);\n\tpThis->stackOfs = 0;\n\tpThis->isInternalNewObjCall = isInternalNewObjCall;\n\tpThis->pNextDelegate = NULL;\n\tpThis->pDelegateParams = NULL;\n\n\tpThis->pParamsLocals = (PTR)Thread_StackAlloc(pThread, pMethod->parameterStackSize + pMethod->pJITted->localsStackSize);\n\tmemset(pThis->pParamsLocals, 0, pMethod->parameterStackSize + pMethod->pJITted->localsStackSize);\n\n#ifdef GEN_COMBINED_OPCODES\n\tAddCall(pMethod);\n\n\t/*if (combinedJITSize < GEN_COMBINED_OPCODES_MAX_MEMORY) {\n\t\tif (pMethod->genCallCount > GEN_COMBINED_OPCODES_CALL_TRIGGER) {\n\t\t\tif (pMethod->pJITtedCombined == NULL) {\n\t\t\t\tJIT_Prepare(pMethod, 1);\n\t\t\t\tcombinedJITSize += pMethod->pJITtedCombined->opsMemSize;\n\t\t\t}\n\t\t}\n\t}*/\n\tif (pMethod->pJITtedCombined == NULL && pMethod->genCallCount >= GEN_COMBINED_OPCODES_CALL_TRIGGER &&\n\t\t(pMethod->pNextHighestCalls == NULL || pMethod->pPrevHighestCalls == NULL ||\n\t\tpMethod->pPrevHighestCalls->pJITtedCombined != NULL ||\n\t\t(combinedJITSize < GEN_COMBINED_OPCODES_MAX_MEMORY && pMethod->pNextHighestCalls->pJITtedCombined != NULL))) {\n\t\t// Do a combined JIT, if there's enough room after removing combined JIT from previous\n\t\tif (combinedJITSize > GEN_COMBINED_OPCODES_MAX_MEMORY) {\n\t\t\t// Remove the least-called function's combined JIT\n\t\t\ttMD_MethodDef *pToRemove = pMethod;\n\t\t\twhile (pToRemove->pPrevHighestCalls != NULL && pToRemove->pPrevHighestCalls->pJITtedCombined != NULL) {\n\t\t\t\tpToRemove = pToRemove->pPrevHighestCalls;\n\t\t\t}\n\t\t\tif (pToRemove != pMethod) {\n\t\t\t\tRemoveCombinedJIT(pToRemove);\n\t\t\t}\n\t\t}\n\t\tif (combinedJITSize < GEN_COMBINED_OPCODES_MAX_MEMORY) {\n\t\t\t// If there's enough room, then create new combined JIT\n\t\t\tAddCombinedJIT(pMethod);\n\t\t}\n\t}\n\n\t// See if there is a combined opcode JIT ready to use\n\tif (pMethod->pJITtedCombined != NULL) {\n\t\tpThis->pJIT = pMethod->pJITtedCombined;\n\t\tpMethod->callStackCount++;\n\t}\n#endif\n\n#ifdef DIAG_METHOD_CALLS\n\t// Keep track of the number of times this method is called\n\tpMethod->callCount++;\n\tpThis->startTime = microTime();\n#endif\n\n\treturn pThis;\n}\n\ntMethodState* MethodState(tThread *pThread, tMetaData *pMetaData, IDX_TABLE methodToken, tMethodState *pCaller) {\n\ttMD_MethodDef *pMethod;\n\n\tpMethod = MetaData_GetMethodDefFromDefRefOrSpec(pMetaData, methodToken, NULL, NULL);\n\treturn MethodState_Direct(pThread, pMethod, pCaller, 0);\n}\n\nvoid MethodState_Delete(tThread *pThread, tMethodState **ppMethodState) {\n\ttMethodState *pThis = *ppMethodState;\n\n\n#ifdef GEN_COMBINED_OPCODES\n\tif (pThis->pJIT != pThis->pMethod->pJITted) {\n\t\t// Only decrease call-stack count if it's been using the combined JIT\n\t\tpThis->pMethod->callStackCount--;\n\t}\n\tif (pThis->pCaller != NULL) {\n\t\t// Add a call to the method being returned to.\n\t\t// This is neccesary to give a more correct 'usage heuristic' to long-running\n\t\t// methods that call lots of other methods.\n\t\tAddCall(pThis->pCaller->pMethod);\n\t}\n#endif\n\n#ifdef DIAG_METHOD_CALLS\n\tpThis->pMethod->totalTime += microTime() - pThis->startTime;\n#endif\n\n\t// If this MethodState is a Finalizer, then let the heap know this Finalizer has been run\n\tif (pThis->finalizerThis != NULL) {\n\t\tHeap_UnmarkFinalizer(pThis->finalizerThis);\n\t}\n\n\tif (pThis->pDelegateParams != NULL) {\n\t\tfree(pThis->pDelegateParams);\n\t}\n\n\t// Note that the way the stack free funtion works means that only the 1st allocated chunk\n\t// needs to be free'd, as this function just sets the current allocation offset to the address given.\n\tThread_StackFree(pThread, pThis);\n\n\t*ppMethodState = NULL;\n}"
  },
  {
    "path": "dna/MethodState.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__METHODSTATE_H)\n#define __METHODSTATE_H\n\ntypedef struct tMethodState_ tMethodState;\n\n#include \"MetaData.h\"\n\nstruct tMethodState_ {\n\t// This method's meta-data\n\ttMetaData *pMetaData;\n\t// The method to execute\n\ttMD_MethodDef *pMethod;\n\t// The JITted code that this method-state is using.\n\t// When using the combined opcode JITter, this can vary between unoptimized and optimized.\n\ttJITted *pJIT;\n\t// The current offset into the method's JITted code (instruction offset, not byte offset)\n\tU32 ipOffset;\n\t// This method's evaluation stack\n\tPTR pEvalStack;\n\t// The evaluation stack current offset\n\tU32 stackOfs;\n\t// This method's parameters & local variable storage. Params are first, followed by locals\n\tPTR pParamsLocals;\n\t// Is this methodstate from a NEWOBJ op-code?\n\tU32 isInternalNewObjCall;\n\t// If this is a Finalizer, then the 'this' object goes here,\n\t// so it can be marked in the 'return' statement that it no longer has a Finalizer to run\n\tHEAP_PTR finalizerThis;\n\t// When in a delegate invoke, store the next delegate to invoke here.\n\t// This is to allow multi-cast delegates to call all their methods.\n\tvoid *pNextDelegate;\n\t// And store the parameters to go to this delegate call\n\tvoid *pDelegateParams;\n\t// When a leave instruction has to run a 'finally' bit of code, store the leave jump address here\n\tU32 *pOpEndFinally;\n\n#ifdef DIAG_METHOD_CALLS\n\t// For tracking execution time.\n\tU64 startTime;\n#endif\n\n\t// Link to caller methodstate\n\ttMethodState *pCaller;\n};\n\n//void MethodState_Init();\ntMethodState* MethodState_Direct(tThread *pThread, tMD_MethodDef *pMethod, tMethodState *pCaller, U32 isInternalNewObjCall);\ntMethodState* MethodState(tThread *pThread, tMetaData *pMetaData, IDX_TABLE methodToken, tMethodState *pCaller);\nvoid MethodState_Delete(tThread *pThread, tMethodState **ppMethodState);\n\n#endif"
  },
  {
    "path": "dna/PInvoke.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"PInvoke.h\"\n#include \"MetaData.h\"\n#include \"MetaDataTables.h\"\n#include \"JIT.h\"\n#include \"Type.h\"\n#include \"System.String.h\"\n#include \"EvalStack.h\"\n\ntypedef struct tLoadedLib_ tLoadedLib;\nstruct tLoadedLib_ {\n\t// The name of the library - this is the name as specified in the .NET assembly\n\tSTRING name;\n\t// The library\n\tvoid *pLib;\n\n\ttLoadedLib *pNext;\n};\n\nstatic tLoadedLib *pLoadedLibs = NULL;\n\nstatic tLoadedLib* GetLib(STRING name) {\n\t// See if it's already loaded\n\ttLoadedLib *pLib = pLoadedLibs;\n\tchar libName[256];\n\tvoid *pNativeLib;\n\n\twhile (pLib != NULL) {\n\t\tif (strcmp(name, pLib->name) == 0) {\n\t\t\treturn pLib;\n\t\t}\n\t}\n\tsprintf(libName, \"%s%s\", LIB_PREFIX, name);\n\tif (strlen(libName) >= 4) {\n\t\tif (strcmp(\".dll\", libName + strlen(libName) - 4) == 0) {\n\t\t\t// Cut off the \".dll\" suffix if it's there\n\t\t\tlibName[strlen(libName) - 4] = 0;\n\t\t}\n\t}\n\t// Not loaded, so load it\n\tsprintf(strchr(libName, 0), \".%s\", LIB_SUFFIX);\n#if WIN32\n\tpNativeLib = LoadLibraryA(libName);\n#else\n\tpNativeLib = dlopen(libName, DL_LAZY);\n#endif\n\tif (pNativeLib == NULL) {\n\t\t// Failed to load library\n\t\tprintf(\"Failed to load library: %s\\n\", libName);\n#ifndef WIN32\n\t\t{\n\t\t\tchar *pError;\n\t\t\tpError = dlerror();\n\t\t\tif (pError) {\n\t\t\t\tprintf(\"dlopen() Error: '%s'\",pError);\n\t\t\t}\n\t\t}\n#endif\n\t\treturn NULL;\n\t}\n\tpLib = TMALLOCFOREVER(tLoadedLib);\n\tpLib->pNext = pLoadedLibs;\n\tpLoadedLibs = pLib;\n\tpLib->name = name;\n\tpLib->pLib = pNativeLib;\n\treturn pLib;\n}\n\nfnPInvoke PInvoke_GetFunction(tMetaData *pMetaData, tMD_ImplMap *pImplMap) {\n\ttLoadedLib *pLib;\n\tSTRING libName;\n\tvoid *pProc;\n\n\tlibName = MetaData_GetModuleRefName(pMetaData, pImplMap->importScope);\n\tpLib = GetLib(libName);\n\tif (pLib == NULL) {\n\t\t// Library not found, so we can't find the function\n\t\treturn NULL;\n\t}\n\n#if WIN32\n\tpProc = GetProcAddress(pLib->pLib, pImplMap->importName);\n#else\n\tpProc = dlsym(pLib->pLib, pImplMap->importName);\n#endif\n\treturn pProc;\n}\n\nstatic void* ConvertStringToANSI(HEAP_PTR pHeapEntry) {\n\tU32 strLen, i;\n\tSTRING2 str = SystemString_GetString(pHeapEntry, &strLen);\n\tunsigned char *pAnsi = (unsigned char*)malloc(strLen+1);\n\tfor (i=0; i<strLen; i++) {\n\t\tpAnsi[i] = (unsigned char)str[i];\n\t}\n\tpAnsi[i] = 0;\n\treturn pAnsi;\n}\n\n// This function is needed to maintain string immutability, and to add a null-terminator\nstatic void* ConvertStringToUnicode(HEAP_PTR pHeapEntry) {\n\tU32 strLen;\n\tSTRING2 str = SystemString_GetString(pHeapEntry, &strLen);\n\tunsigned short *pUnicode = (unsigned short*)malloc((strLen+1) << 1);\n\tmemcpy(pUnicode, str, strLen << 1);\n\tpUnicode[strLen] = 0;\n\treturn pUnicode;\n}\n\n#include \"PInvoke_TypeDef.h\"\n\ntypedef U64    (STDCALL *_uCuuuuu)(U32 _0, U32 _1, U32 _2, U32 _3, U32 _4);\ntypedef U64    (STDCALL *_uCuuuuuu)(U32 _0, U32 _1, U32 _2, U32 _3, U32 _4, U32 _5);\ntypedef U64    (STDCALL *_uCuuuuuuu)(U32 _0, U32 _1, U32 _2, U32 _3, U32 _4, U32 _5, U32 _6);\ntypedef U64    (STDCALL *_uCuuuuuuuu)(U32 _0, U32 _1, U32 _2, U32 _3, U32 _4, U32 _5, U32 _6, U32 _7);\ntypedef U64    (STDCALL *_uCuuuuuuuuu)(U32 _0, U32 _1, U32 _2, U32 _3, U32 _4, U32 _5, U32 _6, U32 _7, U32 _8);\ntypedef U64    (STDCALL *_uCuuuuuuuuuu)(U32 _0, U32 _1, U32 _2, U32 _3, U32 _4, U32 _5, U32 _6, U32 _7, U32 _8, U32 _9);\n\n#define CALL0(returnType) (returnType)\n#define CALL1(returnType, t0) ((returnType) | ((t0)<<2))\n#define CALL2(returnType, t0, t1) ((returnType) | ((t0)<<2) | ((t1)<<4))\n#define CALL3(returnType, t0, t1, t2) ((returnType) | ((t0)<<2) | ((t1)<<4) | ((t2)<<6))\n#define CALL4(returnType, t0, t1, t2, t3) ((returnType) | ((t0)<<2) | ((t1)<<4) | ((t2)<<6) | ((t3)<<8))\n#define CALL5(returnType, t0, t1, t2, t3, t4) ((returnType) | ((t0)<<2) | ((t1)<<4) | ((t2)<<6) | ((t3)<<8) | ((t4)<<10))\n#define CALL6(returnType, t0, t1, t2, t3, t4, t5) ((returnType) | ((t0)<<2) | ((t1)<<4) | ((t2)<<6) | ((t3)<<8) | ((t4)<<10) | ((t5)<<12))\n#define CALL7(returnType, t0, t1, t2, t3, t4, t5, t6) ((returnType) | ((t0)<<2) | ((t1)<<4) | ((t2)<<6) | ((t3)<<8) | ((t4)<<10) | ((t5)<<12) | ((t6)<<14))\n#define CALL8(returnType, t0, t1, t2, t3, t4, t5, t6, t7) ((returnType) | ((t0)<<2) | ((t1)<<4) | ((t2)<<6) | ((t3)<<8) | ((t4)<<10) | ((t5)<<12) | ((t6)<<14) | ((t7)<<16))\n#define CALL9(returnType, t0, t1, t2, t3, t4, t5, t6, t7, t8) ((returnType) | ((t0)<<2) | ((t1)<<4) | ((t2)<<6) | ((t3)<<8) | ((t4)<<10) | ((t5)<<12) | ((t6)<<14) | ((t7)<<16) | ((t8)<<18))\n#define CALL10(returnType, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9) ((returnType) | ((t0)<<2) | ((t1)<<4) | ((t2)<<6) | ((t3)<<8) | ((t4)<<10) | ((t5)<<12) | ((t6)<<14) | ((t7)<<16) | ((t8)<<18) | ((t9)<<20))\n\n#define NOTHING 0\n#define SINGLE 1\n#define DOUBLE 2\n#define DEFAULT 3\n\n#define SET_ARG_TYPE(paramNum, type) funcParams |= (type << ((paramNum+1) << 1))\n\n#define MAX_ARGS 16\nU32 PInvoke_Call(tJITCallPInvoke *pCall, PTR pParams, PTR pReturnValue) {\n\tU32 _args[MAX_ARGS];\n\tdouble _argsd[MAX_ARGS];\n\tvoid* _pTempMem[MAX_ARGS];\n\tU32 numParams, param, paramTypeNum;\n\ttMD_MethodDef *pMethod = pCall->pMethod;\n\ttMD_TypeDef *pReturnType = pMethod->pReturnType;\n\ttMD_ImplMap *pImplMap = pCall->pImplMap;\n\tvoid *pFn = pCall->fn;\n\tU32 _argOfs = 0, _argdOfs = 0, paramOfs = 0;\n\tU32 _tempMemOfs = 0;\n\tU32 i;\n\tU32 funcParams = DEFAULT;\n\tU64 u64Ret;\n\tfloat fRet;\n\tdouble dRet;\n\n\tif (pReturnType != NULL) {\n\t\tif (pReturnType == types[TYPE_SYSTEM_SINGLE]) {\n\t\t\tfuncParams = SINGLE;\n\t\t} else if (pReturnType == types[TYPE_SYSTEM_DOUBLE]) {\n\t\t\tfuncParams = DOUBLE;\n\t\t}\n\t}\n\n\tnumParams = pMethod->numberOfParameters;\n\tfor (param = 0, paramTypeNum = 0; param<numParams; param++, paramTypeNum++) {\n\t\ttParameter *pParam = &(pMethod->pParams[param]);\n\t\ttMD_TypeDef *pParamType = pParam->pTypeDef;\n\t\tU32 paramType = DEFAULT;\n\n\t\tif (pParamType->stackType == EVALSTACK_INT32) {\n\t\t\t_args[_argOfs] = *(U32*)(pParams + paramOfs);\n\t\t\t_argOfs++;\n\t\t\tparamOfs += 4;\n\t\t} else if (pParamType == types[TYPE_SYSTEM_STRING]) {\n\t\t\t// Allocate a temp bit of memory for the string that's been converted.\n\t\t\tvoid *pString;\n\t\t\tif (IMPLMAP_ISCHARSET_ANSI(pImplMap) || IMPLMAP_ISCHARSET_AUTO(pImplMap) || IMPLMAP_ISCHARSET_NOTSPEC(pImplMap)) {\n\t\t\t\tpString = ConvertStringToANSI(*(HEAP_PTR*)(pParams + paramOfs));\n\t\t\t} else if (IMPLMAP_ISCHARSET_UNICODE(pImplMap)) {\n\t\t\t\tpString = ConvertStringToUnicode(*(HEAP_PTR*)(pParams + paramOfs));\n\t\t\t} else {\n\t\t\t\tCrash(\"PInvoke_Call() Cannot handle string marshalling of given type\");\n\t\t\t}\n\t\t\t_pTempMem[_tempMemOfs] = pString;\n\t\t\t_tempMemOfs++;\n\t\t\t_args[_argOfs] = (U32)pString;\n\t\t\t_argOfs++;\n\t\t\tparamOfs += 4;\n\t\t} else if (pParamType == types[TYPE_SYSTEM_INTPTR]) {\n\t\t\t// Only works for 32-bit\n\t\t\t_args[_argOfs] = *(U32*)(pParams + paramOfs);\n\t\t\t_argOfs++;\n\t\t\tparamOfs += 4;\n\t\t} else if (pParamType == types[TYPE_SYSTEM_SINGLE]) {\n\t\t\t_argsd[_argdOfs] = *(float*)(pParams + paramOfs);\n\t\t\t_argdOfs++;\n\t\t\tparamOfs += 4;\n\t\t\tparamType = SINGLE;\n\t\t} else if (pParamType == types[TYPE_SYSTEM_DOUBLE]) {\n\t\t\t_argsd[_argdOfs] = *(double*)(pParams + paramOfs);\n\t\t\t_argdOfs++;\n\t\t\tparamOfs += 8;\n\t\t\tparamType = DOUBLE;\n\t\t} else {\n\t\t\tCrash(\"PInvoke_Call() Cannot handle parameter of type: %s\", pParamType->name);\n\t\t}\n\t\tSET_ARG_TYPE(paramTypeNum, paramType);\n\t}\n\t\n\tswitch (funcParams) {\n\n#include \"PInvoke_CaseCode.h\"\n\n\tcase CALL5(DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\t\tu64Ret = ((_uCuuuuu)(pFn))(_args[0], _args[1], _args[2], _args[3], _args[4]);\n\t\tbreak;\n\n\tcase CALL6(DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\t\tu64Ret = ((_uCuuuuuu)(pFn))(_args[0], _args[1], _args[2], _args[3], _args[4], _args[5]);\n\t\tbreak;\n\n\tcase CALL7(DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\t\tu64Ret = ((_uCuuuuuuu)(pFn))(_args[0], _args[1], _args[2], _args[3], _args[4], _args[5], _args[6]);\n\t\tbreak;\n\n\tcase CALL8(DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\t\tu64Ret = ((_uCuuuuuuuu)(pFn))(_args[0], _args[1], _args[2], _args[3], _args[4], _args[5], _args[6], _args[7]);\n\t\tbreak;\n\n\tcase CALL9(DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\t\tu64Ret = ((_uCuuuuuuuuu)(pFn))(_args[0], _args[1], _args[2], _args[3], _args[4], _args[5], _args[6], _args[7], _args[8]);\n\t\tbreak;\n\n\tcase CALL10(DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\t\tu64Ret = ((_uCuuuuuuuuuu)(pFn))(_args[0], _args[1], _args[2], _args[3], _args[4], _args[5], _args[6], _args[7], _args[8], _args[9]);\n\t\tbreak;\n\n\tdefault:\n\t\tCrash(\"PInvoke_Call() Cannot handle the function parameters: 0x%08x\", funcParams);\n\t}\n\t\n\tfor (i=0; i<_tempMemOfs; i++) {\n\t\tfree(_pTempMem[i]);\n\t}\n\n\tif (pReturnType == NULL) {\n\t\treturn 0;\n\t}\n\tif (pReturnType->stackType == EVALSTACK_INT32) {\n\t\t*(U32*)pReturnValue = (U32)u64Ret;\n\t\treturn 4;\n\t}\n\tif (pReturnType == types[TYPE_SYSTEM_STRING]) {\n\t\tif (IMPLMAP_ISCHARSET_ANSI(pImplMap) || IMPLMAP_ISCHARSET_AUTO(pImplMap) || IMPLMAP_ISCHARSET_NOTSPEC(pImplMap)) {\n\t\t\t*(HEAP_PTR*)pReturnValue = SystemString_FromCharPtrASCII((U8*)(U32)u64Ret);\n\t\t} else if (IMPLMAP_ISCHARSET_UNICODE(pImplMap)) {\n\t\t\t*(HEAP_PTR*)pReturnValue = SystemString_FromCharPtrUTF16((U16*)(U32)u64Ret);\n\t\t} else {\n\t\t\tCrash(\"PInvoke_Call() Cannot handle return string in specified format\");\n\t\t}\n\t\treturn sizeof(void*);\n\t}\n\tif (pReturnType == types[TYPE_SYSTEM_INTPTR]) {\n\t\t*(void**)pReturnValue = (void*)(U32)u64Ret;\n\t\treturn sizeof(void*);\n\t}\n\tif (pReturnType == types[TYPE_SYSTEM_SINGLE]) {\n\t\t*(double*)pReturnValue = (double)fRet;\n\t\treturn 8;\n\t}\n\tif (pReturnType == types[TYPE_SYSTEM_DOUBLE]) {\n\t\t*(double*)pReturnValue = dRet;\n\t\treturn 8;\n\t}\n\n\tCrash(\"PInvoke_Call() Cannot handle return type: %s\", pReturnType->name);\n\tFAKE_RETURN;\n}\n"
  },
  {
    "path": "dna/PInvoke.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined (__PINVOKE_H)\n#define __PINVOKE_H\n\n#include \"MetaData.h\"\n#include \"JIT.h\"\n\ntypedef void* fnPInvoke;\n\nfnPInvoke PInvoke_GetFunction(tMetaData *pMetaData, tMD_ImplMap *pImplMap);\nU32 PInvoke_Call(tJITCallPInvoke *pCall, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/PInvoke_CaseCode.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\ncase CALL0(SINGLE):\n\tfRet = ((_fC)(pFn))();\n\tbreak;\ncase CALL0(DOUBLE):\n\tdRet = ((_dC)(pFn))();\n\tbreak;\ncase CALL0(DEFAULT):\n\tu64Ret = ((_uC)(pFn))();\n\tbreak;\ncase CALL1(SINGLE, SINGLE):\n\tfRet = ((_fCf)(pFn))((float)_argsd[0]);\n\tbreak;\ncase CALL1(SINGLE, DOUBLE):\n\tfRet = ((_fCd)(pFn))(_argsd[0]);\n\tbreak;\ncase CALL1(SINGLE, DEFAULT):\n\tfRet = ((_fCu)(pFn))(_args[0]);\n\tbreak;\ncase CALL1(DOUBLE, SINGLE):\n\tdRet = ((_dCf)(pFn))((float)_argsd[0]);\n\tbreak;\ncase CALL1(DOUBLE, DOUBLE):\n\tdRet = ((_dCd)(pFn))(_argsd[0]);\n\tbreak;\ncase CALL1(DOUBLE, DEFAULT):\n\tdRet = ((_dCu)(pFn))(_args[0]);\n\tbreak;\ncase CALL1(DEFAULT, SINGLE):\n\tu64Ret = ((_uCf)(pFn))((float)_argsd[0]);\n\tbreak;\ncase CALL1(DEFAULT, DOUBLE):\n\tu64Ret = ((_uCd)(pFn))(_argsd[0]);\n\tbreak;\ncase CALL1(DEFAULT, DEFAULT):\n\tu64Ret = ((_uCu)(pFn))(_args[0]);\n\tbreak;\ncase CALL2(SINGLE, SINGLE, SINGLE):\n\tfRet = ((_fCff)(pFn))((float)_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL2(SINGLE, SINGLE, DOUBLE):\n\tfRet = ((_fCfd)(pFn))((float)_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL2(SINGLE, SINGLE, DEFAULT):\n\tfRet = ((_fCfu)(pFn))((float)_argsd[0], _args[0]);\n\tbreak;\ncase CALL2(SINGLE, DOUBLE, SINGLE):\n\tfRet = ((_fCdf)(pFn))(_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL2(SINGLE, DOUBLE, DOUBLE):\n\tfRet = ((_fCdd)(pFn))(_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL2(SINGLE, DOUBLE, DEFAULT):\n\tfRet = ((_fCdu)(pFn))(_argsd[0], _args[0]);\n\tbreak;\ncase CALL2(SINGLE, DEFAULT, SINGLE):\n\tfRet = ((_fCuf)(pFn))(_args[0], (float)_argsd[0]);\n\tbreak;\ncase CALL2(SINGLE, DEFAULT, DOUBLE):\n\tfRet = ((_fCud)(pFn))(_args[0], _argsd[0]);\n\tbreak;\ncase CALL2(SINGLE, DEFAULT, DEFAULT):\n\tfRet = ((_fCuu)(pFn))(_args[0], _args[1]);\n\tbreak;\ncase CALL2(DOUBLE, SINGLE, SINGLE):\n\tdRet = ((_dCff)(pFn))((float)_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL2(DOUBLE, SINGLE, DOUBLE):\n\tdRet = ((_dCfd)(pFn))((float)_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL2(DOUBLE, SINGLE, DEFAULT):\n\tdRet = ((_dCfu)(pFn))((float)_argsd[0], _args[0]);\n\tbreak;\ncase CALL2(DOUBLE, DOUBLE, SINGLE):\n\tdRet = ((_dCdf)(pFn))(_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL2(DOUBLE, DOUBLE, DOUBLE):\n\tdRet = ((_dCdd)(pFn))(_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL2(DOUBLE, DOUBLE, DEFAULT):\n\tdRet = ((_dCdu)(pFn))(_argsd[0], _args[0]);\n\tbreak;\ncase CALL2(DOUBLE, DEFAULT, SINGLE):\n\tdRet = ((_dCuf)(pFn))(_args[0], (float)_argsd[0]);\n\tbreak;\ncase CALL2(DOUBLE, DEFAULT, DOUBLE):\n\tdRet = ((_dCud)(pFn))(_args[0], _argsd[0]);\n\tbreak;\ncase CALL2(DOUBLE, DEFAULT, DEFAULT):\n\tdRet = ((_dCuu)(pFn))(_args[0], _args[1]);\n\tbreak;\ncase CALL2(DEFAULT, SINGLE, SINGLE):\n\tu64Ret = ((_uCff)(pFn))((float)_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL2(DEFAULT, SINGLE, DOUBLE):\n\tu64Ret = ((_uCfd)(pFn))((float)_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL2(DEFAULT, SINGLE, DEFAULT):\n\tu64Ret = ((_uCfu)(pFn))((float)_argsd[0], _args[0]);\n\tbreak;\ncase CALL2(DEFAULT, DOUBLE, SINGLE):\n\tu64Ret = ((_uCdf)(pFn))(_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL2(DEFAULT, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCdd)(pFn))(_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL2(DEFAULT, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCdu)(pFn))(_argsd[0], _args[0]);\n\tbreak;\ncase CALL2(DEFAULT, DEFAULT, SINGLE):\n\tu64Ret = ((_uCuf)(pFn))(_args[0], (float)_argsd[0]);\n\tbreak;\ncase CALL2(DEFAULT, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCud)(pFn))(_args[0], _argsd[0]);\n\tbreak;\ncase CALL2(DEFAULT, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCuu)(pFn))(_args[0], _args[1]);\n\tbreak;\ncase CALL3(SINGLE, SINGLE, SINGLE, SINGLE):\n\tfRet = ((_fCfff)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(SINGLE, SINGLE, SINGLE, DOUBLE):\n\tfRet = ((_fCffd)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(SINGLE, SINGLE, SINGLE, DEFAULT):\n\tfRet = ((_fCffu)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0]);\n\tbreak;\ncase CALL3(SINGLE, SINGLE, DOUBLE, SINGLE):\n\tfRet = ((_fCfdf)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(SINGLE, SINGLE, DOUBLE, DOUBLE):\n\tfRet = ((_fCfdd)(pFn))((float)_argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(SINGLE, SINGLE, DOUBLE, DEFAULT):\n\tfRet = ((_fCfdu)(pFn))((float)_argsd[0], _argsd[1], _args[0]);\n\tbreak;\ncase CALL3(SINGLE, SINGLE, DEFAULT, SINGLE):\n\tfRet = ((_fCfuf)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(SINGLE, SINGLE, DEFAULT, DOUBLE):\n\tfRet = ((_fCfud)(pFn))((float)_argsd[0], _args[0], _argsd[1]);\n\tbreak;\ncase CALL3(SINGLE, SINGLE, DEFAULT, DEFAULT):\n\tfRet = ((_fCfuu)(pFn))((float)_argsd[0], _args[0], _args[1]);\n\tbreak;\ncase CALL3(SINGLE, DOUBLE, SINGLE, SINGLE):\n\tfRet = ((_fCdff)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(SINGLE, DOUBLE, SINGLE, DOUBLE):\n\tfRet = ((_fCdfd)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(SINGLE, DOUBLE, SINGLE, DEFAULT):\n\tfRet = ((_fCdfu)(pFn))(_argsd[0], (float)_argsd[1], _args[0]);\n\tbreak;\ncase CALL3(SINGLE, DOUBLE, DOUBLE, SINGLE):\n\tfRet = ((_fCddf)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(SINGLE, DOUBLE, DOUBLE, DOUBLE):\n\tfRet = ((_fCddd)(pFn))(_argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(SINGLE, DOUBLE, DOUBLE, DEFAULT):\n\tfRet = ((_fCddu)(pFn))(_argsd[0], _argsd[1], _args[0]);\n\tbreak;\ncase CALL3(SINGLE, DOUBLE, DEFAULT, SINGLE):\n\tfRet = ((_fCduf)(pFn))(_argsd[0], _args[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(SINGLE, DOUBLE, DEFAULT, DOUBLE):\n\tfRet = ((_fCdud)(pFn))(_argsd[0], _args[0], _argsd[1]);\n\tbreak;\ncase CALL3(SINGLE, DOUBLE, DEFAULT, DEFAULT):\n\tfRet = ((_fCduu)(pFn))(_argsd[0], _args[0], _args[1]);\n\tbreak;\ncase CALL3(SINGLE, DEFAULT, SINGLE, SINGLE):\n\tfRet = ((_fCuff)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(SINGLE, DEFAULT, SINGLE, DOUBLE):\n\tfRet = ((_fCufd)(pFn))(_args[0], (float)_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL3(SINGLE, DEFAULT, SINGLE, DEFAULT):\n\tfRet = ((_fCufu)(pFn))(_args[0], (float)_argsd[0], _args[1]);\n\tbreak;\ncase CALL3(SINGLE, DEFAULT, DOUBLE, SINGLE):\n\tfRet = ((_fCudf)(pFn))(_args[0], _argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(SINGLE, DEFAULT, DOUBLE, DOUBLE):\n\tfRet = ((_fCudd)(pFn))(_args[0], _argsd[0], _argsd[1]);\n\tbreak;\ncase CALL3(SINGLE, DEFAULT, DOUBLE, DEFAULT):\n\tfRet = ((_fCudu)(pFn))(_args[0], _argsd[0], _args[1]);\n\tbreak;\ncase CALL3(SINGLE, DEFAULT, DEFAULT, SINGLE):\n\tfRet = ((_fCuuf)(pFn))(_args[0], _args[1], (float)_argsd[0]);\n\tbreak;\ncase CALL3(SINGLE, DEFAULT, DEFAULT, DOUBLE):\n\tfRet = ((_fCuud)(pFn))(_args[0], _args[1], _argsd[0]);\n\tbreak;\ncase CALL3(SINGLE, DEFAULT, DEFAULT, DEFAULT):\n\tfRet = ((_fCuuu)(pFn))(_args[0], _args[1], _args[2]);\n\tbreak;\ncase CALL3(DOUBLE, SINGLE, SINGLE, SINGLE):\n\tdRet = ((_dCfff)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(DOUBLE, SINGLE, SINGLE, DOUBLE):\n\tdRet = ((_dCffd)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(DOUBLE, SINGLE, SINGLE, DEFAULT):\n\tdRet = ((_dCffu)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0]);\n\tbreak;\ncase CALL3(DOUBLE, SINGLE, DOUBLE, SINGLE):\n\tdRet = ((_dCfdf)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(DOUBLE, SINGLE, DOUBLE, DOUBLE):\n\tdRet = ((_dCfdd)(pFn))((float)_argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(DOUBLE, SINGLE, DOUBLE, DEFAULT):\n\tdRet = ((_dCfdu)(pFn))((float)_argsd[0], _argsd[1], _args[0]);\n\tbreak;\ncase CALL3(DOUBLE, SINGLE, DEFAULT, SINGLE):\n\tdRet = ((_dCfuf)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(DOUBLE, SINGLE, DEFAULT, DOUBLE):\n\tdRet = ((_dCfud)(pFn))((float)_argsd[0], _args[0], _argsd[1]);\n\tbreak;\ncase CALL3(DOUBLE, SINGLE, DEFAULT, DEFAULT):\n\tdRet = ((_dCfuu)(pFn))((float)_argsd[0], _args[0], _args[1]);\n\tbreak;\ncase CALL3(DOUBLE, DOUBLE, SINGLE, SINGLE):\n\tdRet = ((_dCdff)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(DOUBLE, DOUBLE, SINGLE, DOUBLE):\n\tdRet = ((_dCdfd)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(DOUBLE, DOUBLE, SINGLE, DEFAULT):\n\tdRet = ((_dCdfu)(pFn))(_argsd[0], (float)_argsd[1], _args[0]);\n\tbreak;\ncase CALL3(DOUBLE, DOUBLE, DOUBLE, SINGLE):\n\tdRet = ((_dCddf)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(DOUBLE, DOUBLE, DOUBLE, DOUBLE):\n\tdRet = ((_dCddd)(pFn))(_argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(DOUBLE, DOUBLE, DOUBLE, DEFAULT):\n\tdRet = ((_dCddu)(pFn))(_argsd[0], _argsd[1], _args[0]);\n\tbreak;\ncase CALL3(DOUBLE, DOUBLE, DEFAULT, SINGLE):\n\tdRet = ((_dCduf)(pFn))(_argsd[0], _args[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(DOUBLE, DOUBLE, DEFAULT, DOUBLE):\n\tdRet = ((_dCdud)(pFn))(_argsd[0], _args[0], _argsd[1]);\n\tbreak;\ncase CALL3(DOUBLE, DOUBLE, DEFAULT, DEFAULT):\n\tdRet = ((_dCduu)(pFn))(_argsd[0], _args[0], _args[1]);\n\tbreak;\ncase CALL3(DOUBLE, DEFAULT, SINGLE, SINGLE):\n\tdRet = ((_dCuff)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(DOUBLE, DEFAULT, SINGLE, DOUBLE):\n\tdRet = ((_dCufd)(pFn))(_args[0], (float)_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL3(DOUBLE, DEFAULT, SINGLE, DEFAULT):\n\tdRet = ((_dCufu)(pFn))(_args[0], (float)_argsd[0], _args[1]);\n\tbreak;\ncase CALL3(DOUBLE, DEFAULT, DOUBLE, SINGLE):\n\tdRet = ((_dCudf)(pFn))(_args[0], _argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(DOUBLE, DEFAULT, DOUBLE, DOUBLE):\n\tdRet = ((_dCudd)(pFn))(_args[0], _argsd[0], _argsd[1]);\n\tbreak;\ncase CALL3(DOUBLE, DEFAULT, DOUBLE, DEFAULT):\n\tdRet = ((_dCudu)(pFn))(_args[0], _argsd[0], _args[1]);\n\tbreak;\ncase CALL3(DOUBLE, DEFAULT, DEFAULT, SINGLE):\n\tdRet = ((_dCuuf)(pFn))(_args[0], _args[1], (float)_argsd[0]);\n\tbreak;\ncase CALL3(DOUBLE, DEFAULT, DEFAULT, DOUBLE):\n\tdRet = ((_dCuud)(pFn))(_args[0], _args[1], _argsd[0]);\n\tbreak;\ncase CALL3(DOUBLE, DEFAULT, DEFAULT, DEFAULT):\n\tdRet = ((_dCuuu)(pFn))(_args[0], _args[1], _args[2]);\n\tbreak;\ncase CALL3(DEFAULT, SINGLE, SINGLE, SINGLE):\n\tu64Ret = ((_uCfff)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(DEFAULT, SINGLE, SINGLE, DOUBLE):\n\tu64Ret = ((_uCffd)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(DEFAULT, SINGLE, SINGLE, DEFAULT):\n\tu64Ret = ((_uCffu)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0]);\n\tbreak;\ncase CALL3(DEFAULT, SINGLE, DOUBLE, SINGLE):\n\tu64Ret = ((_uCfdf)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(DEFAULT, SINGLE, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCfdd)(pFn))((float)_argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(DEFAULT, SINGLE, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCfdu)(pFn))((float)_argsd[0], _argsd[1], _args[0]);\n\tbreak;\ncase CALL3(DEFAULT, SINGLE, DEFAULT, SINGLE):\n\tu64Ret = ((_uCfuf)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(DEFAULT, SINGLE, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCfud)(pFn))((float)_argsd[0], _args[0], _argsd[1]);\n\tbreak;\ncase CALL3(DEFAULT, SINGLE, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCfuu)(pFn))((float)_argsd[0], _args[0], _args[1]);\n\tbreak;\ncase CALL3(DEFAULT, DOUBLE, SINGLE, SINGLE):\n\tu64Ret = ((_uCdff)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(DEFAULT, DOUBLE, SINGLE, DOUBLE):\n\tu64Ret = ((_uCdfd)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(DEFAULT, DOUBLE, SINGLE, DEFAULT):\n\tu64Ret = ((_uCdfu)(pFn))(_argsd[0], (float)_argsd[1], _args[0]);\n\tbreak;\ncase CALL3(DEFAULT, DOUBLE, DOUBLE, SINGLE):\n\tu64Ret = ((_uCddf)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL3(DEFAULT, DOUBLE, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCddd)(pFn))(_argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL3(DEFAULT, DOUBLE, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCddu)(pFn))(_argsd[0], _argsd[1], _args[0]);\n\tbreak;\ncase CALL3(DEFAULT, DOUBLE, DEFAULT, SINGLE):\n\tu64Ret = ((_uCduf)(pFn))(_argsd[0], _args[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(DEFAULT, DOUBLE, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCdud)(pFn))(_argsd[0], _args[0], _argsd[1]);\n\tbreak;\ncase CALL3(DEFAULT, DOUBLE, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCduu)(pFn))(_argsd[0], _args[0], _args[1]);\n\tbreak;\ncase CALL3(DEFAULT, DEFAULT, SINGLE, SINGLE):\n\tu64Ret = ((_uCuff)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(DEFAULT, DEFAULT, SINGLE, DOUBLE):\n\tu64Ret = ((_uCufd)(pFn))(_args[0], (float)_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL3(DEFAULT, DEFAULT, SINGLE, DEFAULT):\n\tu64Ret = ((_uCufu)(pFn))(_args[0], (float)_argsd[0], _args[1]);\n\tbreak;\ncase CALL3(DEFAULT, DEFAULT, DOUBLE, SINGLE):\n\tu64Ret = ((_uCudf)(pFn))(_args[0], _argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL3(DEFAULT, DEFAULT, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCudd)(pFn))(_args[0], _argsd[0], _argsd[1]);\n\tbreak;\ncase CALL3(DEFAULT, DEFAULT, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCudu)(pFn))(_args[0], _argsd[0], _args[1]);\n\tbreak;\ncase CALL3(DEFAULT, DEFAULT, DEFAULT, SINGLE):\n\tu64Ret = ((_uCuuf)(pFn))(_args[0], _args[1], (float)_argsd[0]);\n\tbreak;\ncase CALL3(DEFAULT, DEFAULT, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCuud)(pFn))(_args[0], _args[1], _argsd[0]);\n\tbreak;\ncase CALL3(DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCuuu)(pFn))(_args[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, SINGLE, SINGLE, SINGLE):\n\tfRet = ((_fCffff)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, SINGLE, SINGLE, DOUBLE):\n\tfRet = ((_fCfffd)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, SINGLE, SINGLE, DEFAULT):\n\tfRet = ((_fCfffu)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, SINGLE, DOUBLE, SINGLE):\n\tfRet = ((_fCffdf)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, SINGLE, DOUBLE, DOUBLE):\n\tfRet = ((_fCffdd)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, SINGLE, DOUBLE, DEFAULT):\n\tfRet = ((_fCffdu)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, SINGLE, DEFAULT, SINGLE):\n\tfRet = ((_fCffuf)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, SINGLE, DEFAULT, DOUBLE):\n\tfRet = ((_fCffud)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, SINGLE, DEFAULT, DEFAULT):\n\tfRet = ((_fCffuu)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DOUBLE, SINGLE, SINGLE):\n\tfRet = ((_fCfdff)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DOUBLE, SINGLE, DOUBLE):\n\tfRet = ((_fCfdfd)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DOUBLE, SINGLE, DEFAULT):\n\tfRet = ((_fCfdfu)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DOUBLE, DOUBLE, SINGLE):\n\tfRet = ((_fCfddf)(pFn))((float)_argsd[0], _argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DOUBLE, DOUBLE, DOUBLE):\n\tfRet = ((_fCfddd)(pFn))((float)_argsd[0], _argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DOUBLE, DOUBLE, DEFAULT):\n\tfRet = ((_fCfddu)(pFn))((float)_argsd[0], _argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DOUBLE, DEFAULT, SINGLE):\n\tfRet = ((_fCfduf)(pFn))((float)_argsd[0], _argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DOUBLE, DEFAULT, DOUBLE):\n\tfRet = ((_fCfdud)(pFn))((float)_argsd[0], _argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DOUBLE, DEFAULT, DEFAULT):\n\tfRet = ((_fCfduu)(pFn))((float)_argsd[0], _argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DEFAULT, SINGLE, SINGLE):\n\tfRet = ((_fCfuff)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DEFAULT, SINGLE, DOUBLE):\n\tfRet = ((_fCfufd)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DEFAULT, SINGLE, DEFAULT):\n\tfRet = ((_fCfufu)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DEFAULT, DOUBLE, SINGLE):\n\tfRet = ((_fCfudf)(pFn))((float)_argsd[0], _args[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DEFAULT, DOUBLE, DOUBLE):\n\tfRet = ((_fCfudd)(pFn))((float)_argsd[0], _args[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DEFAULT, DOUBLE, DEFAULT):\n\tfRet = ((_fCfudu)(pFn))((float)_argsd[0], _args[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DEFAULT, DEFAULT, SINGLE):\n\tfRet = ((_fCfuuf)(pFn))((float)_argsd[0], _args[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DEFAULT, DEFAULT, DOUBLE):\n\tfRet = ((_fCfuud)(pFn))((float)_argsd[0], _args[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, SINGLE, DEFAULT, DEFAULT, DEFAULT):\n\tfRet = ((_fCfuuu)(pFn))((float)_argsd[0], _args[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, SINGLE, SINGLE, SINGLE):\n\tfRet = ((_fCdfff)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, SINGLE, SINGLE, DOUBLE):\n\tfRet = ((_fCdffd)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, SINGLE, SINGLE, DEFAULT):\n\tfRet = ((_fCdffu)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, SINGLE, DOUBLE, SINGLE):\n\tfRet = ((_fCdfdf)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, SINGLE, DOUBLE, DOUBLE):\n\tfRet = ((_fCdfdd)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, SINGLE, DOUBLE, DEFAULT):\n\tfRet = ((_fCdfdu)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, SINGLE, DEFAULT, SINGLE):\n\tfRet = ((_fCdfuf)(pFn))(_argsd[0], (float)_argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, SINGLE, DEFAULT, DOUBLE):\n\tfRet = ((_fCdfud)(pFn))(_argsd[0], (float)_argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, SINGLE, DEFAULT, DEFAULT):\n\tfRet = ((_fCdfuu)(pFn))(_argsd[0], (float)_argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DOUBLE, SINGLE, SINGLE):\n\tfRet = ((_fCddff)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DOUBLE, SINGLE, DOUBLE):\n\tfRet = ((_fCddfd)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DOUBLE, SINGLE, DEFAULT):\n\tfRet = ((_fCddfu)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DOUBLE, DOUBLE, SINGLE):\n\tfRet = ((_fCdddf)(pFn))(_argsd[0], _argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE):\n\tfRet = ((_fCdddd)(pFn))(_argsd[0], _argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DOUBLE, DOUBLE, DEFAULT):\n\tfRet = ((_fCdddu)(pFn))(_argsd[0], _argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DOUBLE, DEFAULT, SINGLE):\n\tfRet = ((_fCdduf)(pFn))(_argsd[0], _argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DOUBLE, DEFAULT, DOUBLE):\n\tfRet = ((_fCddud)(pFn))(_argsd[0], _argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DOUBLE, DEFAULT, DEFAULT):\n\tfRet = ((_fCdduu)(pFn))(_argsd[0], _argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DEFAULT, SINGLE, SINGLE):\n\tfRet = ((_fCduff)(pFn))(_argsd[0], _args[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DEFAULT, SINGLE, DOUBLE):\n\tfRet = ((_fCdufd)(pFn))(_argsd[0], _args[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DEFAULT, SINGLE, DEFAULT):\n\tfRet = ((_fCdufu)(pFn))(_argsd[0], _args[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DEFAULT, DOUBLE, SINGLE):\n\tfRet = ((_fCdudf)(pFn))(_argsd[0], _args[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DEFAULT, DOUBLE, DOUBLE):\n\tfRet = ((_fCdudd)(pFn))(_argsd[0], _args[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DEFAULT, DOUBLE, DEFAULT):\n\tfRet = ((_fCdudu)(pFn))(_argsd[0], _args[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DEFAULT, DEFAULT, SINGLE):\n\tfRet = ((_fCduuf)(pFn))(_argsd[0], _args[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DEFAULT, DEFAULT, DOUBLE):\n\tfRet = ((_fCduud)(pFn))(_argsd[0], _args[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DOUBLE, DEFAULT, DEFAULT, DEFAULT):\n\tfRet = ((_fCduuu)(pFn))(_argsd[0], _args[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, SINGLE, SINGLE, SINGLE):\n\tfRet = ((_fCufff)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, SINGLE, SINGLE, DOUBLE):\n\tfRet = ((_fCuffd)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, SINGLE, SINGLE, DEFAULT):\n\tfRet = ((_fCuffu)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, SINGLE, DOUBLE, SINGLE):\n\tfRet = ((_fCufdf)(pFn))(_args[0], (float)_argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, SINGLE, DOUBLE, DOUBLE):\n\tfRet = ((_fCufdd)(pFn))(_args[0], (float)_argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, SINGLE, DOUBLE, DEFAULT):\n\tfRet = ((_fCufdu)(pFn))(_args[0], (float)_argsd[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, SINGLE, DEFAULT, SINGLE):\n\tfRet = ((_fCufuf)(pFn))(_args[0], (float)_argsd[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, SINGLE, DEFAULT, DOUBLE):\n\tfRet = ((_fCufud)(pFn))(_args[0], (float)_argsd[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, SINGLE, DEFAULT, DEFAULT):\n\tfRet = ((_fCufuu)(pFn))(_args[0], (float)_argsd[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DOUBLE, SINGLE, SINGLE):\n\tfRet = ((_fCudff)(pFn))(_args[0], _argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DOUBLE, SINGLE, DOUBLE):\n\tfRet = ((_fCudfd)(pFn))(_args[0], _argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DOUBLE, SINGLE, DEFAULT):\n\tfRet = ((_fCudfu)(pFn))(_args[0], _argsd[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DOUBLE, DOUBLE, SINGLE):\n\tfRet = ((_fCuddf)(pFn))(_args[0], _argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DOUBLE, DOUBLE, DOUBLE):\n\tfRet = ((_fCuddd)(pFn))(_args[0], _argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DOUBLE, DOUBLE, DEFAULT):\n\tfRet = ((_fCuddu)(pFn))(_args[0], _argsd[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DOUBLE, DEFAULT, SINGLE):\n\tfRet = ((_fCuduf)(pFn))(_args[0], _argsd[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DOUBLE, DEFAULT, DOUBLE):\n\tfRet = ((_fCudud)(pFn))(_args[0], _argsd[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DOUBLE, DEFAULT, DEFAULT):\n\tfRet = ((_fCuduu)(pFn))(_args[0], _argsd[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DEFAULT, SINGLE, SINGLE):\n\tfRet = ((_fCuuff)(pFn))(_args[0], _args[1], (float)_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DEFAULT, SINGLE, DOUBLE):\n\tfRet = ((_fCuufd)(pFn))(_args[0], _args[1], (float)_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DEFAULT, SINGLE, DEFAULT):\n\tfRet = ((_fCuufu)(pFn))(_args[0], _args[1], (float)_argsd[0], _args[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DEFAULT, DOUBLE, SINGLE):\n\tfRet = ((_fCuudf)(pFn))(_args[0], _args[1], _argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DEFAULT, DOUBLE, DOUBLE):\n\tfRet = ((_fCuudd)(pFn))(_args[0], _args[1], _argsd[0], _argsd[1]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DEFAULT, DOUBLE, DEFAULT):\n\tfRet = ((_fCuudu)(pFn))(_args[0], _args[1], _argsd[0], _args[2]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DEFAULT, DEFAULT, SINGLE):\n\tfRet = ((_fCuuuf)(pFn))(_args[0], _args[1], _args[2], (float)_argsd[0]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DEFAULT, DEFAULT, DOUBLE):\n\tfRet = ((_fCuuud)(pFn))(_args[0], _args[1], _args[2], _argsd[0]);\n\tbreak;\ncase CALL4(SINGLE, DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\tfRet = ((_fCuuuu)(pFn))(_args[0], _args[1], _args[2], _args[3]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, SINGLE, SINGLE, SINGLE):\n\tdRet = ((_dCffff)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, SINGLE, SINGLE, DOUBLE):\n\tdRet = ((_dCfffd)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, SINGLE, SINGLE, DEFAULT):\n\tdRet = ((_dCfffu)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, SINGLE, DOUBLE, SINGLE):\n\tdRet = ((_dCffdf)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, SINGLE, DOUBLE, DOUBLE):\n\tdRet = ((_dCffdd)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, SINGLE, DOUBLE, DEFAULT):\n\tdRet = ((_dCffdu)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, SINGLE, DEFAULT, SINGLE):\n\tdRet = ((_dCffuf)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, SINGLE, DEFAULT, DOUBLE):\n\tdRet = ((_dCffud)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, SINGLE, DEFAULT, DEFAULT):\n\tdRet = ((_dCffuu)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DOUBLE, SINGLE, SINGLE):\n\tdRet = ((_dCfdff)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DOUBLE, SINGLE, DOUBLE):\n\tdRet = ((_dCfdfd)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DOUBLE, SINGLE, DEFAULT):\n\tdRet = ((_dCfdfu)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DOUBLE, DOUBLE, SINGLE):\n\tdRet = ((_dCfddf)(pFn))((float)_argsd[0], _argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DOUBLE, DOUBLE, DOUBLE):\n\tdRet = ((_dCfddd)(pFn))((float)_argsd[0], _argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DOUBLE, DOUBLE, DEFAULT):\n\tdRet = ((_dCfddu)(pFn))((float)_argsd[0], _argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DOUBLE, DEFAULT, SINGLE):\n\tdRet = ((_dCfduf)(pFn))((float)_argsd[0], _argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DOUBLE, DEFAULT, DOUBLE):\n\tdRet = ((_dCfdud)(pFn))((float)_argsd[0], _argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DOUBLE, DEFAULT, DEFAULT):\n\tdRet = ((_dCfduu)(pFn))((float)_argsd[0], _argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DEFAULT, SINGLE, SINGLE):\n\tdRet = ((_dCfuff)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DEFAULT, SINGLE, DOUBLE):\n\tdRet = ((_dCfufd)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DEFAULT, SINGLE, DEFAULT):\n\tdRet = ((_dCfufu)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DEFAULT, DOUBLE, SINGLE):\n\tdRet = ((_dCfudf)(pFn))((float)_argsd[0], _args[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DEFAULT, DOUBLE, DOUBLE):\n\tdRet = ((_dCfudd)(pFn))((float)_argsd[0], _args[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DEFAULT, DOUBLE, DEFAULT):\n\tdRet = ((_dCfudu)(pFn))((float)_argsd[0], _args[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DEFAULT, DEFAULT, SINGLE):\n\tdRet = ((_dCfuuf)(pFn))((float)_argsd[0], _args[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DEFAULT, DEFAULT, DOUBLE):\n\tdRet = ((_dCfuud)(pFn))((float)_argsd[0], _args[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, SINGLE, DEFAULT, DEFAULT, DEFAULT):\n\tdRet = ((_dCfuuu)(pFn))((float)_argsd[0], _args[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, SINGLE, SINGLE, SINGLE):\n\tdRet = ((_dCdfff)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, SINGLE, SINGLE, DOUBLE):\n\tdRet = ((_dCdffd)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, SINGLE, SINGLE, DEFAULT):\n\tdRet = ((_dCdffu)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, SINGLE, DOUBLE, SINGLE):\n\tdRet = ((_dCdfdf)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, SINGLE, DOUBLE, DOUBLE):\n\tdRet = ((_dCdfdd)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, SINGLE, DOUBLE, DEFAULT):\n\tdRet = ((_dCdfdu)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, SINGLE, DEFAULT, SINGLE):\n\tdRet = ((_dCdfuf)(pFn))(_argsd[0], (float)_argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, SINGLE, DEFAULT, DOUBLE):\n\tdRet = ((_dCdfud)(pFn))(_argsd[0], (float)_argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, SINGLE, DEFAULT, DEFAULT):\n\tdRet = ((_dCdfuu)(pFn))(_argsd[0], (float)_argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DOUBLE, SINGLE, SINGLE):\n\tdRet = ((_dCddff)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DOUBLE, SINGLE, DOUBLE):\n\tdRet = ((_dCddfd)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DOUBLE, SINGLE, DEFAULT):\n\tdRet = ((_dCddfu)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DOUBLE, DOUBLE, SINGLE):\n\tdRet = ((_dCdddf)(pFn))(_argsd[0], _argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE):\n\tdRet = ((_dCdddd)(pFn))(_argsd[0], _argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DOUBLE, DOUBLE, DEFAULT):\n\tdRet = ((_dCdddu)(pFn))(_argsd[0], _argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DOUBLE, DEFAULT, SINGLE):\n\tdRet = ((_dCdduf)(pFn))(_argsd[0], _argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DOUBLE, DEFAULT, DOUBLE):\n\tdRet = ((_dCddud)(pFn))(_argsd[0], _argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DOUBLE, DEFAULT, DEFAULT):\n\tdRet = ((_dCdduu)(pFn))(_argsd[0], _argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DEFAULT, SINGLE, SINGLE):\n\tdRet = ((_dCduff)(pFn))(_argsd[0], _args[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DEFAULT, SINGLE, DOUBLE):\n\tdRet = ((_dCdufd)(pFn))(_argsd[0], _args[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DEFAULT, SINGLE, DEFAULT):\n\tdRet = ((_dCdufu)(pFn))(_argsd[0], _args[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DEFAULT, DOUBLE, SINGLE):\n\tdRet = ((_dCdudf)(pFn))(_argsd[0], _args[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DEFAULT, DOUBLE, DOUBLE):\n\tdRet = ((_dCdudd)(pFn))(_argsd[0], _args[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DEFAULT, DOUBLE, DEFAULT):\n\tdRet = ((_dCdudu)(pFn))(_argsd[0], _args[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DEFAULT, DEFAULT, SINGLE):\n\tdRet = ((_dCduuf)(pFn))(_argsd[0], _args[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DEFAULT, DEFAULT, DOUBLE):\n\tdRet = ((_dCduud)(pFn))(_argsd[0], _args[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DOUBLE, DEFAULT, DEFAULT, DEFAULT):\n\tdRet = ((_dCduuu)(pFn))(_argsd[0], _args[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, SINGLE, SINGLE, SINGLE):\n\tdRet = ((_dCufff)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, SINGLE, SINGLE, DOUBLE):\n\tdRet = ((_dCuffd)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, SINGLE, SINGLE, DEFAULT):\n\tdRet = ((_dCuffu)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, SINGLE, DOUBLE, SINGLE):\n\tdRet = ((_dCufdf)(pFn))(_args[0], (float)_argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, SINGLE, DOUBLE, DOUBLE):\n\tdRet = ((_dCufdd)(pFn))(_args[0], (float)_argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, SINGLE, DOUBLE, DEFAULT):\n\tdRet = ((_dCufdu)(pFn))(_args[0], (float)_argsd[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, SINGLE, DEFAULT, SINGLE):\n\tdRet = ((_dCufuf)(pFn))(_args[0], (float)_argsd[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, SINGLE, DEFAULT, DOUBLE):\n\tdRet = ((_dCufud)(pFn))(_args[0], (float)_argsd[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, SINGLE, DEFAULT, DEFAULT):\n\tdRet = ((_dCufuu)(pFn))(_args[0], (float)_argsd[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DOUBLE, SINGLE, SINGLE):\n\tdRet = ((_dCudff)(pFn))(_args[0], _argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DOUBLE, SINGLE, DOUBLE):\n\tdRet = ((_dCudfd)(pFn))(_args[0], _argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DOUBLE, SINGLE, DEFAULT):\n\tdRet = ((_dCudfu)(pFn))(_args[0], _argsd[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DOUBLE, DOUBLE, SINGLE):\n\tdRet = ((_dCuddf)(pFn))(_args[0], _argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DOUBLE, DOUBLE, DOUBLE):\n\tdRet = ((_dCuddd)(pFn))(_args[0], _argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DOUBLE, DOUBLE, DEFAULT):\n\tdRet = ((_dCuddu)(pFn))(_args[0], _argsd[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DOUBLE, DEFAULT, SINGLE):\n\tdRet = ((_dCuduf)(pFn))(_args[0], _argsd[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DOUBLE, DEFAULT, DOUBLE):\n\tdRet = ((_dCudud)(pFn))(_args[0], _argsd[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DOUBLE, DEFAULT, DEFAULT):\n\tdRet = ((_dCuduu)(pFn))(_args[0], _argsd[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DEFAULT, SINGLE, SINGLE):\n\tdRet = ((_dCuuff)(pFn))(_args[0], _args[1], (float)_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DEFAULT, SINGLE, DOUBLE):\n\tdRet = ((_dCuufd)(pFn))(_args[0], _args[1], (float)_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DEFAULT, SINGLE, DEFAULT):\n\tdRet = ((_dCuufu)(pFn))(_args[0], _args[1], (float)_argsd[0], _args[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DEFAULT, DOUBLE, SINGLE):\n\tdRet = ((_dCuudf)(pFn))(_args[0], _args[1], _argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DEFAULT, DOUBLE, DOUBLE):\n\tdRet = ((_dCuudd)(pFn))(_args[0], _args[1], _argsd[0], _argsd[1]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DEFAULT, DOUBLE, DEFAULT):\n\tdRet = ((_dCuudu)(pFn))(_args[0], _args[1], _argsd[0], _args[2]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DEFAULT, DEFAULT, SINGLE):\n\tdRet = ((_dCuuuf)(pFn))(_args[0], _args[1], _args[2], (float)_argsd[0]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DEFAULT, DEFAULT, DOUBLE):\n\tdRet = ((_dCuuud)(pFn))(_args[0], _args[1], _args[2], _argsd[0]);\n\tbreak;\ncase CALL4(DOUBLE, DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\tdRet = ((_dCuuuu)(pFn))(_args[0], _args[1], _args[2], _args[3]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, SINGLE, SINGLE, SINGLE):\n\tu64Ret = ((_uCffff)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, SINGLE, SINGLE, DOUBLE):\n\tu64Ret = ((_uCfffd)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, SINGLE, SINGLE, DEFAULT):\n\tu64Ret = ((_uCfffu)(pFn))((float)_argsd[0], (float)_argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, SINGLE, DOUBLE, SINGLE):\n\tu64Ret = ((_uCffdf)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, SINGLE, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCffdd)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, SINGLE, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCffdu)(pFn))((float)_argsd[0], (float)_argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, SINGLE, DEFAULT, SINGLE):\n\tu64Ret = ((_uCffuf)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, SINGLE, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCffud)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, SINGLE, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCffuu)(pFn))((float)_argsd[0], (float)_argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DOUBLE, SINGLE, SINGLE):\n\tu64Ret = ((_uCfdff)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DOUBLE, SINGLE, DOUBLE):\n\tu64Ret = ((_uCfdfd)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DOUBLE, SINGLE, DEFAULT):\n\tu64Ret = ((_uCfdfu)(pFn))((float)_argsd[0], _argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DOUBLE, DOUBLE, SINGLE):\n\tu64Ret = ((_uCfddf)(pFn))((float)_argsd[0], _argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DOUBLE, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCfddd)(pFn))((float)_argsd[0], _argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DOUBLE, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCfddu)(pFn))((float)_argsd[0], _argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DOUBLE, DEFAULT, SINGLE):\n\tu64Ret = ((_uCfduf)(pFn))((float)_argsd[0], _argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DOUBLE, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCfdud)(pFn))((float)_argsd[0], _argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DOUBLE, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCfduu)(pFn))((float)_argsd[0], _argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DEFAULT, SINGLE, SINGLE):\n\tu64Ret = ((_uCfuff)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DEFAULT, SINGLE, DOUBLE):\n\tu64Ret = ((_uCfufd)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DEFAULT, SINGLE, DEFAULT):\n\tu64Ret = ((_uCfufu)(pFn))((float)_argsd[0], _args[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DEFAULT, DOUBLE, SINGLE):\n\tu64Ret = ((_uCfudf)(pFn))((float)_argsd[0], _args[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DEFAULT, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCfudd)(pFn))((float)_argsd[0], _args[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DEFAULT, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCfudu)(pFn))((float)_argsd[0], _args[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DEFAULT, DEFAULT, SINGLE):\n\tu64Ret = ((_uCfuuf)(pFn))((float)_argsd[0], _args[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DEFAULT, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCfuud)(pFn))((float)_argsd[0], _args[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, SINGLE, DEFAULT, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCfuuu)(pFn))((float)_argsd[0], _args[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, SINGLE, SINGLE, SINGLE):\n\tu64Ret = ((_uCdfff)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, SINGLE, SINGLE, DOUBLE):\n\tu64Ret = ((_uCdffd)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, SINGLE, SINGLE, DEFAULT):\n\tu64Ret = ((_uCdffu)(pFn))(_argsd[0], (float)_argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, SINGLE, DOUBLE, SINGLE):\n\tu64Ret = ((_uCdfdf)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, SINGLE, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCdfdd)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, SINGLE, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCdfdu)(pFn))(_argsd[0], (float)_argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, SINGLE, DEFAULT, SINGLE):\n\tu64Ret = ((_uCdfuf)(pFn))(_argsd[0], (float)_argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, SINGLE, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCdfud)(pFn))(_argsd[0], (float)_argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, SINGLE, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCdfuu)(pFn))(_argsd[0], (float)_argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DOUBLE, SINGLE, SINGLE):\n\tu64Ret = ((_uCddff)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DOUBLE, SINGLE, DOUBLE):\n\tu64Ret = ((_uCddfd)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DOUBLE, SINGLE, DEFAULT):\n\tu64Ret = ((_uCddfu)(pFn))(_argsd[0], _argsd[1], (float)_argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DOUBLE, DOUBLE, SINGLE):\n\tu64Ret = ((_uCdddf)(pFn))(_argsd[0], _argsd[1], _argsd[2], (float)_argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DOUBLE, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCdddd)(pFn))(_argsd[0], _argsd[1], _argsd[2], _argsd[3]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DOUBLE, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCdddu)(pFn))(_argsd[0], _argsd[1], _argsd[2], _args[0]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DOUBLE, DEFAULT, SINGLE):\n\tu64Ret = ((_uCdduf)(pFn))(_argsd[0], _argsd[1], _args[0], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DOUBLE, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCddud)(pFn))(_argsd[0], _argsd[1], _args[0], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DOUBLE, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCdduu)(pFn))(_argsd[0], _argsd[1], _args[0], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DEFAULT, SINGLE, SINGLE):\n\tu64Ret = ((_uCduff)(pFn))(_argsd[0], _args[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DEFAULT, SINGLE, DOUBLE):\n\tu64Ret = ((_uCdufd)(pFn))(_argsd[0], _args[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DEFAULT, SINGLE, DEFAULT):\n\tu64Ret = ((_uCdufu)(pFn))(_argsd[0], _args[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DEFAULT, DOUBLE, SINGLE):\n\tu64Ret = ((_uCdudf)(pFn))(_argsd[0], _args[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DEFAULT, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCdudd)(pFn))(_argsd[0], _args[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DEFAULT, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCdudu)(pFn))(_argsd[0], _args[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DEFAULT, DEFAULT, SINGLE):\n\tu64Ret = ((_uCduuf)(pFn))(_argsd[0], _args[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DEFAULT, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCduud)(pFn))(_argsd[0], _args[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DOUBLE, DEFAULT, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCduuu)(pFn))(_argsd[0], _args[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, SINGLE, SINGLE, SINGLE):\n\tu64Ret = ((_uCufff)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, SINGLE, SINGLE, DOUBLE):\n\tu64Ret = ((_uCuffd)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, SINGLE, SINGLE, DEFAULT):\n\tu64Ret = ((_uCuffu)(pFn))(_args[0], (float)_argsd[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, SINGLE, DOUBLE, SINGLE):\n\tu64Ret = ((_uCufdf)(pFn))(_args[0], (float)_argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, SINGLE, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCufdd)(pFn))(_args[0], (float)_argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, SINGLE, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCufdu)(pFn))(_args[0], (float)_argsd[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, SINGLE, DEFAULT, SINGLE):\n\tu64Ret = ((_uCufuf)(pFn))(_args[0], (float)_argsd[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, SINGLE, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCufud)(pFn))(_args[0], (float)_argsd[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, SINGLE, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCufuu)(pFn))(_args[0], (float)_argsd[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DOUBLE, SINGLE, SINGLE):\n\tu64Ret = ((_uCudff)(pFn))(_args[0], _argsd[0], (float)_argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DOUBLE, SINGLE, DOUBLE):\n\tu64Ret = ((_uCudfd)(pFn))(_args[0], _argsd[0], (float)_argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DOUBLE, SINGLE, DEFAULT):\n\tu64Ret = ((_uCudfu)(pFn))(_args[0], _argsd[0], (float)_argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DOUBLE, DOUBLE, SINGLE):\n\tu64Ret = ((_uCuddf)(pFn))(_args[0], _argsd[0], _argsd[1], (float)_argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DOUBLE, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCuddd)(pFn))(_args[0], _argsd[0], _argsd[1], _argsd[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DOUBLE, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCuddu)(pFn))(_args[0], _argsd[0], _argsd[1], _args[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DOUBLE, DEFAULT, SINGLE):\n\tu64Ret = ((_uCuduf)(pFn))(_args[0], _argsd[0], _args[1], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DOUBLE, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCudud)(pFn))(_args[0], _argsd[0], _args[1], _argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DOUBLE, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCuduu)(pFn))(_args[0], _argsd[0], _args[1], _args[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DEFAULT, SINGLE, SINGLE):\n\tu64Ret = ((_uCuuff)(pFn))(_args[0], _args[1], (float)_argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DEFAULT, SINGLE, DOUBLE):\n\tu64Ret = ((_uCuufd)(pFn))(_args[0], _args[1], (float)_argsd[0], _argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DEFAULT, SINGLE, DEFAULT):\n\tu64Ret = ((_uCuufu)(pFn))(_args[0], _args[1], (float)_argsd[0], _args[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DEFAULT, DOUBLE, SINGLE):\n\tu64Ret = ((_uCuudf)(pFn))(_args[0], _args[1], _argsd[0], (float)_argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DEFAULT, DOUBLE, DOUBLE):\n\tu64Ret = ((_uCuudd)(pFn))(_args[0], _args[1], _argsd[0], _argsd[1]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DEFAULT, DOUBLE, DEFAULT):\n\tu64Ret = ((_uCuudu)(pFn))(_args[0], _args[1], _argsd[0], _args[2]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DEFAULT, DEFAULT, SINGLE):\n\tu64Ret = ((_uCuuuf)(pFn))(_args[0], _args[1], _args[2], (float)_argsd[0]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DEFAULT, DEFAULT, DOUBLE):\n\tu64Ret = ((_uCuuud)(pFn))(_args[0], _args[1], _args[2], _argsd[0]);\n\tbreak;\ncase CALL4(DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT):\n\tu64Ret = ((_uCuuuu)(pFn))(_args[0], _args[1], _args[2], _args[3]);\n\tbreak;\n"
  },
  {
    "path": "dna/PInvoke_TypeDef.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\ntypedef float  (STDCALL *_fC)();\ntypedef double (STDCALL *_dC)();\ntypedef U64    (STDCALL *_uC)();\ntypedef float  (STDCALL *_fCf)(float _0);\ntypedef float  (STDCALL *_fCd)(double _0);\ntypedef float  (STDCALL *_fCu)(U32 _0);\ntypedef double (STDCALL *_dCf)(float _0);\ntypedef double (STDCALL *_dCd)(double _0);\ntypedef double (STDCALL *_dCu)(U32 _0);\ntypedef U64    (STDCALL *_uCf)(float _0);\ntypedef U64    (STDCALL *_uCd)(double _0);\ntypedef U64    (STDCALL *_uCu)(U32 _0);\ntypedef float  (STDCALL *_fCff)(float _0, float _1);\ntypedef float  (STDCALL *_fCfd)(float _0, double _1);\ntypedef float  (STDCALL *_fCfu)(float _0, U32 _1);\ntypedef float  (STDCALL *_fCdf)(double _0, float _1);\ntypedef float  (STDCALL *_fCdd)(double _0, double _1);\ntypedef float  (STDCALL *_fCdu)(double _0, U32 _1);\ntypedef float  (STDCALL *_fCuf)(U32 _0, float _1);\ntypedef float  (STDCALL *_fCud)(U32 _0, double _1);\ntypedef float  (STDCALL *_fCuu)(U32 _0, U32 _1);\ntypedef double (STDCALL *_dCff)(float _0, float _1);\ntypedef double (STDCALL *_dCfd)(float _0, double _1);\ntypedef double (STDCALL *_dCfu)(float _0, U32 _1);\ntypedef double (STDCALL *_dCdf)(double _0, float _1);\ntypedef double (STDCALL *_dCdd)(double _0, double _1);\ntypedef double (STDCALL *_dCdu)(double _0, U32 _1);\ntypedef double (STDCALL *_dCuf)(U32 _0, float _1);\ntypedef double (STDCALL *_dCud)(U32 _0, double _1);\ntypedef double (STDCALL *_dCuu)(U32 _0, U32 _1);\ntypedef U64    (STDCALL *_uCff)(float _0, float _1);\ntypedef U64    (STDCALL *_uCfd)(float _0, double _1);\ntypedef U64    (STDCALL *_uCfu)(float _0, U32 _1);\ntypedef U64    (STDCALL *_uCdf)(double _0, float _1);\ntypedef U64    (STDCALL *_uCdd)(double _0, double _1);\ntypedef U64    (STDCALL *_uCdu)(double _0, U32 _1);\ntypedef U64    (STDCALL *_uCuf)(U32 _0, float _1);\ntypedef U64    (STDCALL *_uCud)(U32 _0, double _1);\ntypedef U64    (STDCALL *_uCuu)(U32 _0, U32 _1);\ntypedef float  (STDCALL *_fCfff)(float _0, float _1, float _2);\ntypedef float  (STDCALL *_fCffd)(float _0, float _1, double _2);\ntypedef float  (STDCALL *_fCffu)(float _0, float _1, U32 _2);\ntypedef float  (STDCALL *_fCfdf)(float _0, double _1, float _2);\ntypedef float  (STDCALL *_fCfdd)(float _0, double _1, double _2);\ntypedef float  (STDCALL *_fCfdu)(float _0, double _1, U32 _2);\ntypedef float  (STDCALL *_fCfuf)(float _0, U32 _1, float _2);\ntypedef float  (STDCALL *_fCfud)(float _0, U32 _1, double _2);\ntypedef float  (STDCALL *_fCfuu)(float _0, U32 _1, U32 _2);\ntypedef float  (STDCALL *_fCdff)(double _0, float _1, float _2);\ntypedef float  (STDCALL *_fCdfd)(double _0, float _1, double _2);\ntypedef float  (STDCALL *_fCdfu)(double _0, float _1, U32 _2);\ntypedef float  (STDCALL *_fCddf)(double _0, double _1, float _2);\ntypedef float  (STDCALL *_fCddd)(double _0, double _1, double _2);\ntypedef float  (STDCALL *_fCddu)(double _0, double _1, U32 _2);\ntypedef float  (STDCALL *_fCduf)(double _0, U32 _1, float _2);\ntypedef float  (STDCALL *_fCdud)(double _0, U32 _1, double _2);\ntypedef float  (STDCALL *_fCduu)(double _0, U32 _1, U32 _2);\ntypedef float  (STDCALL *_fCuff)(U32 _0, float _1, float _2);\ntypedef float  (STDCALL *_fCufd)(U32 _0, float _1, double _2);\ntypedef float  (STDCALL *_fCufu)(U32 _0, float _1, U32 _2);\ntypedef float  (STDCALL *_fCudf)(U32 _0, double _1, float _2);\ntypedef float  (STDCALL *_fCudd)(U32 _0, double _1, double _2);\ntypedef float  (STDCALL *_fCudu)(U32 _0, double _1, U32 _2);\ntypedef float  (STDCALL *_fCuuf)(U32 _0, U32 _1, float _2);\ntypedef float  (STDCALL *_fCuud)(U32 _0, U32 _1, double _2);\ntypedef float  (STDCALL *_fCuuu)(U32 _0, U32 _1, U32 _2);\ntypedef double (STDCALL *_dCfff)(float _0, float _1, float _2);\ntypedef double (STDCALL *_dCffd)(float _0, float _1, double _2);\ntypedef double (STDCALL *_dCffu)(float _0, float _1, U32 _2);\ntypedef double (STDCALL *_dCfdf)(float _0, double _1, float _2);\ntypedef double (STDCALL *_dCfdd)(float _0, double _1, double _2);\ntypedef double (STDCALL *_dCfdu)(float _0, double _1, U32 _2);\ntypedef double (STDCALL *_dCfuf)(float _0, U32 _1, float _2);\ntypedef double (STDCALL *_dCfud)(float _0, U32 _1, double _2);\ntypedef double (STDCALL *_dCfuu)(float _0, U32 _1, U32 _2);\ntypedef double (STDCALL *_dCdff)(double _0, float _1, float _2);\ntypedef double (STDCALL *_dCdfd)(double _0, float _1, double _2);\ntypedef double (STDCALL *_dCdfu)(double _0, float _1, U32 _2);\ntypedef double (STDCALL *_dCddf)(double _0, double _1, float _2);\ntypedef double (STDCALL *_dCddd)(double _0, double _1, double _2);\ntypedef double (STDCALL *_dCddu)(double _0, double _1, U32 _2);\ntypedef double (STDCALL *_dCduf)(double _0, U32 _1, float _2);\ntypedef double (STDCALL *_dCdud)(double _0, U32 _1, double _2);\ntypedef double (STDCALL *_dCduu)(double _0, U32 _1, U32 _2);\ntypedef double (STDCALL *_dCuff)(U32 _0, float _1, float _2);\ntypedef double (STDCALL *_dCufd)(U32 _0, float _1, double _2);\ntypedef double (STDCALL *_dCufu)(U32 _0, float _1, U32 _2);\ntypedef double (STDCALL *_dCudf)(U32 _0, double _1, float _2);\ntypedef double (STDCALL *_dCudd)(U32 _0, double _1, double _2);\ntypedef double (STDCALL *_dCudu)(U32 _0, double _1, U32 _2);\ntypedef double (STDCALL *_dCuuf)(U32 _0, U32 _1, float _2);\ntypedef double (STDCALL *_dCuud)(U32 _0, U32 _1, double _2);\ntypedef double (STDCALL *_dCuuu)(U32 _0, U32 _1, U32 _2);\ntypedef U64    (STDCALL *_uCfff)(float _0, float _1, float _2);\ntypedef U64    (STDCALL *_uCffd)(float _0, float _1, double _2);\ntypedef U64    (STDCALL *_uCffu)(float _0, float _1, U32 _2);\ntypedef U64    (STDCALL *_uCfdf)(float _0, double _1, float _2);\ntypedef U64    (STDCALL *_uCfdd)(float _0, double _1, double _2);\ntypedef U64    (STDCALL *_uCfdu)(float _0, double _1, U32 _2);\ntypedef U64    (STDCALL *_uCfuf)(float _0, U32 _1, float _2);\ntypedef U64    (STDCALL *_uCfud)(float _0, U32 _1, double _2);\ntypedef U64    (STDCALL *_uCfuu)(float _0, U32 _1, U32 _2);\ntypedef U64    (STDCALL *_uCdff)(double _0, float _1, float _2);\ntypedef U64    (STDCALL *_uCdfd)(double _0, float _1, double _2);\ntypedef U64    (STDCALL *_uCdfu)(double _0, float _1, U32 _2);\ntypedef U64    (STDCALL *_uCddf)(double _0, double _1, float _2);\ntypedef U64    (STDCALL *_uCddd)(double _0, double _1, double _2);\ntypedef U64    (STDCALL *_uCddu)(double _0, double _1, U32 _2);\ntypedef U64    (STDCALL *_uCduf)(double _0, U32 _1, float _2);\ntypedef U64    (STDCALL *_uCdud)(double _0, U32 _1, double _2);\ntypedef U64    (STDCALL *_uCduu)(double _0, U32 _1, U32 _2);\ntypedef U64    (STDCALL *_uCuff)(U32 _0, float _1, float _2);\ntypedef U64    (STDCALL *_uCufd)(U32 _0, float _1, double _2);\ntypedef U64    (STDCALL *_uCufu)(U32 _0, float _1, U32 _2);\ntypedef U64    (STDCALL *_uCudf)(U32 _0, double _1, float _2);\ntypedef U64    (STDCALL *_uCudd)(U32 _0, double _1, double _2);\ntypedef U64    (STDCALL *_uCudu)(U32 _0, double _1, U32 _2);\ntypedef U64    (STDCALL *_uCuuf)(U32 _0, U32 _1, float _2);\ntypedef U64    (STDCALL *_uCuud)(U32 _0, U32 _1, double _2);\ntypedef U64    (STDCALL *_uCuuu)(U32 _0, U32 _1, U32 _2);\ntypedef float  (STDCALL *_fCffff)(float _0, float _1, float _2, float _3);\ntypedef float  (STDCALL *_fCfffd)(float _0, float _1, float _2, double _3);\ntypedef float  (STDCALL *_fCfffu)(float _0, float _1, float _2, U32 _3);\ntypedef float  (STDCALL *_fCffdf)(float _0, float _1, double _2, float _3);\ntypedef float  (STDCALL *_fCffdd)(float _0, float _1, double _2, double _3);\ntypedef float  (STDCALL *_fCffdu)(float _0, float _1, double _2, U32 _3);\ntypedef float  (STDCALL *_fCffuf)(float _0, float _1, U32 _2, float _3);\ntypedef float  (STDCALL *_fCffud)(float _0, float _1, U32 _2, double _3);\ntypedef float  (STDCALL *_fCffuu)(float _0, float _1, U32 _2, U32 _3);\ntypedef float  (STDCALL *_fCfdff)(float _0, double _1, float _2, float _3);\ntypedef float  (STDCALL *_fCfdfd)(float _0, double _1, float _2, double _3);\ntypedef float  (STDCALL *_fCfdfu)(float _0, double _1, float _2, U32 _3);\ntypedef float  (STDCALL *_fCfddf)(float _0, double _1, double _2, float _3);\ntypedef float  (STDCALL *_fCfddd)(float _0, double _1, double _2, double _3);\ntypedef float  (STDCALL *_fCfddu)(float _0, double _1, double _2, U32 _3);\ntypedef float  (STDCALL *_fCfduf)(float _0, double _1, U32 _2, float _3);\ntypedef float  (STDCALL *_fCfdud)(float _0, double _1, U32 _2, double _3);\ntypedef float  (STDCALL *_fCfduu)(float _0, double _1, U32 _2, U32 _3);\ntypedef float  (STDCALL *_fCfuff)(float _0, U32 _1, float _2, float _3);\ntypedef float  (STDCALL *_fCfufd)(float _0, U32 _1, float _2, double _3);\ntypedef float  (STDCALL *_fCfufu)(float _0, U32 _1, float _2, U32 _3);\ntypedef float  (STDCALL *_fCfudf)(float _0, U32 _1, double _2, float _3);\ntypedef float  (STDCALL *_fCfudd)(float _0, U32 _1, double _2, double _3);\ntypedef float  (STDCALL *_fCfudu)(float _0, U32 _1, double _2, U32 _3);\ntypedef float  (STDCALL *_fCfuuf)(float _0, U32 _1, U32 _2, float _3);\ntypedef float  (STDCALL *_fCfuud)(float _0, U32 _1, U32 _2, double _3);\ntypedef float  (STDCALL *_fCfuuu)(float _0, U32 _1, U32 _2, U32 _3);\ntypedef float  (STDCALL *_fCdfff)(double _0, float _1, float _2, float _3);\ntypedef float  (STDCALL *_fCdffd)(double _0, float _1, float _2, double _3);\ntypedef float  (STDCALL *_fCdffu)(double _0, float _1, float _2, U32 _3);\ntypedef float  (STDCALL *_fCdfdf)(double _0, float _1, double _2, float _3);\ntypedef float  (STDCALL *_fCdfdd)(double _0, float _1, double _2, double _3);\ntypedef float  (STDCALL *_fCdfdu)(double _0, float _1, double _2, U32 _3);\ntypedef float  (STDCALL *_fCdfuf)(double _0, float _1, U32 _2, float _3);\ntypedef float  (STDCALL *_fCdfud)(double _0, float _1, U32 _2, double _3);\ntypedef float  (STDCALL *_fCdfuu)(double _0, float _1, U32 _2, U32 _3);\ntypedef float  (STDCALL *_fCddff)(double _0, double _1, float _2, float _3);\ntypedef float  (STDCALL *_fCddfd)(double _0, double _1, float _2, double _3);\ntypedef float  (STDCALL *_fCddfu)(double _0, double _1, float _2, U32 _3);\ntypedef float  (STDCALL *_fCdddf)(double _0, double _1, double _2, float _3);\ntypedef float  (STDCALL *_fCdddd)(double _0, double _1, double _2, double _3);\ntypedef float  (STDCALL *_fCdddu)(double _0, double _1, double _2, U32 _3);\ntypedef float  (STDCALL *_fCdduf)(double _0, double _1, U32 _2, float _3);\ntypedef float  (STDCALL *_fCddud)(double _0, double _1, U32 _2, double _3);\ntypedef float  (STDCALL *_fCdduu)(double _0, double _1, U32 _2, U32 _3);\ntypedef float  (STDCALL *_fCduff)(double _0, U32 _1, float _2, float _3);\ntypedef float  (STDCALL *_fCdufd)(double _0, U32 _1, float _2, double _3);\ntypedef float  (STDCALL *_fCdufu)(double _0, U32 _1, float _2, U32 _3);\ntypedef float  (STDCALL *_fCdudf)(double _0, U32 _1, double _2, float _3);\ntypedef float  (STDCALL *_fCdudd)(double _0, U32 _1, double _2, double _3);\ntypedef float  (STDCALL *_fCdudu)(double _0, U32 _1, double _2, U32 _3);\ntypedef float  (STDCALL *_fCduuf)(double _0, U32 _1, U32 _2, float _3);\ntypedef float  (STDCALL *_fCduud)(double _0, U32 _1, U32 _2, double _3);\ntypedef float  (STDCALL *_fCduuu)(double _0, U32 _1, U32 _2, U32 _3);\ntypedef float  (STDCALL *_fCufff)(U32 _0, float _1, float _2, float _3);\ntypedef float  (STDCALL *_fCuffd)(U32 _0, float _1, float _2, double _3);\ntypedef float  (STDCALL *_fCuffu)(U32 _0, float _1, float _2, U32 _3);\ntypedef float  (STDCALL *_fCufdf)(U32 _0, float _1, double _2, float _3);\ntypedef float  (STDCALL *_fCufdd)(U32 _0, float _1, double _2, double _3);\ntypedef float  (STDCALL *_fCufdu)(U32 _0, float _1, double _2, U32 _3);\ntypedef float  (STDCALL *_fCufuf)(U32 _0, float _1, U32 _2, float _3);\ntypedef float  (STDCALL *_fCufud)(U32 _0, float _1, U32 _2, double _3);\ntypedef float  (STDCALL *_fCufuu)(U32 _0, float _1, U32 _2, U32 _3);\ntypedef float  (STDCALL *_fCudff)(U32 _0, double _1, float _2, float _3);\ntypedef float  (STDCALL *_fCudfd)(U32 _0, double _1, float _2, double _3);\ntypedef float  (STDCALL *_fCudfu)(U32 _0, double _1, float _2, U32 _3);\ntypedef float  (STDCALL *_fCuddf)(U32 _0, double _1, double _2, float _3);\ntypedef float  (STDCALL *_fCuddd)(U32 _0, double _1, double _2, double _3);\ntypedef float  (STDCALL *_fCuddu)(U32 _0, double _1, double _2, U32 _3);\ntypedef float  (STDCALL *_fCuduf)(U32 _0, double _1, U32 _2, float _3);\ntypedef float  (STDCALL *_fCudud)(U32 _0, double _1, U32 _2, double _3);\ntypedef float  (STDCALL *_fCuduu)(U32 _0, double _1, U32 _2, U32 _3);\ntypedef float  (STDCALL *_fCuuff)(U32 _0, U32 _1, float _2, float _3);\ntypedef float  (STDCALL *_fCuufd)(U32 _0, U32 _1, float _2, double _3);\ntypedef float  (STDCALL *_fCuufu)(U32 _0, U32 _1, float _2, U32 _3);\ntypedef float  (STDCALL *_fCuudf)(U32 _0, U32 _1, double _2, float _3);\ntypedef float  (STDCALL *_fCuudd)(U32 _0, U32 _1, double _2, double _3);\ntypedef float  (STDCALL *_fCuudu)(U32 _0, U32 _1, double _2, U32 _3);\ntypedef float  (STDCALL *_fCuuuf)(U32 _0, U32 _1, U32 _2, float _3);\ntypedef float  (STDCALL *_fCuuud)(U32 _0, U32 _1, U32 _2, double _3);\ntypedef float  (STDCALL *_fCuuuu)(U32 _0, U32 _1, U32 _2, U32 _3);\ntypedef double (STDCALL *_dCffff)(float _0, float _1, float _2, float _3);\ntypedef double (STDCALL *_dCfffd)(float _0, float _1, float _2, double _3);\ntypedef double (STDCALL *_dCfffu)(float _0, float _1, float _2, U32 _3);\ntypedef double (STDCALL *_dCffdf)(float _0, float _1, double _2, float _3);\ntypedef double (STDCALL *_dCffdd)(float _0, float _1, double _2, double _3);\ntypedef double (STDCALL *_dCffdu)(float _0, float _1, double _2, U32 _3);\ntypedef double (STDCALL *_dCffuf)(float _0, float _1, U32 _2, float _3);\ntypedef double (STDCALL *_dCffud)(float _0, float _1, U32 _2, double _3);\ntypedef double (STDCALL *_dCffuu)(float _0, float _1, U32 _2, U32 _3);\ntypedef double (STDCALL *_dCfdff)(float _0, double _1, float _2, float _3);\ntypedef double (STDCALL *_dCfdfd)(float _0, double _1, float _2, double _3);\ntypedef double (STDCALL *_dCfdfu)(float _0, double _1, float _2, U32 _3);\ntypedef double (STDCALL *_dCfddf)(float _0, double _1, double _2, float _3);\ntypedef double (STDCALL *_dCfddd)(float _0, double _1, double _2, double _3);\ntypedef double (STDCALL *_dCfddu)(float _0, double _1, double _2, U32 _3);\ntypedef double (STDCALL *_dCfduf)(float _0, double _1, U32 _2, float _3);\ntypedef double (STDCALL *_dCfdud)(float _0, double _1, U32 _2, double _3);\ntypedef double (STDCALL *_dCfduu)(float _0, double _1, U32 _2, U32 _3);\ntypedef double (STDCALL *_dCfuff)(float _0, U32 _1, float _2, float _3);\ntypedef double (STDCALL *_dCfufd)(float _0, U32 _1, float _2, double _3);\ntypedef double (STDCALL *_dCfufu)(float _0, U32 _1, float _2, U32 _3);\ntypedef double (STDCALL *_dCfudf)(float _0, U32 _1, double _2, float _3);\ntypedef double (STDCALL *_dCfudd)(float _0, U32 _1, double _2, double _3);\ntypedef double (STDCALL *_dCfudu)(float _0, U32 _1, double _2, U32 _3);\ntypedef double (STDCALL *_dCfuuf)(float _0, U32 _1, U32 _2, float _3);\ntypedef double (STDCALL *_dCfuud)(float _0, U32 _1, U32 _2, double _3);\ntypedef double (STDCALL *_dCfuuu)(float _0, U32 _1, U32 _2, U32 _3);\ntypedef double (STDCALL *_dCdfff)(double _0, float _1, float _2, float _3);\ntypedef double (STDCALL *_dCdffd)(double _0, float _1, float _2, double _3);\ntypedef double (STDCALL *_dCdffu)(double _0, float _1, float _2, U32 _3);\ntypedef double (STDCALL *_dCdfdf)(double _0, float _1, double _2, float _3);\ntypedef double (STDCALL *_dCdfdd)(double _0, float _1, double _2, double _3);\ntypedef double (STDCALL *_dCdfdu)(double _0, float _1, double _2, U32 _3);\ntypedef double (STDCALL *_dCdfuf)(double _0, float _1, U32 _2, float _3);\ntypedef double (STDCALL *_dCdfud)(double _0, float _1, U32 _2, double _3);\ntypedef double (STDCALL *_dCdfuu)(double _0, float _1, U32 _2, U32 _3);\ntypedef double (STDCALL *_dCddff)(double _0, double _1, float _2, float _3);\ntypedef double (STDCALL *_dCddfd)(double _0, double _1, float _2, double _3);\ntypedef double (STDCALL *_dCddfu)(double _0, double _1, float _2, U32 _3);\ntypedef double (STDCALL *_dCdddf)(double _0, double _1, double _2, float _3);\ntypedef double (STDCALL *_dCdddd)(double _0, double _1, double _2, double _3);\ntypedef double (STDCALL *_dCdddu)(double _0, double _1, double _2, U32 _3);\ntypedef double (STDCALL *_dCdduf)(double _0, double _1, U32 _2, float _3);\ntypedef double (STDCALL *_dCddud)(double _0, double _1, U32 _2, double _3);\ntypedef double (STDCALL *_dCdduu)(double _0, double _1, U32 _2, U32 _3);\ntypedef double (STDCALL *_dCduff)(double _0, U32 _1, float _2, float _3);\ntypedef double (STDCALL *_dCdufd)(double _0, U32 _1, float _2, double _3);\ntypedef double (STDCALL *_dCdufu)(double _0, U32 _1, float _2, U32 _3);\ntypedef double (STDCALL *_dCdudf)(double _0, U32 _1, double _2, float _3);\ntypedef double (STDCALL *_dCdudd)(double _0, U32 _1, double _2, double _3);\ntypedef double (STDCALL *_dCdudu)(double _0, U32 _1, double _2, U32 _3);\ntypedef double (STDCALL *_dCduuf)(double _0, U32 _1, U32 _2, float _3);\ntypedef double (STDCALL *_dCduud)(double _0, U32 _1, U32 _2, double _3);\ntypedef double (STDCALL *_dCduuu)(double _0, U32 _1, U32 _2, U32 _3);\ntypedef double (STDCALL *_dCufff)(U32 _0, float _1, float _2, float _3);\ntypedef double (STDCALL *_dCuffd)(U32 _0, float _1, float _2, double _3);\ntypedef double (STDCALL *_dCuffu)(U32 _0, float _1, float _2, U32 _3);\ntypedef double (STDCALL *_dCufdf)(U32 _0, float _1, double _2, float _3);\ntypedef double (STDCALL *_dCufdd)(U32 _0, float _1, double _2, double _3);\ntypedef double (STDCALL *_dCufdu)(U32 _0, float _1, double _2, U32 _3);\ntypedef double (STDCALL *_dCufuf)(U32 _0, float _1, U32 _2, float _3);\ntypedef double (STDCALL *_dCufud)(U32 _0, float _1, U32 _2, double _3);\ntypedef double (STDCALL *_dCufuu)(U32 _0, float _1, U32 _2, U32 _3);\ntypedef double (STDCALL *_dCudff)(U32 _0, double _1, float _2, float _3);\ntypedef double (STDCALL *_dCudfd)(U32 _0, double _1, float _2, double _3);\ntypedef double (STDCALL *_dCudfu)(U32 _0, double _1, float _2, U32 _3);\ntypedef double (STDCALL *_dCuddf)(U32 _0, double _1, double _2, float _3);\ntypedef double (STDCALL *_dCuddd)(U32 _0, double _1, double _2, double _3);\ntypedef double (STDCALL *_dCuddu)(U32 _0, double _1, double _2, U32 _3);\ntypedef double (STDCALL *_dCuduf)(U32 _0, double _1, U32 _2, float _3);\ntypedef double (STDCALL *_dCudud)(U32 _0, double _1, U32 _2, double _3);\ntypedef double (STDCALL *_dCuduu)(U32 _0, double _1, U32 _2, U32 _3);\ntypedef double (STDCALL *_dCuuff)(U32 _0, U32 _1, float _2, float _3);\ntypedef double (STDCALL *_dCuufd)(U32 _0, U32 _1, float _2, double _3);\ntypedef double (STDCALL *_dCuufu)(U32 _0, U32 _1, float _2, U32 _3);\ntypedef double (STDCALL *_dCuudf)(U32 _0, U32 _1, double _2, float _3);\ntypedef double (STDCALL *_dCuudd)(U32 _0, U32 _1, double _2, double _3);\ntypedef double (STDCALL *_dCuudu)(U32 _0, U32 _1, double _2, U32 _3);\ntypedef double (STDCALL *_dCuuuf)(U32 _0, U32 _1, U32 _2, float _3);\ntypedef double (STDCALL *_dCuuud)(U32 _0, U32 _1, U32 _2, double _3);\ntypedef double (STDCALL *_dCuuuu)(U32 _0, U32 _1, U32 _2, U32 _3);\ntypedef U64    (STDCALL *_uCffff)(float _0, float _1, float _2, float _3);\ntypedef U64    (STDCALL *_uCfffd)(float _0, float _1, float _2, double _3);\ntypedef U64    (STDCALL *_uCfffu)(float _0, float _1, float _2, U32 _3);\ntypedef U64    (STDCALL *_uCffdf)(float _0, float _1, double _2, float _3);\ntypedef U64    (STDCALL *_uCffdd)(float _0, float _1, double _2, double _3);\ntypedef U64    (STDCALL *_uCffdu)(float _0, float _1, double _2, U32 _3);\ntypedef U64    (STDCALL *_uCffuf)(float _0, float _1, U32 _2, float _3);\ntypedef U64    (STDCALL *_uCffud)(float _0, float _1, U32 _2, double _3);\ntypedef U64    (STDCALL *_uCffuu)(float _0, float _1, U32 _2, U32 _3);\ntypedef U64    (STDCALL *_uCfdff)(float _0, double _1, float _2, float _3);\ntypedef U64    (STDCALL *_uCfdfd)(float _0, double _1, float _2, double _3);\ntypedef U64    (STDCALL *_uCfdfu)(float _0, double _1, float _2, U32 _3);\ntypedef U64    (STDCALL *_uCfddf)(float _0, double _1, double _2, float _3);\ntypedef U64    (STDCALL *_uCfddd)(float _0, double _1, double _2, double _3);\ntypedef U64    (STDCALL *_uCfddu)(float _0, double _1, double _2, U32 _3);\ntypedef U64    (STDCALL *_uCfduf)(float _0, double _1, U32 _2, float _3);\ntypedef U64    (STDCALL *_uCfdud)(float _0, double _1, U32 _2, double _3);\ntypedef U64    (STDCALL *_uCfduu)(float _0, double _1, U32 _2, U32 _3);\ntypedef U64    (STDCALL *_uCfuff)(float _0, U32 _1, float _2, float _3);\ntypedef U64    (STDCALL *_uCfufd)(float _0, U32 _1, float _2, double _3);\ntypedef U64    (STDCALL *_uCfufu)(float _0, U32 _1, float _2, U32 _3);\ntypedef U64    (STDCALL *_uCfudf)(float _0, U32 _1, double _2, float _3);\ntypedef U64    (STDCALL *_uCfudd)(float _0, U32 _1, double _2, double _3);\ntypedef U64    (STDCALL *_uCfudu)(float _0, U32 _1, double _2, U32 _3);\ntypedef U64    (STDCALL *_uCfuuf)(float _0, U32 _1, U32 _2, float _3);\ntypedef U64    (STDCALL *_uCfuud)(float _0, U32 _1, U32 _2, double _3);\ntypedef U64    (STDCALL *_uCfuuu)(float _0, U32 _1, U32 _2, U32 _3);\ntypedef U64    (STDCALL *_uCdfff)(double _0, float _1, float _2, float _3);\ntypedef U64    (STDCALL *_uCdffd)(double _0, float _1, float _2, double _3);\ntypedef U64    (STDCALL *_uCdffu)(double _0, float _1, float _2, U32 _3);\ntypedef U64    (STDCALL *_uCdfdf)(double _0, float _1, double _2, float _3);\ntypedef U64    (STDCALL *_uCdfdd)(double _0, float _1, double _2, double _3);\ntypedef U64    (STDCALL *_uCdfdu)(double _0, float _1, double _2, U32 _3);\ntypedef U64    (STDCALL *_uCdfuf)(double _0, float _1, U32 _2, float _3);\ntypedef U64    (STDCALL *_uCdfud)(double _0, float _1, U32 _2, double _3);\ntypedef U64    (STDCALL *_uCdfuu)(double _0, float _1, U32 _2, U32 _3);\ntypedef U64    (STDCALL *_uCddff)(double _0, double _1, float _2, float _3);\ntypedef U64    (STDCALL *_uCddfd)(double _0, double _1, float _2, double _3);\ntypedef U64    (STDCALL *_uCddfu)(double _0, double _1, float _2, U32 _3);\ntypedef U64    (STDCALL *_uCdddf)(double _0, double _1, double _2, float _3);\ntypedef U64    (STDCALL *_uCdddd)(double _0, double _1, double _2, double _3);\ntypedef U64    (STDCALL *_uCdddu)(double _0, double _1, double _2, U32 _3);\ntypedef U64    (STDCALL *_uCdduf)(double _0, double _1, U32 _2, float _3);\ntypedef U64    (STDCALL *_uCddud)(double _0, double _1, U32 _2, double _3);\ntypedef U64    (STDCALL *_uCdduu)(double _0, double _1, U32 _2, U32 _3);\ntypedef U64    (STDCALL *_uCduff)(double _0, U32 _1, float _2, float _3);\ntypedef U64    (STDCALL *_uCdufd)(double _0, U32 _1, float _2, double _3);\ntypedef U64    (STDCALL *_uCdufu)(double _0, U32 _1, float _2, U32 _3);\ntypedef U64    (STDCALL *_uCdudf)(double _0, U32 _1, double _2, float _3);\ntypedef U64    (STDCALL *_uCdudd)(double _0, U32 _1, double _2, double _3);\ntypedef U64    (STDCALL *_uCdudu)(double _0, U32 _1, double _2, U32 _3);\ntypedef U64    (STDCALL *_uCduuf)(double _0, U32 _1, U32 _2, float _3);\ntypedef U64    (STDCALL *_uCduud)(double _0, U32 _1, U32 _2, double _3);\ntypedef U64    (STDCALL *_uCduuu)(double _0, U32 _1, U32 _2, U32 _3);\ntypedef U64    (STDCALL *_uCufff)(U32 _0, float _1, float _2, float _3);\ntypedef U64    (STDCALL *_uCuffd)(U32 _0, float _1, float _2, double _3);\ntypedef U64    (STDCALL *_uCuffu)(U32 _0, float _1, float _2, U32 _3);\ntypedef U64    (STDCALL *_uCufdf)(U32 _0, float _1, double _2, float _3);\ntypedef U64    (STDCALL *_uCufdd)(U32 _0, float _1, double _2, double _3);\ntypedef U64    (STDCALL *_uCufdu)(U32 _0, float _1, double _2, U32 _3);\ntypedef U64    (STDCALL *_uCufuf)(U32 _0, float _1, U32 _2, float _3);\ntypedef U64    (STDCALL *_uCufud)(U32 _0, float _1, U32 _2, double _3);\ntypedef U64    (STDCALL *_uCufuu)(U32 _0, float _1, U32 _2, U32 _3);\ntypedef U64    (STDCALL *_uCudff)(U32 _0, double _1, float _2, float _3);\ntypedef U64    (STDCALL *_uCudfd)(U32 _0, double _1, float _2, double _3);\ntypedef U64    (STDCALL *_uCudfu)(U32 _0, double _1, float _2, U32 _3);\ntypedef U64    (STDCALL *_uCuddf)(U32 _0, double _1, double _2, float _3);\ntypedef U64    (STDCALL *_uCuddd)(U32 _0, double _1, double _2, double _3);\ntypedef U64    (STDCALL *_uCuddu)(U32 _0, double _1, double _2, U32 _3);\ntypedef U64    (STDCALL *_uCuduf)(U32 _0, double _1, U32 _2, float _3);\ntypedef U64    (STDCALL *_uCudud)(U32 _0, double _1, U32 _2, double _3);\ntypedef U64    (STDCALL *_uCuduu)(U32 _0, double _1, U32 _2, U32 _3);\ntypedef U64    (STDCALL *_uCuuff)(U32 _0, U32 _1, float _2, float _3);\ntypedef U64    (STDCALL *_uCuufd)(U32 _0, U32 _1, float _2, double _3);\ntypedef U64    (STDCALL *_uCuufu)(U32 _0, U32 _1, float _2, U32 _3);\ntypedef U64    (STDCALL *_uCuudf)(U32 _0, U32 _1, double _2, float _3);\ntypedef U64    (STDCALL *_uCuudd)(U32 _0, U32 _1, double _2, double _3);\ntypedef U64    (STDCALL *_uCuudu)(U32 _0, U32 _1, double _2, U32 _3);\ntypedef U64    (STDCALL *_uCuuuf)(U32 _0, U32 _1, U32 _2, float _3);\ntypedef U64    (STDCALL *_uCuuud)(U32 _0, U32 _1, U32 _2, double _3);\ntypedef U64    (STDCALL *_uCuuuu)(U32 _0, U32 _1, U32 _2, U32 _3);\n"
  },
  {
    "path": "dna/RVA.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n#include \"Compat.h\"\n\n#include \"RVA.h\"\n\ntRVA* RVA() {\n\ttRVA *pRet;\n\tpRet = TMALLOC(tRVA);\n\treturn pRet;\n}\n\ntRVA_Item* RVA_Create(tRVA *pThis, void *pFile, void *pSectionHeader) {\n\ttRVA_Item* pRet;\n\tunsigned int rawOfs;\n\tunsigned int rawSize;\n\n\tpRet = TMALLOC(tRVA_Item);\n\tpRet->baseAddress = *(unsigned int*)&((char*)pSectionHeader)[12];\n\tpRet->size = *(unsigned int*)&((char*)pSectionHeader)[8];\n\tpRet->pData = malloc(pRet->size);\n\tmemset(pRet->pData, 0, pRet->size);\n\tpRet->pNext = pThis->pFirstRVA;\n\tpThis->pFirstRVA = pRet;\n\n\trawOfs = *(unsigned int*)&((char*)pSectionHeader)[20];\n\trawSize = *(unsigned int*)&((char*)pSectionHeader)[16];\n\tif (rawOfs > 0) {\n\t\tif (rawSize > pRet->size) {\n\t\t\trawSize = pRet->size;\n\t\t}\n\t\tmemcpy(pRet->pData, ((char*)pFile)+rawOfs, rawSize);\n\t}\n\n\treturn pRet;\n}\n\nvoid* RVA_FindData(tRVA *pThis, unsigned int rva) {\n\ttRVA_Item *pRVA;\n\n\tif (rva == 0) {\n\t\treturn NULL;\n\t}\n\n\tpRVA = pThis->pFirstRVA;\n\twhile (pRVA != NULL) {\n\t\tif (rva >= pRVA->baseAddress && rva < pRVA->baseAddress+pRVA->size) {\n\t\t\treturn (char*)(pRVA->pData) + (rva - pRVA->baseAddress);\n\t\t}\n\t\tpRVA = pRVA->pNext;\n\t}\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/RVA.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined (__RVA_H)\n#define __RVA_H\n\ntypedef struct tRVA_Item_ tRVA_Item;\nstruct tRVA_Item_ {\n\tunsigned int baseAddress;\n\tunsigned int size;\n\tvoid *pData;\n\n\ttRVA_Item *pNext;\n};\n\ntypedef struct tRVA_ tRVA;\nstruct tRVA_ {\n\ttRVA_Item *pFirstRVA;\n};\n\ntRVA* RVA();\ntRVA_Item* RVA_Create(tRVA *pThis, void *pFile, void *pSectionHeader);\nvoid* RVA_FindData(tRVA *pThis, unsigned int rva);\n\n#endif\n"
  },
  {
    "path": "dna/Sys.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\nvoid Crash(char *pMsg, ...) {\n\tva_list va;\n\n\tprintf(\"\\n\\n*** CRASH ***\\n\");\n\n\tva_start(va, pMsg);\n\n\tvprintf(pMsg, va);\n\n\tva_end(va);\n\n\tprintf(\"\\n\\n\");\n\n#ifdef WIN32\n\t{\n\t\t// Cause a delibrate exception, to get into debugger\n\t\t__debugbreak();\n\t}\n#endif\n\n\texit(1);\n}\n\nU32 logLevel = 0;\n\nvoid log_f(U32 level, char *pMsg, ...) {\n\tva_list va;\n\n\tif (logLevel >= level) {\n\t\tva_start(va, pMsg);\n\t\tvprintf(pMsg, va);\n\t\tva_end(va);\n\t}\n}\n\nstatic char methodName[2048];\nchar* Sys_GetMethodDesc(tMD_MethodDef *pMethod) {\n\tU32 i;\n\n\tsprintf(methodName, \"%s.%s.%s(\", pMethod->pParentType->nameSpace, pMethod->pParentType->name, pMethod->name);\n\tfor (i=METHOD_ISSTATIC(pMethod)?0:1; i<pMethod->numberOfParameters; i++) {\n\t\tif (i > (U32)(METHOD_ISSTATIC(pMethod)?0:1)) {\n\t\t\tsprintf(strchr(methodName, 0), \",\");\n\t\t}\n\t\tsprintf(strchr(methodName, 0), pMethod->pParams[i].pTypeDef->name);\n\t}\n\tsprintf(strchr(methodName, 0), \")\");\n\treturn methodName;\n}\n\nstatic U32 mallocForeverSize = 0;\n// malloc() some memory that will never need to be resized or freed.\nvoid* mallocForever(U32 size) {\n\tmallocForeverSize += size;\nlog_f(3, \"--- mallocForever: TotalSize %d\\n\", mallocForeverSize);\n\treturn malloc(size);\n}\n\n/*\n#ifdef _DEBUG\nvoid* mallocTrace(int s, char *pFile, int line) {\n\t//printf(\"MALLOC: %s:%d %d\\n\", pFile, line, s);\n#undef malloc\n\treturn malloc(s);\n}\n#endif\n*/\n\nU64 msTime() {\n#ifdef WIN32\n\tstatic LARGE_INTEGER freq = {0,0};\n\tLARGE_INTEGER time;\n\tif (freq.QuadPart == 0) {\n\t\tQueryPerformanceFrequency(&freq);\n\t}\n\tQueryPerformanceCounter(&time);\n\treturn (time.QuadPart * 1000) / freq.QuadPart;\n#else\n\tstruct timeval tp;\n\tU64 ms;\n\tgettimeofday(&tp,NULL);\n\tms = tp.tv_sec;\n\tms *= 1000;\n\tms += ((U64)tp.tv_usec)/((U64)1000);\n\treturn ms;\n#endif\n}\n\n#if defined(DIAG_METHOD_CALLS) || defined(DIAG_OPCODE_TIMES) || defined(DIAG_GC) || defined(DIAG_TOTAL_TIME)\nU64 microTime() {\n#ifdef WIN32\n\tstatic LARGE_INTEGER freq = {0,0};\n\tLARGE_INTEGER time;\n\tif (freq.QuadPart == 0) {\n\t\tQueryPerformanceFrequency(&freq);\n\t}\n\tQueryPerformanceCounter(&time);\n\treturn (time.QuadPart * 1000000) / freq.QuadPart;\n#else\n\tstruct timeval tp;\n\tU64 ms;\n\tgettimeofday(&tp,NULL);\n\tms = tp.tv_sec;\n\tms *= 1000000;\n\tms += ((U64)tp.tv_usec);\n\treturn ms;\n#endif\n}\n#endif\n\nvoid SleepMS(U32 ms) {\n#ifdef WIN32\n\tSleep(ms);\n#else\n\tsleep(ms / 1000);\n\tusleep((ms % 1000) * 1000);\n#endif\n}"
  },
  {
    "path": "dna/Sys.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYS_H)\n#define __SYS_H\n\n#include \"Config.h\"\n\n/*#ifdef _DEBUG\nvoid* mallocTrace(int s, char *pFile, int line);\n#define malloc(s) mallocTrace(s, __FILE__, __LINE__)\n#endif*/\n\n#ifdef _DEBUG\n#define Assert(cond) if (!(cond)) Crash(\"Assert failed: %s, line %d\", __FILE__, __LINE__);\n#else\n#define Assert(cond)\n#endif\n\n#define FAKE_RETURN exit(101)\n\n#define INTERNALCALL_PARAM(ofs, type) *(type*)(pParams + ofs)\n\n#include \"MetaData.h\"\n\nvoid Crash(char *pMsg, ...);\n\nextern U32 logLevel;\nvoid log_f(U32 level, char *pMsg, ...);\n\nchar* Sys_GetMethodDesc(tMD_MethodDef *pMethod);\n\nvoid* mallocForever(U32 size);\n\nU64 msTime();\n#if defined(DIAG_METHOD_CALLS) || defined(DIAG_OPCODE_TIMES) || defined(DIAG_GC) || defined(DIAG_TOTAL_TIME)\nU64 microTime();\n#endif\nvoid SleepMS(U32 ms);\n\n#endif\n"
  },
  {
    "path": "dna/System.Array.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Array.h\"\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n#include \"Heap.h\"\n#include \"Type.h\"\n\ntypedef struct tSystemArray_ tSystemArray;\nstruct tSystemArray_ {\n\t// How many elements in array\n\tU32 length;\n\t// The elements\n\tU8 elements[0];\n};\n\n// Must return a boxed version of value-types\ntAsyncCall* System_Array_Internal_GetValue(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemArray *pArray = (tSystemArray*)pThis_;\n\ttMD_TypeDef *pArrayType;\n\tU32 index, elementSize;\n\ttMD_TypeDef *pElementType;\n\tPTR pElement;\n\n\tindex = *(U32*)pParams;\n\tpArrayType = Heap_GetType(pThis_);\n\tpElementType = pArrayType->pArrayElementType;\n\telementSize = pElementType->arrayElementSize;\n\tpElement = pArray->elements + elementSize * index;\n\tif (pElementType->isValueType) {\n\t\t// If it's a value-type, then box it\n\t\tHEAP_PTR boxedValue;\n\t\tif (pElementType->pGenericDefinition == types[TYPE_SYSTEM_NULLABLE]) {\n\t\t\t// Nullable type, so box specially\n\t\t\tif (*(U32*)pElement) {\n\t\t\t\t// Nullable has value\n\t\t\t\tboxedValue = Heap_AllocType(pElementType->ppClassTypeArgs[0]);\n\t\t\t\t// Don't copy the .hasValue part\n\t\t\t\tmemcpy(boxedValue, pElement + 4, elementSize - 4);\n\t\t\t} else {\n\t\t\t\t// Nullable does not have value\n\t\t\t\tboxedValue = NULL;\n\t\t\t}\n\t\t} else {\n\t\t\tboxedValue = Heap_AllocType(pElementType);\n\t\t\tmemcpy(boxedValue, pElement, elementSize);\n\t\t}\n\t\t*(HEAP_PTR*)pReturnValue = boxedValue;\n\t} else {\n\t\t// This must be a reference type, so it must be 32-bits wide\n\t\t*(U32*)pReturnValue = *(U32*)pElement;\n\t}\n\n\treturn NULL;\n}\n\n// Value-types will be boxed\ntAsyncCall* System_Array_Internal_SetValue(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemArray *pArray = (tSystemArray*)pThis_;\n\ttMD_TypeDef *pArrayType, *pObjType;\n\tU32 index, elementSize;\n\tHEAP_PTR obj;\n\ttMD_TypeDef *pElementType;\n\tPTR pElement;\n\n\tpArrayType = Heap_GetType(pThis_);\n\tobj = ((HEAP_PTR*)pParams)[0];\n\tpObjType = Heap_GetType(obj);\n\tpElementType = pArrayType->pArrayElementType;\n\t// Check to see if the Type is ok to put in the array\n\tif (!(Type_IsAssignableFrom(pElementType, pObjType) ||\n\t\t(pElementType->pGenericDefinition == types[TYPE_SYSTEM_NULLABLE] &&\n\t\tpElementType->ppClassTypeArgs[0] == pObjType))) {\n\t\t// Can't be done\n\t\t*(U32*)pReturnValue = 0;\n\t\treturn NULL;\n\t}\n\n\tindex = ((U32*)pParams)[1];\n\n#if defined(WIN32) && defined(_DEBUG)\n\t// Do a bounds-check\n\tif (index >= pArray->length) {\n\t\tprintf(\"[Array] Internal_SetValue() Bounds-check failed\\n\");\n\t\t__debugbreak();\n\t}\n#endif\n\n\telementSize = pElementType->arrayElementSize;\n\tpElement = pArray->elements + elementSize * index;\n\tif (pElementType->isValueType) {\n\t\tif (pElementType->pGenericDefinition == types[TYPE_SYSTEM_NULLABLE]) {\n\t\t\t// Nullable type, so treat specially\n\t\t\tif (obj == NULL) {\n\t\t\t\tmemset(pElement, 0, elementSize);\n\t\t\t} else {\n\t\t\t\t*(U32*)pElement = 1;\n\t\t\t\tmemcpy(pElement + 4, obj, elementSize - 4);\n\t\t\t}\n\t\t} else {\n\t\t\t// Get the value out of the box\n\t\t\tmemcpy(pElement, obj, elementSize);\n\t\t}\n\t} else {\n\t\t// This must be a reference type, so it must be 32-bits wide\n\t\t*(HEAP_PTR*)pElement = obj;\n\t}\n\t*(U32*)pReturnValue = 1;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Array_Clear(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemArray *pArray;\n\tU32 index, length, elementSize;\n\ttMD_TypeDef *pArrayType;\n\n\tpArray = ((tSystemArray**)pParams)[0];\n\tindex = ((U32*)pParams)[1];\n\tlength = ((U32*)pParams)[2];\n\tpArrayType = Heap_GetType((HEAP_PTR)pArray);\n\telementSize = pArrayType->pArrayElementType->arrayElementSize;\n\tmemset(pArray->elements + index * elementSize, 0, length * elementSize);\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Array_Internal_Copy(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemArray *pSrc, *pDst;\n\ttMD_TypeDef *pSrcType, *pDstType, *pSrcElementType;\n\n\tpSrc = ((tSystemArray**)pParams)[0];\n\tpDst = ((tSystemArray**)pParams)[2];\n\t\n\t// Check if we can do a fast-copy with these two arrays\n\tpSrcType = Heap_GetType((HEAP_PTR)pSrc);\n\tpDstType = Heap_GetType((HEAP_PTR)pDst);\n\tpSrcElementType = pSrcType->pArrayElementType;\n\tif (Type_IsAssignableFrom(pDstType->pArrayElementType, pSrcElementType)) {\n\t\t// Can do fast-copy\n\t\tU32 srcIndex, dstIndex, length, elementSize;\n\n\t\tsrcIndex = ((U32*)pParams)[1];\n\t\tdstIndex = ((U32*)pParams)[3];\n\t\tlength = ((U32*)pParams)[4];\n\n#if defined(WIN32) && defined(_DEBUG)\n\t\t// Do bounds check\n\t\tif (srcIndex + length > pSrc->length || dstIndex + length > pDst->length) {\n\t\t\tprintf(\"[Array] Internal_Copy() Bounds check failed\\n\");\n\t\t\t__debugbreak();\n\t\t}\n#endif\n\n\t\telementSize = pSrcElementType->arrayElementSize;\n\n\t\tmemcpy(pDst->elements + dstIndex * elementSize, pSrc->elements + srcIndex * elementSize, length * elementSize);\n\n\t\t*(U32*)pReturnValue = 1;\n\t} else {\n\t\t// Cannot do fast-copy\n\t\t*(U32*)pReturnValue = 0;\n\t}\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Array_Resize(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHEAP_PTR* ppArray_, pHeap;\n\ttSystemArray *pOldArray, *pNewArray;\n\tU32 newSize, oldSize;\n\ttMD_TypeDef *pArrayTypeDef;\n\n\tppArray_ = ((HEAP_PTR**)pParams)[0];\n\tnewSize = ((U32*)pParams)[1];\n\n\tpOldArray = (tSystemArray*)*ppArray_;\n\toldSize = pOldArray->length;\n\n\tif (oldSize == newSize) {\n\t\t// Do nothing if new length equals the current length.\n\t\treturn NULL;\n\t}\n\n\tpArrayTypeDef = Heap_GetType(*ppArray_);\n\tpHeap = SystemArray_NewVector(pArrayTypeDef, newSize);\n\tpNewArray = (tSystemArray*)pHeap;\n\t*ppArray_ = pHeap;\n\tmemcpy(pNewArray->elements, pOldArray->elements,\n\t\tpArrayTypeDef->pArrayElementType->arrayElementSize * ((newSize<oldSize)?newSize:oldSize));\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Array_Reverse(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemArray *pArray;\n\tU32 index, length, elementSize, i, dec;\n\ttMD_TypeDef *pArrayType;\n\tU8 *pE1, *pE2;\n\n\tpArray = INTERNALCALL_PARAM(0, tSystemArray*);\n\tindex = INTERNALCALL_PARAM(4, U32);\n\tlength = INTERNALCALL_PARAM(8, U32);\n\n\tpArrayType = Heap_GetType((HEAP_PTR)pArray);\n\telementSize = pArrayType->pArrayElementType->arrayElementSize;\n\t\n\tpE1 = pArray->elements + index * elementSize;\n\tpE2 = pArray->elements + (index + length - 1) * elementSize;\n\tdec = elementSize << 1;\n\n\twhile (pE2 > pE1) {\n\t\tfor (i=elementSize; i>0; i--) {\n\t\t\tU8 c = *pE1;\n\t\t\t*pE1++ = *pE2;\n\t\t\t*pE2++ = c;\n\t\t}\n\t\tpE2 -= dec;\n\t}\n\n\treturn NULL;\n}\n\nHEAP_PTR SystemArray_NewVector(tMD_TypeDef *pArrayTypeDef, U32 length) {\n\tU32 heapSize;\n\ttSystemArray *pArray;\n\n\theapSize = sizeof(tSystemArray) + length * pArrayTypeDef->pArrayElementType->arrayElementSize;\n\tpArray = (tSystemArray*)Heap_Alloc(pArrayTypeDef, heapSize);\n\tpArray->length = length;\n\treturn (HEAP_PTR)pArray;\n}\n\nvoid SystemArray_StoreElement(HEAP_PTR pThis_, U32 index, PTR value) {\n\ttSystemArray *pArray = (tSystemArray*)pThis_;\n\ttMD_TypeDef *pArrayTypeDef;\n\tU32 elemSize;\n\n#if defined(WIN32) && defined(_DEBUG)\n\t// Do a bounds check\n\tif (index >= pArray->length) {\n\t\tprintf(\"SystemArray_StoreElement() Bounds check failed. Array length: %d  index: %d\\n\", pArray->length, index);\n\t\t__debugbreak();\n\t}\n#endif\n\n\tpArrayTypeDef = Heap_GetType(pThis_);\n\telemSize = pArrayTypeDef->pArrayElementType->arrayElementSize;\n\tswitch (elemSize) {\n\tcase 1:\n\t\t((U8*)(pArray->elements))[index] = *(U8*)value;\n\t\tbreak;\n\tcase 2:\n\t\t((U16*)(pArray->elements))[index] = *(U16*)value;\n\t\tbreak;\n\tcase 4:\n\t\t((U32*)(pArray->elements))[index] = *(U32*)value;\n\t\tbreak;\n\tdefault:\n\t\tmemcpy(&pArray->elements[index * elemSize], value, elemSize);\n\t\tbreak;\n\t}\n}\n\nvoid SystemArray_LoadElement(HEAP_PTR pThis_, U32 index, PTR value) {\n\ttSystemArray *pArray = (tSystemArray*)pThis_;\n\ttMD_TypeDef *pArrayTypeDef;\n\tU32 elemSize;\n\n\tpArrayTypeDef = Heap_GetType(pThis_);\n\telemSize = pArrayTypeDef->pArrayElementType->arrayElementSize;\n\tswitch (elemSize) {\n\tcase 1:\n\t\t*(U8*)value =((U8*)(pArray->elements))[index];\n\t\tbreak;\n\tcase 2:\n\t\t*(U16*)value = ((U16*)(pArray->elements))[index];\n\t\tbreak;\n\tcase 4:\n\t\t*(U32*)value = ((U32*)(pArray->elements))[index];\n\t\tbreak;\n\tdefault:\n\t\tmemcpy(value, &pArray->elements[index * elemSize], elemSize);\n\t\tbreak;\n\t}\n}\n\nPTR SystemArray_LoadElementAddress(HEAP_PTR pThis_, U32 index) {\n\ttSystemArray *pArray = (tSystemArray*)pThis_;\n\ttMD_TypeDef *pArrayTypeDef;\n\n#if defined(WIN32) && defined(_DEBUG)\n\tif (index >= pArray->length) {\n\t\tprintf(\"SystemArray_LoadElementAddress() Bounds check failed\\n\");\n\t\t__debugbreak();\n\t}\n#endif\n\n\tpArrayTypeDef = Heap_GetType(pThis_);\n\treturn pArray->elements + pArrayTypeDef->pArrayElementType->arrayElementSize * index;\n}\n\nU32 SystemArray_GetNumBytes(HEAP_PTR pThis_, tMD_TypeDef *pElementType) {\n\treturn (((tSystemArray*)pThis_)->length * pElementType->arrayElementSize) + sizeof(tSystemArray);\n}"
  },
  {
    "path": "dna/System.Array.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_ARRAY_H)\n#define __SYSTEM_ARRAY_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntAsyncCall* System_Array_Internal_GetValue(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Array_Internal_SetValue(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Array_Clear(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Array_Internal_Copy(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Array_Resize(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Array_Reverse(PTR pThis_, PTR pParams, PTR pReturnValue);\n\nHEAP_PTR SystemArray_NewVector(tMD_TypeDef *pArrayTypeDef, U32 length);\n#define SystemArray_GetLength(pArray) (*(U32*)(pArray))\nvoid SystemArray_StoreElement(HEAP_PTR pThis_, U32 index, PTR value);\nvoid SystemArray_LoadElement(HEAP_PTR pThis_, U32 index, PTR value);\n#define SystemArray_GetElements(pArray) ((PTR)(((PTR)pArray)+4))\nPTR SystemArray_LoadElementAddress(HEAP_PTR pThis_, U32 index);\nU32 SystemArray_GetNumBytes(HEAP_PTR pThis_, tMD_TypeDef *pElementType);\n#endif"
  },
  {
    "path": "dna/System.Char.CaseConversion.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nstatic unsigned short UC_CaseLower[] = {\n\t0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, 0x0068, // 0000\n\t0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, // 0008\n\t0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, 0x0078, // 0010\n\t0x0079, 0x007a, 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, // 0018\n\t0x00e6, 0x00e7, 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, // 0020\n\t0x00ee, 0x00ef, 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, // 0028\n\t0x00f6, 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, // 0030\n\t0x0101, 0x0103, 0x0105, 0x0107, 0x0109, 0x010b, 0x010d, 0x010f, // 0038\n\t0x0111, 0x0113, 0x0115, 0x0117, 0x0119, 0x011b, 0x011d, 0x011f, // 0040\n\t0x0121, 0x0123, 0x0125, 0x0127, 0x0129, 0x012b, 0x012d, 0x012f, // 0048\n\t0x0133, 0x0135, 0x0137, 0x013a, 0x013c, 0x013e, 0x0140, 0x0142, // 0050\n\t0x0144, 0x0146, 0x0148, 0x014b, 0x014d, 0x014f, 0x0151, 0x0153, // 0058\n\t0x0155, 0x0157, 0x0159, 0x015b, 0x015d, 0x015f, 0x0161, 0x0163, // 0060\n\t0x0165, 0x0167, 0x0169, 0x016b, 0x016d, 0x016f, 0x0171, 0x0173, // 0068\n\t0x0175, 0x0177, 0x00ff, 0x017a, 0x017c, 0x017e, 0x0253, 0x0183, // 0070\n\t0x0185, 0x0254, 0x0188, 0x0256, 0x0257, 0x018c, 0x01dd, 0x0259, // 0078\n\t0x025b, 0x0192, 0x0260, 0x0263, 0x0269, 0x0268, 0x0199, 0x026f, // 0080\n\t0x0272, 0x0275, 0x01a1, 0x01a3, 0x01a5, 0x01a8, 0x0283, 0x01ad, // 0088\n\t0x0288, 0x01b0, 0x028a, 0x028b, 0x01b4, 0x01b6, 0x0292, 0x01b9, // 0090\n\t0x01bd, 0x01c6, 0x01c9, 0x01cc, 0x01ce, 0x01d0, 0x01d2, 0x01d4, // 0098\n\t0x01d6, 0x01d8, 0x01da, 0x01dc, 0x01df, 0x01e1, 0x01e3, 0x01e5, // 00a0\n\t0x01e7, 0x01e9, 0x01eb, 0x01ed, 0x01ef, 0x01f3, 0x01f5, 0x01fb, // 00a8\n\t0x01fd, 0x01ff, 0x0201, 0x0203, 0x0205, 0x0207, 0x0209, 0x020b, // 00b0\n\t0x020d, 0x020f, 0x0211, 0x0213, 0x0215, 0x0217, 0x03ac, 0x03ad, // 00b8\n\t0x03ae, 0x03af, 0x03cc, 0x03cd, 0x03ce, 0x03b1, 0x03b2, 0x03b3, // 00c0\n\t0x03b4, 0x03b5, 0x03b6, 0x03b7, 0x03b8, 0x03b9, 0x03ba, 0x03bb, // 00c8\n\t0x03bc, 0x03bd, 0x03be, 0x03bf, 0x03c0, 0x03c1, 0x03c3, 0x03c4, // 00d0\n\t0x03c5, 0x03c6, 0x03c7, 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03e3, // 00d8\n\t0x03e5, 0x03e7, 0x03e9, 0x03eb, 0x03ed, 0x03ef, 0x0451, 0x0452, // 00e0\n\t0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 0x0458, 0x0459, 0x045a, // 00e8\n\t0x045b, 0x045c, 0x045e, 0x045f, 0x0430, 0x0431, 0x0432, 0x0433, // 00f0\n\t0x0434, 0x0435, 0x0436, 0x0437, 0x0438, 0x0439, 0x043a, 0x043b, // 00f8\n\t0x043c, 0x043d, 0x043e, 0x043f, 0x0440, 0x0441, 0x0442, 0x0443, // 0100\n\t0x0444, 0x0445, 0x0446, 0x0447, 0x0448, 0x0449, 0x044a, 0x044b, // 0108\n\t0x044c, 0x044d, 0x044e, 0x044f, 0x0461, 0x0463, 0x0465, 0x0467, // 0110\n\t0x0469, 0x046b, 0x046d, 0x046f, 0x0471, 0x0473, 0x0475, 0x0477, // 0118\n\t0x0479, 0x047b, 0x047d, 0x047f, 0x0481, 0x0491, 0x0493, 0x0495, // 0120\n\t0x0497, 0x0499, 0x049b, 0x049d, 0x049f, 0x04a1, 0x04a3, 0x04a5, // 0128\n\t0x04a7, 0x04a9, 0x04ab, 0x04ad, 0x04af, 0x04b1, 0x04b3, 0x04b5, // 0130\n\t0x04b7, 0x04b9, 0x04bb, 0x04bd, 0x04bf, 0x04c2, 0x04c4, 0x04c8, // 0138\n\t0x04cc, 0x04d1, 0x04d3, 0x04d5, 0x04d7, 0x04d9, 0x04db, 0x04dd, // 0140\n\t0x04df, 0x04e1, 0x04e3, 0x04e5, 0x04e7, 0x04e9, 0x04eb, 0x04ef, // 0148\n\t0x04f1, 0x04f3, 0x04f5, 0x04f9, 0x0561, 0x0562, 0x0563, 0x0564, // 0150\n\t0x0565, 0x0566, 0x0567, 0x0568, 0x0569, 0x056a, 0x056b, 0x056c, // 0158\n\t0x056d, 0x056e, 0x056f, 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, // 0160\n\t0x0575, 0x0576, 0x0577, 0x0578, 0x0579, 0x057a, 0x057b, 0x057c, // 0168\n\t0x057d, 0x057e, 0x057f, 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, // 0170\n\t0x0585, 0x0586, 0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, // 0178\n\t0x10d6, 0x10d7, 0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10dd, // 0180\n\t0x10de, 0x10df, 0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10e4, 0x10e5, // 0188\n\t0x10e6, 0x10e7, 0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, // 0190\n\t0x10ee, 0x10ef, 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, // 0198\n\t0x1e01, 0x1e03, 0x1e05, 0x1e07, 0x1e09, 0x1e0b, 0x1e0d, 0x1e0f, // 01a0\n\t0x1e11, 0x1e13, 0x1e15, 0x1e17, 0x1e19, 0x1e1b, 0x1e1d, 0x1e1f, // 01a8\n\t0x1e21, 0x1e23, 0x1e25, 0x1e27, 0x1e29, 0x1e2b, 0x1e2d, 0x1e2f, // 01b0\n\t0x1e31, 0x1e33, 0x1e35, 0x1e37, 0x1e39, 0x1e3b, 0x1e3d, 0x1e3f, // 01b8\n\t0x1e41, 0x1e43, 0x1e45, 0x1e47, 0x1e49, 0x1e4b, 0x1e4d, 0x1e4f, // 01c0\n\t0x1e51, 0x1e53, 0x1e55, 0x1e57, 0x1e59, 0x1e5b, 0x1e5d, 0x1e5f, // 01c8\n\t0x1e61, 0x1e63, 0x1e65, 0x1e67, 0x1e69, 0x1e6b, 0x1e6d, 0x1e6f, // 01d0\n\t0x1e71, 0x1e73, 0x1e75, 0x1e77, 0x1e79, 0x1e7b, 0x1e7d, 0x1e7f, // 01d8\n\t0x1e81, 0x1e83, 0x1e85, 0x1e87, 0x1e89, 0x1e8b, 0x1e8d, 0x1e8f, // 01e0\n\t0x1e91, 0x1e93, 0x1e95, 0x1ea1, 0x1ea3, 0x1ea5, 0x1ea7, 0x1ea9, // 01e8\n\t0x1eab, 0x1ead, 0x1eaf, 0x1eb1, 0x1eb3, 0x1eb5, 0x1eb7, 0x1eb9, // 01f0\n\t0x1ebb, 0x1ebd, 0x1ebf, 0x1ec1, 0x1ec3, 0x1ec5, 0x1ec7, 0x1ec9, // 01f8\n\t0x1ecb, 0x1ecd, 0x1ecf, 0x1ed1, 0x1ed3, 0x1ed5, 0x1ed7, 0x1ed9, // 0200\n\t0x1edb, 0x1edd, 0x1edf, 0x1ee1, 0x1ee3, 0x1ee5, 0x1ee7, 0x1ee9, // 0208\n\t0x1eeb, 0x1eed, 0x1eef, 0x1ef1, 0x1ef3, 0x1ef5, 0x1ef7, 0x1ef9, // 0210\n\t0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07, // 0218\n\t0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0x1f20, 0x1f21, // 0220\n\t0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27, 0x1f30, 0x1f31, // 0228\n\t0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37, 0x1f40, 0x1f41, // 0230\n\t0x1f42, 0x1f43, 0x1f44, 0x1f45, 0x1f51, 0x1f53, 0x1f55, 0x1f57, // 0238\n\t0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67, // 0240\n\t0x1fb0, 0x1fb1, 0x1f70, 0x1f71, 0x1f72, 0x1f73, 0x1f74, 0x1f75, // 0248\n\t0x1fd0, 0x1fd1, 0x1f76, 0x1f77, 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, // 0250\n\t0x1fe5, 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, 0x2170, 0x2171, 0x2172, // 0258\n\t0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217a, // 0260\n\t0x217b, 0x217c, 0x217d, 0x217e, 0x217f, 0x24d0, 0x24d1, 0x24d2, // 0268\n\t0x24d3, 0x24d4, 0x24d5, 0x24d6, 0x24d7, 0x24d8, 0x24d9, 0x24da, // 0270\n\t0x24db, 0x24dc, 0x24dd, 0x24de, 0x24df, 0x24e0, 0x24e1, 0x24e2, // 0278\n\t0x24e3, 0x24e4, 0x24e5, 0x24e6, 0x24e7, 0x24e8, 0x24e9, 0xff41, // 0280\n\t0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47, 0xff48, 0xff49, // 0288\n\t0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f, 0xff50, 0xff51, // 0290\n\t0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57, 0xff58, 0xff59, // 0298\n\t0xff5a, 0xffff\n};\n\nstatic unsigned short UC_CaseUpper[] = {\n\t0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, // 0000\n\t0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, // 0008\n\t0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, // 0010\n\t0x0059, 0x005a, 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, // 0018\n\t0x00c6, 0x00c7, 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, // 0020\n\t0x00ce, 0x00cf, 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, // 0028\n\t0x00d6, 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, // 0030\n\t0x0100, 0x0102, 0x0104, 0x0106, 0x0108, 0x010a, 0x010c, 0x010e, // 0038\n\t0x0110, 0x0112, 0x0114, 0x0116, 0x0118, 0x011a, 0x011c, 0x011e, // 0040\n\t0x0120, 0x0122, 0x0124, 0x0126, 0x0128, 0x012a, 0x012c, 0x012e, // 0048\n\t0x0132, 0x0134, 0x0136, 0x0139, 0x013b, 0x013d, 0x013f, 0x0141, // 0050\n\t0x0143, 0x0145, 0x0147, 0x014a, 0x014c, 0x014e, 0x0150, 0x0152, // 0058\n\t0x0154, 0x0156, 0x0158, 0x015a, 0x015c, 0x015e, 0x0160, 0x0162, // 0060\n\t0x0164, 0x0166, 0x0168, 0x016a, 0x016c, 0x016e, 0x0170, 0x0172, // 0068\n\t0x0174, 0x0176, 0x0178, 0x0179, 0x017b, 0x017d, 0x0181, 0x0182, // 0070\n\t0x0184, 0x0186, 0x0187, 0x0189, 0x018a, 0x018b, 0x018e, 0x018f, // 0078\n\t0x0190, 0x0191, 0x0193, 0x0194, 0x0196, 0x0197, 0x0198, 0x019c, // 0080\n\t0x019d, 0x019f, 0x01a0, 0x01a2, 0x01a4, 0x01a7, 0x01a9, 0x01ac, // 0088\n\t0x01ae, 0x01af, 0x01b1, 0x01b2, 0x01b3, 0x01b5, 0x01b7, 0x01b8, // 0090\n\t0x01bc, 0x01c4, 0x01c7, 0x01ca, 0x01cd, 0x01cf, 0x01d1, 0x01d3, // 0098\n\t0x01d5, 0x01d7, 0x01d9, 0x01db, 0x01de, 0x01e0, 0x01e2, 0x01e4, // 00a0\n\t0x01e6, 0x01e8, 0x01ea, 0x01ec, 0x01ee, 0x01f1, 0x01f4, 0x01fa, // 00a8\n\t0x01fc, 0x01fe, 0x0200, 0x0202, 0x0204, 0x0206, 0x0208, 0x020a, // 00b0\n\t0x020c, 0x020e, 0x0210, 0x0212, 0x0214, 0x0216, 0x0386, 0x0388, // 00b8\n\t0x0389, 0x038a, 0x038c, 0x038e, 0x038f, 0x0391, 0x0392, 0x0393, // 00c0\n\t0x0394, 0x0395, 0x0396, 0x0397, 0x0398, 0x0399, 0x039a, 0x039b, // 00c8\n\t0x039c, 0x039d, 0x039e, 0x039f, 0x03a0, 0x03a1, 0x03a3, 0x03a4, // 00d0\n\t0x03a5, 0x03a6, 0x03a7, 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03e2, // 00d8\n\t0x03e4, 0x03e6, 0x03e8, 0x03ea, 0x03ec, 0x03ee, 0x0401, 0x0402, // 00e0\n\t0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040a, // 00e8\n\t0x040b, 0x040c, 0x040e, 0x040f, 0x0410, 0x0411, 0x0412, 0x0413, // 00f0\n\t0x0414, 0x0415, 0x0416, 0x0417, 0x0418, 0x0419, 0x041a, 0x041b, // 00f8\n\t0x041c, 0x041d, 0x041e, 0x041f, 0x0420, 0x0421, 0x0422, 0x0423, // 0100\n\t0x0424, 0x0425, 0x0426, 0x0427, 0x0428, 0x0429, 0x042a, 0x042b, // 0108\n\t0x042c, 0x042d, 0x042e, 0x042f, 0x0460, 0x0462, 0x0464, 0x0466, // 0110\n\t0x0468, 0x046a, 0x046c, 0x046e, 0x0470, 0x0472, 0x0474, 0x0476, // 0118\n\t0x0478, 0x047a, 0x047c, 0x047e, 0x0480, 0x0490, 0x0492, 0x0494, // 0120\n\t0x0496, 0x0498, 0x049a, 0x049c, 0x049e, 0x04a0, 0x04a2, 0x04a4, // 0128\n\t0x04a6, 0x04a8, 0x04aa, 0x04ac, 0x04ae, 0x04b0, 0x04b2, 0x04b4, // 0130\n\t0x04b6, 0x04b8, 0x04ba, 0x04bc, 0x04be, 0x04c1, 0x04c3, 0x04c7, // 0138\n\t0x04cb, 0x04d0, 0x04d2, 0x04d4, 0x04d6, 0x04d8, 0x04da, 0x04dc, // 0140\n\t0x04de, 0x04e0, 0x04e2, 0x04e4, 0x04e6, 0x04e8, 0x04ea, 0x04ee, // 0148\n\t0x04f0, 0x04f2, 0x04f4, 0x04f8, 0x0531, 0x0532, 0x0533, 0x0534, // 0150\n\t0x0535, 0x0536, 0x0537, 0x0538, 0x0539, 0x053a, 0x053b, 0x053c, // 0158\n\t0x053d, 0x053e, 0x053f, 0x0540, 0x0541, 0x0542, 0x0543, 0x0544, // 0160\n\t0x0545, 0x0546, 0x0547, 0x0548, 0x0549, 0x054a, 0x054b, 0x054c, // 0168\n\t0x054d, 0x054e, 0x054f, 0x0550, 0x0551, 0x0552, 0x0553, 0x0554, // 0170\n\t0x0555, 0x0556, 0x10a0, 0x10a1, 0x10a2, 0x10a3, 0x10a4, 0x10a5, // 0178\n\t0x10a6, 0x10a7, 0x10a8, 0x10a9, 0x10aa, 0x10ab, 0x10ac, 0x10ad, // 0180\n\t0x10ae, 0x10af, 0x10b0, 0x10b1, 0x10b2, 0x10b3, 0x10b4, 0x10b5, // 0188\n\t0x10b6, 0x10b7, 0x10b8, 0x10b9, 0x10ba, 0x10bb, 0x10bc, 0x10bd, // 0190\n\t0x10be, 0x10bf, 0x10c0, 0x10c1, 0x10c2, 0x10c3, 0x10c4, 0x10c5, // 0198\n\t0x1e00, 0x1e02, 0x1e04, 0x1e06, 0x1e08, 0x1e0a, 0x1e0c, 0x1e0e, // 01a0\n\t0x1e10, 0x1e12, 0x1e14, 0x1e16, 0x1e18, 0x1e1a, 0x1e1c, 0x1e1e, // 01a8\n\t0x1e20, 0x1e22, 0x1e24, 0x1e26, 0x1e28, 0x1e2a, 0x1e2c, 0x1e2e, // 01b0\n\t0x1e30, 0x1e32, 0x1e34, 0x1e36, 0x1e38, 0x1e3a, 0x1e3c, 0x1e3e, // 01b8\n\t0x1e40, 0x1e42, 0x1e44, 0x1e46, 0x1e48, 0x1e4a, 0x1e4c, 0x1e4e, // 01c0\n\t0x1e50, 0x1e52, 0x1e54, 0x1e56, 0x1e58, 0x1e5a, 0x1e5c, 0x1e5e, // 01c8\n\t0x1e60, 0x1e62, 0x1e64, 0x1e66, 0x1e68, 0x1e6a, 0x1e6c, 0x1e6e, // 01d0\n\t0x1e70, 0x1e72, 0x1e74, 0x1e76, 0x1e78, 0x1e7a, 0x1e7c, 0x1e7e, // 01d8\n\t0x1e80, 0x1e82, 0x1e84, 0x1e86, 0x1e88, 0x1e8a, 0x1e8c, 0x1e8e, // 01e0\n\t0x1e90, 0x1e92, 0x1e94, 0x1ea0, 0x1ea2, 0x1ea4, 0x1ea6, 0x1ea8, // 01e8\n\t0x1eaa, 0x1eac, 0x1eae, 0x1eb0, 0x1eb2, 0x1eb4, 0x1eb6, 0x1eb8, // 01f0\n\t0x1eba, 0x1ebc, 0x1ebe, 0x1ec0, 0x1ec2, 0x1ec4, 0x1ec6, 0x1ec8, // 01f8\n\t0x1eca, 0x1ecc, 0x1ece, 0x1ed0, 0x1ed2, 0x1ed4, 0x1ed6, 0x1ed8, // 0200\n\t0x1eda, 0x1edc, 0x1ede, 0x1ee0, 0x1ee2, 0x1ee4, 0x1ee6, 0x1ee8, // 0208\n\t0x1eea, 0x1eec, 0x1eee, 0x1ef0, 0x1ef2, 0x1ef4, 0x1ef6, 0x1ef8, // 0210\n\t0x1f08, 0x1f09, 0x1f0a, 0x1f0b, 0x1f0c, 0x1f0d, 0x1f0e, 0x1f0f, // 0218\n\t0x1f18, 0x1f19, 0x1f1a, 0x1f1b, 0x1f1c, 0x1f1d, 0x1f28, 0x1f29, // 0220\n\t0x1f2a, 0x1f2b, 0x1f2c, 0x1f2d, 0x1f2e, 0x1f2f, 0x1f38, 0x1f39, // 0228\n\t0x1f3a, 0x1f3b, 0x1f3c, 0x1f3d, 0x1f3e, 0x1f3f, 0x1f48, 0x1f49, // 0230\n\t0x1f4a, 0x1f4b, 0x1f4c, 0x1f4d, 0x1f59, 0x1f5b, 0x1f5d, 0x1f5f, // 0238\n\t0x1f68, 0x1f69, 0x1f6a, 0x1f6b, 0x1f6c, 0x1f6d, 0x1f6e, 0x1f6f, // 0240\n\t0x1fb8, 0x1fb9, 0x1fba, 0x1fbb, 0x1fc8, 0x1fc9, 0x1fca, 0x1fcb, // 0248\n\t0x1fd8, 0x1fd9, 0x1fda, 0x1fdb, 0x1fe8, 0x1fe9, 0x1fea, 0x1feb, // 0250\n\t0x1fec, 0x1ff8, 0x1ff9, 0x1ffa, 0x1ffb, 0x2160, 0x2161, 0x2162, // 0258\n\t0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216a, // 0260\n\t0x216b, 0x216c, 0x216d, 0x216e, 0x216f, 0x24b6, 0x24b7, 0x24b8, // 0268\n\t0x24b9, 0x24ba, 0x24bb, 0x24bc, 0x24bd, 0x24be, 0x24bf, 0x24c0, // 0270\n\t0x24c1, 0x24c2, 0x24c3, 0x24c4, 0x24c5, 0x24c6, 0x24c7, 0x24c8, // 0278\n\t0x24c9, 0x24ca, 0x24cb, 0x24cc, 0x24cd, 0x24ce, 0x24cf, 0xff21, // 0280\n\t0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27, 0xff28, 0xff29, // 0288\n\t0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f, 0xff30, 0xff31, // 0290\n\t0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37, 0xff38, 0xff39, // 0298\n\t0xff3a, 0xffff\n};\n\n"
  },
  {
    "path": "dna/System.Char.UC_IndexRuns.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nstatic unsigned short UC_Index[] = {\n\t0x0000, 0x000e, 0x0020, 0x8000, 0x0030, 0x0008, 0x003a, 0x8010, // 0000\n\t0x0041, 0x0000, 0x005b, 0x8017, 0x0061, 0x0001, 0x007b, 0x801d, // 0004\n\t0x007f, 0x000e, 0x00a0, 0x8021, 0x00c0, 0x0000, 0x00d7, 0x800b, // 0008\n\t0x00d8, 0x0000, 0x00df, 0x0001, 0x00f7, 0x800b, 0x00f8, 0x0001, // 000c\n\t0x0100, 0x8041, 0x0234, 0x001d, 0x0250, 0x0001, 0x02ae, 0x8161, // 0010\n\t0x02b0, 0x0003, 0x02b9, 0x8175, 0x02bb, 0x0003, 0x02c2, 0x001b, // 0014\n\t0x02d0, 0x8177, 0x02d2, 0x001b, 0x02e0, 0x0003, 0x02e5, 0x001b, // 0018\n\t0x02ee, 0x8177, 0x02ef, 0x001d, 0x0300, 0x0005, 0x034f, 0x001d, // 001c\n\t0x0360, 0x8179, 0x0363, 0x001d, 0x0374, 0x817c, 0x037f, 0x001d, // 0020\n\t0x0384, 0x8187, 0x0391, 0x0000, 0x03a2, 0x8161, 0x03a3, 0x0000, // 0024\n\t0x03ac, 0x0001, 0x03cf, 0x8194, 0x03ef, 0x0001, 0x03f4, 0x001d, // 0028\n\t0x0400, 0x0000, 0x0430, 0x0001, 0x0460, 0x81b4, 0x04fa, 0x001d, // 002c\n\t0x0531, 0x0000, 0x0557, 0x8180, 0x055a, 0x0018, 0x0560, 0x8161, // 0030\n\t0x0561, 0x0001, 0x0588, 0x824e, 0x058b, 0x001d, 0x0591, 0x0005, // 0034\n\t0x05a2, 0x8161, 0x05a3, 0x0005, 0x05ba, 0x8251, 0x05c5, 0x001d, // 0038\n\t0x05d0, 0x0004, 0x05eb, 0x001d, 0x05f0, 0x825c, 0x05f5, 0x001d, // 003c\n\t0x060c, 0x8001, 0x060d, 0x001d, 0x061b, 0x8261, 0x0621, 0x0004, // 0040\n\t0x063b, 0x001d, 0x0640, 0x8177, 0x0641, 0x0004, 0x064b, 0x0005, // 0044\n\t0x0656, 0x001d, 0x0660, 0x0008, 0x066a, 0x8267, 0x0671, 0x0004, // 0048\n\t0x06d4, 0x826e, 0x06d6, 0x0005, 0x06dd, 0x81dc, 0x06df, 0x0005, // 004c\n\t0x06e5, 0x8270, 0x06f0, 0x0008, 0x06fa, 0x827b, 0x0700, 0x0018, // 0050\n\t0x070e, 0x8281, 0x0712, 0x0004, 0x072d, 0x817e, 0x0730, 0x0005, // 0054\n\t0x074b, 0x001d, 0x0780, 0x0004, 0x07a6, 0x0005, 0x07b1, 0x001d, // 0058\n\t0x0901, 0x8285, 0x0905, 0x0004, 0x093a, 0x8289, 0x0941, 0x0005, // 005c\n\t0x0949, 0x8290, 0x0958, 0x0004, 0x0962, 0x829f, 0x0966, 0x0008, // 0060\n\t0x0970, 0x8001, 0x0971, 0x001d, 0x0981, 0x82a3, 0x0985, 0x0004, // 0064\n\t0x098d, 0x82a7, 0x0993, 0x0004, 0x09a9, 0x8161, 0x09aa, 0x0004, // 0068\n\t0x09b1, 0x82ad, 0x09ce, 0x001d, 0x09d7, 0x82ca, 0x09e6, 0x0008, // 006c\n\t0x09f0, 0x82d9, 0x09f4, 0x000a, 0x09fa, 0x8027, 0x09fb, 0x001d, // 0070\n\t0x0a02, 0x8278, 0x0a05, 0x0004, 0x0a0b, 0x82dd, 0x0a13, 0x0004, // 0074\n\t0x0a29, 0x8161, 0x0a2a, 0x0004, 0x0a31, 0x82e5, 0x0a4e, 0x001d, // 0078\n\t0x0a59, 0x8302, 0x0a5f, 0x001d, 0x0a66, 0x0008, 0x0a70, 0x8300, // 007c\n\t0x0a75, 0x001d, 0x0a81, 0x8285, 0x0a85, 0x0004, 0x0a8c, 0x8308, // 0080\n\t0x0a93, 0x0004, 0x0aa9, 0x8161, 0x0aaa, 0x0004, 0x0ab1, 0x82a8, // 0084\n\t0x0ab5, 0x0004, 0x0aba, 0x8289, 0x0ac1, 0x0005, 0x0ac6, 0x830f, // 0088\n\t0x0ad1, 0x001d, 0x0ae0, 0x80fc, 0x0ae1, 0x001d, 0x0ae6, 0x0008, // 008c\n\t0x0af0, 0x001d, 0x0b01, 0x82a3, 0x0b05, 0x0004, 0x0b0d, 0x82a7, // 0090\n\t0x0b13, 0x0004, 0x0b29, 0x8161, 0x0b2a, 0x0004, 0x0b31, 0x831a, // 0094\n\t0x0b4e, 0x001d, 0x0b56, 0x8337, 0x0b66, 0x0008, 0x0b70, 0x8027, // 0098\n\t0x0b71, 0x001d, 0x0b82, 0x8286, 0x0b85, 0x0004, 0x0b8b, 0x8347, // 009c\n\t0x0bae, 0x0004, 0x0bb6, 0x836a, 0x0bce, 0x001d, 0x0bd7, 0x8287, // 00a0\n\t0x0bd8, 0x001d, 0x0be7, 0x0008, 0x0bf0, 0x803d, 0x0bf3, 0x001d, // 00a4\n\t0x0c01, 0x837a, 0x0c05, 0x0004, 0x0c0d, 0x830a, 0x0c12, 0x0004, // 00a8\n\t0x0c29, 0x8161, 0x0c2a, 0x0004, 0x0c34, 0x8161, 0x0c35, 0x0004, // 00ac\n\t0x0c3a, 0x8382, 0x0c4e, 0x001d, 0x0c55, 0x8179, 0x0c57, 0x001d, // 00b0\n\t0x0c60, 0x8341, 0x0c66, 0x0008, 0x0c70, 0x001d, 0x0c82, 0x82a4, // 00b4\n\t0x0c85, 0x0004, 0x0c8d, 0x830a, 0x0c92, 0x0004, 0x0ca9, 0x8161, // 00b8\n\t0x0caa, 0x0004, 0x0cb4, 0x8161, 0x0cb5, 0x0004, 0x0cba, 0x8396, // 00bc\n\t0x0cc0, 0x0006, 0x0cc5, 0x839c, 0x0cce, 0x001d, 0x0cd5, 0x828d, // 00c0\n\t0x0cd7, 0x001d, 0x0cde, 0x83a5, 0x0ce6, 0x0008, 0x0cf0, 0x001d, // 00c4\n\t0x0d02, 0x82a4, 0x0d05, 0x0004, 0x0d0d, 0x830a, 0x0d12, 0x0004, // 00c8\n\t0x0d29, 0x8161, 0x0d2a, 0x0004, 0x0d3a, 0x83ad, 0x0d4e, 0x001d, // 00cc\n\t0x0d57, 0x8287, 0x0d58, 0x001d, 0x0d60, 0x8341, 0x0d66, 0x0008, // 00d0\n\t0x0d70, 0x001d, 0x0d82, 0x82a4, 0x0d85, 0x0004, 0x0d97, 0x817e, // 00d4\n\t0x0d9a, 0x0004, 0x0db2, 0x8161, 0x0db3, 0x0004, 0x0dbc, 0x82ad, // 00d8\n\t0x0dc0, 0x0004, 0x0dc7, 0x83c1, 0x0dd8, 0x0006, 0x0de0, 0x001d, // 00dc\n\t0x0df2, 0x83d2, 0x0df5, 0x001d, 0x0e01, 0x0004, 0x0e31, 0x825b, // 00e0\n\t0x0e34, 0x0005, 0x0e3b, 0x83d5, 0x0e40, 0x0004, 0x0e46, 0x8177, // 00e4\n\t0x0e47, 0x0005, 0x0e4f, 0x8001, 0x0e50, 0x0008, 0x0e5a, 0x8001, // 00e8\n\t0x0e5c, 0x001d, 0x0e81, 0x83da, 0x0e8e, 0x001d, 0x0e94, 0x82b2, // 00ec\n\t0x0e99, 0x0004, 0x0ea0, 0x83e7, 0x0eb4, 0x0005, 0x0eba, 0x83fb, // 00f0\n\t0x0ec0, 0x0004, 0x0ec5, 0x8181, 0x0ec8, 0x0005, 0x0ece, 0x8161, // 00f4\n\t0x0ed0, 0x0008, 0x0eda, 0x8279, 0x0ede, 0x001d, 0x0f00, 0x8401, // 00f8\n\t0x0f04, 0x0018, 0x0f13, 0x001c, 0x0f18, 0x8179, 0x0f1a, 0x001c, // 00fc\n\t0x0f20, 0x0008, 0x0f2a, 0x000a, 0x0f34, 0x8405, 0x0f40, 0x0004, // 0100\n\t0x0f48, 0x8161, 0x0f49, 0x0004, 0x0f6b, 0x001d, 0x0f71, 0x0005, // 0104\n\t0x0f7f, 0x8287, 0x0f80, 0x0005, 0x0f85, 0x8411, 0x0f90, 0x0005, // 0108\n\t0x0f98, 0x8161, 0x0f99, 0x0005, 0x0fbd, 0x8161, 0x0fbe, 0x001c, // 010c\n\t0x0fc6, 0x8179, 0x0fc7, 0x001c, 0x0fcd, 0x841c, 0x0fd0, 0x001d, // 0110\n\t0x1000, 0x0004, 0x1022, 0x8161, 0x1023, 0x0004, 0x1028, 0x841f, // 0114\n\t0x103a, 0x001d, 0x1040, 0x0008, 0x104a, 0x0018, 0x1050, 0x0004, // 0118\n\t0x1056, 0x82bb, 0x105a, 0x001d, 0x10a0, 0x0000, 0x10c6, 0x001d, // 011c\n\t0x10d0, 0x0004, 0x10f7, 0x8431, 0x1100, 0x0004, 0x115a, 0x001d, // 0120\n\t0x115f, 0x0004, 0x11a3, 0x001d, 0x11a8, 0x0004, 0x11fa, 0x001d, // 0124\n\t0x1200, 0x0004, 0x1207, 0x8161, 0x1208, 0x0004, 0x1247, 0x843a, // 0128\n\t0x1250, 0x0004, 0x1257, 0x8443, 0x1260, 0x0004, 0x1287, 0x843a, // 012c\n\t0x1290, 0x0004, 0x12af, 0x843a, 0x12b8, 0x0004, 0x12bf, 0x843a, // 0130\n\t0x12c8, 0x0004, 0x12cf, 0x8161, 0x12d0, 0x0004, 0x12d7, 0x8161, // 0134\n\t0x12d8, 0x0004, 0x12ef, 0x8161, 0x12f0, 0x0004, 0x130f, 0x843a, // 0138\n\t0x1318, 0x0004, 0x131f, 0x8161, 0x1320, 0x0004, 0x1347, 0x8161, // 013c\n\t0x1348, 0x0004, 0x135b, 0x001d, 0x1361, 0x0018, 0x1369, 0x0008, // 0140\n\t0x1372, 0x000a, 0x137d, 0x001d, 0x13a0, 0x0004, 0x13f5, 0x001d, // 0144\n\t0x1401, 0x0004, 0x166d, 0x8001, 0x166f, 0x0004, 0x1677, 0x001d, // 0148\n\t0x1680, 0x8000, 0x1681, 0x0004, 0x169b, 0x844c, 0x16a0, 0x0004, // 014c\n\t0x16eb, 0x8451, 0x16f1, 0x001d, 0x1780, 0x0004, 0x17b4, 0x828d, // 0150\n\t0x17b7, 0x0005, 0x17be, 0x0006, 0x17c6, 0x82a3, 0x17c9, 0x0005, // 0154\n\t0x17d4, 0x0018, 0x17db, 0x8457, 0x17e0, 0x0008, 0x17ea, 0x001d, // 0158\n\t0x1800, 0x0018, 0x1806, 0x845c, 0x1810, 0x0008, 0x181a, 0x001d, // 015c\n\t0x1820, 0x0004, 0x1843, 0x8177, 0x1844, 0x0004, 0x1878, 0x001d, // 0160\n\t0x1880, 0x0004, 0x18a9, 0x8179, 0x18aa, 0x001d, 0x1e00, 0x8466, // 0164\n\t0x1e95, 0x0001, 0x1e9c, 0x84fb, 0x1efa, 0x001d, 0x1f00, 0x0001, // 0168\n\t0x1f08, 0x0000, 0x1f10, 0x0001, 0x1f16, 0x8161, 0x1f18, 0x0000, // 016c\n\t0x1f1e, 0x8161, 0x1f20, 0x0001, 0x1f28, 0x0000, 0x1f30, 0x0001, // 0170\n\t0x1f38, 0x0000, 0x1f40, 0x0001, 0x1f46, 0x8161, 0x1f48, 0x0000, // 0174\n\t0x1f4e, 0x8161, 0x1f50, 0x0001, 0x1f58, 0x8559, 0x1f60, 0x0001, // 0178\n\t0x1f68, 0x0000, 0x1f70, 0x0001, 0x1f7e, 0x8161, 0x1f80, 0x0001, // 017c\n\t0x1f88, 0x0002, 0x1f90, 0x0001, 0x1f98, 0x0002, 0x1fa0, 0x0001, // 0180\n\t0x1fa8, 0x0002, 0x1fb0, 0x0001, 0x1fb5, 0x8561, 0x1fe0, 0x0001, // 0184\n\t0x1fe8, 0x0000, 0x1fed, 0x858c, 0x2000, 0x000b, 0x200c, 0x8461, // 0188\n\t0x2010, 0x0013, 0x2016, 0x859f, 0x2020, 0x0018, 0x2028, 0x85a9, // 018c\n\t0x202a, 0x000f, 0x202f, 0x8000, 0x2030, 0x0018, 0x2039, 0x85ab, // 0190\n\t0x2048, 0x0018, 0x204e, 0x001d, 0x206a, 0x000f, 0x2070, 0x85ba, // 0194\n\t0x2074, 0x000a, 0x207a, 0x85be, 0x2080, 0x000a, 0x208a, 0x85be, // 0198\n\t0x208f, 0x001d, 0x20a0, 0x001a, 0x20b0, 0x001d, 0x20d0, 0x0005, // 019c\n\t0x20dd, 0x85c4, 0x20e4, 0x001d, 0x2100, 0x85cb, 0x2119, 0x0000, // 01a0\n\t0x211e, 0x001c, 0x2124, 0x85e4, 0x213b, 0x001d, 0x2153, 0x000a, // 01a4\n\t0x2160, 0x0009, 0x2184, 0x001d, 0x2190, 0x0019, 0x2195, 0x001c, // 01a8\n\t0x219a, 0x85fb, 0x21a7, 0x001c, 0x21ae, 0x800b, 0x21af, 0x001c, // 01ac\n\t0x21ce, 0x8608, 0x21d5, 0x001c, 0x21f4, 0x001d, 0x2200, 0x0019, // 01b0\n\t0x22f2, 0x001d, 0x2300, 0x001c, 0x2308, 0x860f, 0x230c, 0x001c, // 01b4\n\t0x2320, 0x8012, 0x2322, 0x001c, 0x2329, 0x8008, 0x232b, 0x001c, // 01b8\n\t0x237c, 0x8161, 0x237d, 0x001c, 0x239b, 0x001d, 0x2400, 0x001c, // 01bc\n\t0x2427, 0x001d, 0x2440, 0x001c, 0x244b, 0x001d, 0x2460, 0x000a, // 01c0\n\t0x249c, 0x001c, 0x24ea, 0x8033, 0x24eb, 0x001d, 0x2500, 0x001c, // 01c4\n\t0x2596, 0x001d, 0x25a0, 0x001c, 0x25b7, 0x800b, 0x25b8, 0x001c, // 01c8\n\t0x25c1, 0x800b, 0x25c2, 0x001c, 0x25f8, 0x001d, 0x2600, 0x001c, // 01cc\n\t0x2614, 0x001d, 0x2619, 0x001c, 0x266f, 0x85fc, 0x2672, 0x001d, // 01d0\n\t0x2701, 0x8613, 0x270c, 0x001c, 0x2728, 0x8161, 0x2729, 0x001c, // 01d4\n\t0x274c, 0x861e, 0x2758, 0x001c, 0x275f, 0x8161, 0x2761, 0x001c, // 01d8\n\t0x2768, 0x001d, 0x2776, 0x000a, 0x2794, 0x861b, 0x2798, 0x001c, // 01dc\n\t0x27b0, 0x8161, 0x27b1, 0x001c, 0x27bf, 0x001d, 0x2800, 0x001c, // 01e0\n\t0x2900, 0x001d, 0x2e80, 0x001c, 0x2e9a, 0x8161, 0x2e9b, 0x001c, // 01e4\n\t0x2ef4, 0x001d, 0x2f00, 0x001c, 0x2fd6, 0x001d, 0x2ff0, 0x001c, // 01e8\n\t0x2ffc, 0x862a, 0x3021, 0x0009, 0x302a, 0x0005, 0x3030, 0x800d, // 01ec\n\t0x3031, 0x0003, 0x3036, 0x864f, 0x3041, 0x0004, 0x3095, 0x865a, // 01f0\n\t0x30a1, 0x0004, 0x30fb, 0x8666, 0x30ff, 0x001d, 0x3105, 0x0004, // 01f4\n\t0x312d, 0x817e, 0x3131, 0x0004, 0x318f, 0x866a, 0x3196, 0x001c, // 01f8\n\t0x31a0, 0x0004, 0x31b8, 0x001d, 0x3200, 0x001c, 0x321d, 0x817e, // 01fc\n\t0x3220, 0x000a, 0x322a, 0x001c, 0x3244, 0x001d, 0x3260, 0x001c, // 0200\n\t0x327c, 0x841b, 0x3280, 0x000a, 0x328a, 0x001c, 0x32b1, 0x001d, // 0204\n\t0x32c0, 0x001c, 0x32cc, 0x817e, 0x32d0, 0x001c, 0x32ff, 0x8161, // 0208\n\t0x3300, 0x001c, 0x3377, 0x817e, 0x337b, 0x001c, 0x33de, 0x8161, // 020c\n\t0x33e0, 0x001c, 0x33ff, 0x8161, 0x3400, 0x0004, 0x4db6, 0x001d, // 0210\n\t0x4e00, 0x0004, 0x9fa6, 0x001d, 0xa000, 0x0004, 0xa48d, 0x817e, // 0214\n\t0xa490, 0x001c, 0xa4a2, 0x8161, 0xa4a4, 0x001c, 0xa4b4, 0x8161, // 0218\n\t0xa4b5, 0x001c, 0xa4c1, 0x8671, 0xa4c7, 0x001d, 0xac00, 0x0004, // 021c\n\t0xd7a4, 0x001d, 0xd800, 0x0010, 0xe000, 0x0011, 0xf900, 0x0004, // 0220\n\t0xfa2e, 0x001d, 0xfb00, 0x0001, 0xfb07, 0x001d, 0xfb13, 0x0001, // 0224\n\t0xfb18, 0x001d, 0xfb1d, 0x8283, 0xfb1f, 0x0004, 0xfb29, 0x800b, // 0228\n\t0xfb2a, 0x0004, 0xfb37, 0x8161, 0xfb38, 0x0004, 0xfb3d, 0x8677, // 022c\n\t0xfb46, 0x0004, 0xfbb2, 0x001d, 0xfbd3, 0x0004, 0xfd3e, 0x8008, // 0230\n\t0xfd40, 0x001d, 0xfd50, 0x0004, 0xfd90, 0x8161, 0xfd92, 0x0004, // 0234\n\t0xfdc8, 0x001d, 0xfdf0, 0x0004, 0xfdfc, 0x001d, 0xfe20, 0x81d7, // 0238\n\t0xfe24, 0x001d, 0xfe30, 0x8680, 0xfe76, 0x0004, 0xfefd, 0x86c6, // 023c\n\t0xff10, 0x0008, 0xff1a, 0x8010, 0xff21, 0x0000, 0xff3b, 0x8017, // 0240\n\t0xff41, 0x0001, 0xff5b, 0x86d9, 0xff66, 0x0004, 0xff70, 0x8177, // 0244\n\t0xff71, 0x0004, 0xff9e, 0x8177, 0xffa0, 0x0004, 0xffbf, 0x817e, // 0248\n\t0xffc2, 0x0004, 0xffc8, 0x8161, 0xffca, 0x0004, 0xffd0, 0x8161, // 024c\n\t0xffd2, 0x0004, 0xffd8, 0x86e4, 0xffef, 0x001d, 0xfff9, 0x86fb, // 0250\n\t0xffff, 0x0000\n};\n\nstatic unsigned char UC_Runs[] = {\n\t0x0b, 0x18, 0x18, 0x18, 0x1a, 0x18, 0x18, 0x18, 0x14, 0x15, 0x18, 0x19, 0x18, 0x13, 0x18, 0x18, // 0000\n\t0x18, 0x18, 0x19, 0x19, 0x19, 0x18, 0x18, 0x14, 0x18, 0x15, 0x1b, 0x12, 0x1b, 0x14, 0x19, 0x15, // 0010\n\t0x19, 0x0b, 0x18, 0x1a, 0x1a, 0x1a, 0x1a, 0x1c, 0x1c, 0x1b, 0x1c, 0x01, 0x16, 0x19, 0x13, 0x1c, // 0020\n\t0x1b, 0x1c, 0x19, 0x0a, 0x0a, 0x1b, 0x01, 0x1c, 0x18, 0x1b, 0x0a, 0x01, 0x17, 0x0a, 0x0a, 0x0a, // 0030\n\t0x18, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0040\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0050\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0060\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 0070\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0080\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0090\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 00a0\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 00b0\n\t0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, // 00c0\n\t0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, // 00d0\n\t0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, // 00e0\n\t0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x04, 0x00, 0x01, 0x01, // 00f0\n\t0x01, 0x04, 0x04, 0x04, 0x04, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x02, 0x01, 0x00, 0x01, // 0100\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, // 0110\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0120\n\t0x01, 0x01, 0x00, 0x02, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0130\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0140\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0150\n\t0x01, 0x1d, 0x1d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0160\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x1b, 0x1b, 0x03, 0x03, 0x05, 0x05, 0x05, 0x1b, 0x1b, 0x1d, 0x1d, // 0170\n\t0x1d, 0x1d, 0x03, 0x1d, 0x1d, 0x1d, 0x18, 0x1b, 0x1b, 0x00, 0x18, 0x00, 0x00, 0x00, 0x1d, 0x00, // 0180\n\t0x1d, 0x00, 0x00, 0x01, 0x1d, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x1d, 0x1d, 0x00, // 0190\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 01a0\n\t0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 01b0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 01c0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x1c, 0x05, 0x05, 0x05, 0x05, 0x1d, 0x07, 0x07, 0x1d, 0x1d, // 01d0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 01e0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 01f0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 0200\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x1d, 0x1d, 0x00, 0x01, 0x1d, 0x1d, 0x00, // 0210\n\t0x01, 0x1d, 0x1d, 0x1d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 0220\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 0230\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x1d, 0x1d, 0x00, 0x01, 0x1d, 0x18, // 0240\n\t0x13, 0x1d, 0x05, 0x05, 0x05, 0x18, 0x05, 0x18, 0x05, 0x05, 0x18, 0x05, 0x04, 0x04, 0x04, 0x18, // 0250\n\t0x18, 0x18, 0x1d, 0x1d, 0x1d, 0x18, 0x1d, 0x18, 0x18, 0x18, 0x18, 0x1d, 0x1d, 0x05, 0x18, 0x04, // 0260\n\t0x03, 0x03, 0x05, 0x05, 0x1c, 0x05, 0x05, 0x05, 0x05, 0x1d, 0x1d, 0x04, 0x04, 0x04, 0x1c, 0x1c, // 0270\n\t0x1d, 0x1d, 0x0f, 0x04, 0x05, 0x05, 0x05, 0x06, 0x1d, 0x1d, 0x1d, 0x05, 0x04, 0x06, 0x06, 0x06, // 0280\n\t0x06, 0x06, 0x06, 0x06, 0x05, 0x1d, 0x1d, 0x04, 0x05, 0x05, 0x05, 0x05, 0x1d, 0x1d, 0x1d, 0x05, // 0290\n\t0x05, 0x18, 0x18, 0x05, 0x06, 0x06, 0x1d, 0x1d, 0x1d, 0x04, 0x04, 0x1d, 0x1d, 0x1d, 0x04, 0x1d, // 02a0\n\t0x1d, 0x1d, 0x04, 0x04, 0x04, 0x04, 0x1d, 0x1d, 0x05, 0x1d, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, // 02b0\n\t0x05, 0x1d, 0x1d, 0x06, 0x06, 0x1d, 0x1d, 0x06, 0x06, 0x05, 0x06, 0x1d, 0x1d, 0x1d, 0x1d, 0x04, // 02c0\n\t0x04, 0x1d, 0x04, 0x04, 0x04, 0x05, 0x05, 0x1d, 0x1d, 0x04, 0x04, 0x1a, 0x1a, 0x1d, 0x1d, 0x1d, // 02d0\n\t0x1d, 0x04, 0x04, 0x1d, 0x1d, 0x1d, 0x04, 0x04, 0x1d, 0x04, 0x04, 0x1d, 0x04, 0x04, 0x1d, 0x1d, // 02e0\n\t0x05, 0x1d, 0x06, 0x06, 0x06, 0x05, 0x05, 0x1d, 0x1d, 0x1d, 0x1d, 0x05, 0x05, 0x1d, 0x1d, 0x05, // 02f0\n\t0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x1d, 0x04, 0x1d, 0x04, 0x1d, 0x04, 0x04, 0x04, 0x1d, 0x1d, // 0300\n\t0x05, 0x05, 0x06, 0x1d, 0x06, 0x06, 0x05, 0x1d, 0x1d, 0x04, 0x1d, 0x04, 0x04, 0x1d, 0x1d, 0x04, // 0310\n\t0x04, 0x04, 0x04, 0x1d, 0x1d, 0x05, 0x04, 0x06, 0x05, 0x06, 0x05, 0x05, 0x05, 0x1d, 0x1d, 0x1d, // 0320\n\t0x06, 0x06, 0x1d, 0x1d, 0x06, 0x06, 0x05, 0x05, 0x06, 0x1d, 0x1d, 0x1d, 0x1d, 0x04, 0x04, 0x1d, // 0330\n\t0x04, 0x04, 0x04, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x04, 0x04, 0x04, 0x1d, 0x04, 0x04, // 0340\n\t0x04, 0x04, 0x1d, 0x1d, 0x1d, 0x04, 0x04, 0x1d, 0x04, 0x1d, 0x04, 0x04, 0x1d, 0x1d, 0x1d, 0x04, // 0350\n\t0x04, 0x1d, 0x1d, 0x1d, 0x04, 0x04, 0x04, 0x1d, 0x1d, 0x1d, 0x1d, 0x04, 0x04, 0x04, 0x1d, 0x1d, // 0360\n\t0x1d, 0x1d, 0x06, 0x06, 0x05, 0x06, 0x06, 0x1d, 0x1d, 0x1d, 0x06, 0x06, 0x06, 0x1d, 0x06, 0x06, // 0370\n\t0x06, 0x05, 0x1d, 0x1d, 0x1d, 0x1d, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x1d, 0x05, 0x05, // 0380\n\t0x05, 0x1d, 0x05, 0x05, 0x05, 0x05, 0x1d, 0x1d, 0x1d, 0x1d, 0x06, 0x05, 0x1d, 0x05, 0x06, 0x06, // 0390\n\t0x1d, 0x06, 0x06, 0x05, 0x05, 0x04, 0x1d, 0x04, 0x04, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, // 03a0\n\t0x1d, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x1d, 0x1d, 0x06, 0x06, 0x06, 0x1d, 0x06, 0x06, 0x06, // 03b0\n\t0x05, 0x1d, 0x1d, 0x1d, 0x05, 0x1d, 0x1d, 0x1d, 0x1d, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x1d, // 03c0\n\t0x05, 0x1d, 0x06, 0x06, 0x18, 0x1d, 0x1d, 0x1d, 0x1d, 0x1a, 0x04, 0x04, 0x1d, 0x04, 0x1d, 0x1d, // 03d0\n\t0x04, 0x04, 0x1d, 0x04, 0x1d, 0x1d, 0x04, 0x1d, 0x04, 0x04, 0x04, 0x1d, 0x04, 0x1d, 0x04, 0x1d, // 03e0\n\t0x1d, 0x04, 0x04, 0x1d, 0x04, 0x04, 0x04, 0x04, 0x05, 0x04, 0x04, 0x1d, 0x05, 0x05, 0x04, 0x1d, // 03f0\n\t0x1d, 0x04, 0x1c, 0x1c, 0x1c, 0x1c, 0x05, 0x1c, 0x05, 0x1c, 0x05, 0x14, 0x15, 0x14, 0x15, 0x06, // 0400\n\t0x06, 0x18, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x1c, 0x1d, // 0410\n\t0x04, 0x04, 0x1d, 0x06, 0x05, 0x05, 0x05, 0x05, 0x06, 0x05, 0x1d, 0x1d, 0x1d, 0x05, 0x05, 0x06, // 0420\n\t0x05, 0x1d, 0x1d, 0x1d, 0x1d, 0x18, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x04, 0x1d, 0x04, 0x04, 0x04, // 0430\n\t0x04, 0x1d, 0x1d, 0x1d, 0x04, 0x1d, 0x04, 0x04, 0x04, 0x04, 0x1d, 0x1d, 0x14, 0x15, 0x1d, 0x1d, // 0440\n\t0x1d, 0x18, 0x18, 0x18, 0x0a, 0x0a, 0x0a, 0x1a, 0x18, 0x1d, 0x1d, 0x1d, 0x13, 0x18, 0x18, 0x18, // 0450\n\t0x18, 0x0f, 0x0f, 0x0f, 0x0f, 0x1d, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 0460\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 0470\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 0480\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 0490\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 04a0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 04b0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 04c0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 04d0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, // 04e0\n\t0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x1d, 0x1d, 0x1d, 0x1d, 0x00, // 04f0\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0500\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0510\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0520\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0530\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, // 0540\n\t0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x1d, 0x00, 0x1d, 0x00, 0x1d, 0x00, 0x1d, // 0550\n\t0x00, 0x1d, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1b, 0x01, 0x1b, 0x1b, 0x1b, 0x01, 0x01, // 0560\n\t0x01, 0x1d, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1b, 0x1b, 0x1b, 0x01, 0x01, 0x01, 0x01, // 0570\n\t0x1d, 0x1d, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1d, // 0580\n\t0x1d, 0x01, 0x01, 0x01, 0x1d, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x1b, 0x1b, 0x1d, 0x18, // 0590\n\t0x18, 0x16, 0x17, 0x14, 0x16, 0x16, 0x17, 0x14, 0x16, 0x0c, 0x0d, 0x16, 0x17, 0x18, 0x18, 0x18, // 05a0\n\t0x18, 0x12, 0x12, 0x18, 0x18, 0x18, 0x19, 0x14, 0x15, 0x1d, 0x0a, 0x1d, 0x1d, 0x1d, 0x19, 0x19, // 05b0\n\t0x19, 0x14, 0x15, 0x01, 0x07, 0x07, 0x07, 0x07, 0x05, 0x07, 0x07, 0x1c, 0x1c, 0x00, 0x1c, 0x1c, // 05c0\n\t0x1c, 0x1c, 0x00, 0x1c, 0x1c, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x1c, // 05d0\n\t0x00, 0x1c, 0x1c, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x01, // 05e0\n\t0x00, 0x00, 0x1c, 0x00, 0x01, 0x04, 0x04, 0x04, 0x04, 0x01, 0x1c, 0x19, 0x19, 0x1c, 0x1c, 0x1c, // 05f0\n\t0x1c, 0x19, 0x1c, 0x1c, 0x19, 0x1c, 0x1c, 0x19, 0x19, 0x19, 0x1c, 0x1c, 0x19, 0x1c, 0x19, 0x19, // 0600\n\t0x19, 0x19, 0x19, 0x1c, 0x1c, 0x1c, 0x1c, 0x1d, 0x1c, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d, 0x1d, 0x1c, // 0610\n\t0x1d, 0x1c, 0x1c, 0x1c, 0x1c, 0x1d, 0x1d, 0x1d, 0x1c, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x0b, 0x18, // 0620\n\t0x18, 0x18, 0x1c, 0x03, 0x04, 0x09, 0x14, 0x15, 0x14, 0x15, 0x14, 0x15, 0x14, 0x15, 0x14, 0x15, // 0630\n\t0x1c, 0x1c, 0x14, 0x15, 0x14, 0x15, 0x14, 0x15, 0x14, 0x15, 0x13, 0x14, 0x15, 0x15, 0x1c, 0x1c, // 0640\n\t0x1c, 0x09, 0x09, 0x09, 0x1d, 0x1d, 0x1d, 0x1c, 0x1c, 0x1d, 0x1d, 0x1d, 0x1d, 0x1d, 0x05, 0x05, // 0650\n\t0x1b, 0x1b, 0x03, 0x03, 0x1d, 0x1d, 0x12, 0x03, 0x03, 0x03, 0x1d, 0x1c, 0x1c, 0x0a, 0x0a, 0x0a, // 0660\n\t0x0a, 0x1d, 0x1c, 0x1c, 0x1c, 0x1d, 0x1c, 0x1d, 0x04, 0x1d, 0x04, 0x04, 0x1d, 0x04, 0x04, 0x1d, // 0670\n\t0x18, 0x13, 0x13, 0x12, 0x12, 0x14, 0x15, 0x14, 0x15, 0x14, 0x15, 0x14, 0x15, 0x14, 0x15, 0x14, // 0680\n\t0x15, 0x14, 0x15, 0x14, 0x15, 0x1d, 0x1d, 0x1d, 0x1d, 0x18, 0x18, 0x18, 0x18, 0x12, 0x12, 0x12, // 0690\n\t0x18, 0x18, 0x18, 0x1d, 0x18, 0x18, 0x18, 0x18, 0x13, 0x14, 0x15, 0x14, 0x15, 0x14, 0x15, 0x18, // 06a0\n\t0x18, 0x18, 0x19, 0x13, 0x19, 0x19, 0x19, 0x1d, 0x18, 0x1a, 0x18, 0x18, 0x1d, 0x1d, 0x1d, 0x1d, // 06b0\n\t0x04, 0x04, 0x04, 0x1d, 0x04, 0x1d, 0x1d, 0x1d, 0x0f, 0x1d, 0x18, 0x18, 0x18, 0x1a, 0x18, 0x18, // 06c0\n\t0x18, 0x14, 0x15, 0x18, 0x19, 0x18, 0x13, 0x18, 0x18, 0x14, 0x19, 0x15, 0x19, 0x1d, 0x1d, 0x18, // 06d0\n\t0x14, 0x15, 0x18, 0x12, 0x1d, 0x1d, 0x04, 0x04, 0x04, 0x1d, 0x1d, 0x1d, 0x1a, 0x1a, 0x19, 0x1b, // 06e0\n\t0x1c, 0x1a, 0x1a, 0x1d, 0x1c, 0x19, 0x19, 0x19, 0x19, 0x1c, 0x1c, 0x0f, 0x0f, 0x0f, 0x1c, 0x1c, // 06f0\n\t0x1d, 0x1d\n};\n"
  },
  {
    "path": "dna/System.Char.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Char.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n#include \"Type.h\"\n\n#include \"System.Char.UC_IndexRuns.h\"\n#include \"System.Char.CaseConversion.h\"\n\n#define UC_INDEX_LEN (sizeof(UC_Index) / 4)\ntAsyncCall* System_Char_GetUnicodeCategory(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 paramCodePoint = ((U32*)pParams)[0];\n\t// Do a binary search on the UC_Index array\n\tU32 curOfs = UC_INDEX_LEN / 2;\n\tU32 upper = UC_INDEX_LEN;\n\tU32 lower = 0;\n\tU32 indexCodePoint;\n\tif (paramCodePoint == 0xffff) {\n\t\t// Special case for 0xffff, as this will not be handled correctly by the code below\n\t\t*(U32*)pReturnValue = 29;\n\t\treturn NULL;\n\t}\n\tfor(;;) {\n\t\tindexCodePoint = UC_Index[curOfs << 1];\n\t\tif (paramCodePoint >= indexCodePoint && paramCodePoint < UC_Index[(curOfs+1) << 1]) {\n\t\t\t// Found the correct entry...\n\t\t\tU32 value = UC_Index[(curOfs << 1) + 1];\n\t\t\tif (value & 0x8000) {\n\t\t\t\t// This is a run, not a direct look-up\n\t\t\t\tvalue &= 0x7fff;\n\t\t\t\tvalue += paramCodePoint - indexCodePoint;\n\t\t\t\tvalue = UC_Runs[value];\n\t\t\t}\n\t\t\t*(U32*)pReturnValue = value;\n\t\t\treturn NULL;\n\t\t}\n\t\tif (paramCodePoint < indexCodePoint) {\n\t\t\tupper = curOfs;\n\t\t} else {\n\t\t\tlower = curOfs;\n\t\t}\n\t\tcurOfs = lower + ((upper - lower) >> 1);\n\t}\n}\n\n// Return -1 if not found\nstatic I32 SearchCaseArray(unsigned short *pCaseArray, unsigned short find) {\n\tU32 lower = 0;\n\tU32 upper = sizeof(UC_CaseUpper) / 2;\n\tU32 curOfs = sizeof(UC_CaseUpper) / 4;\n\tunsigned short val;\n\n\tif (find == 0xffff) {\n\t\t// Hande 0xffff specially, as the search below cannot handle it.\n\t\treturn -1;\n\t}\n\n\tfor(;;) {\n\t\tval = pCaseArray[curOfs];\n\t\tif (find >= val && find < pCaseArray[curOfs + 1]) {\n\t\t\t// Found the correct entry\n\t\t\tif (find == val) {\n\t\t\t\treturn (I32)curOfs;\n\t\t\t}\n\t\t\treturn -1;\n\t\t}\n\t\tif (find < val) {\n\t\t\tupper = curOfs;\n\t\t} else {\n\t\t\tlower = curOfs;\n\t\t}\n\t\tif (upper == 0) {\n\t\t\treturn -1;\n\t\t}\n\t\tcurOfs = lower + ((upper - lower) >> 1);\n\t}\n}\n\ntAsyncCall* System_Char_ToLowerInvariant(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 paramCodePoint = ((U32*)pParams)[0];\n\tI32 pos;\n\n\tpos = SearchCaseArray(UC_CaseUpper, (unsigned short)paramCodePoint);\n\t*(U32*)pReturnValue = (pos < 0)?paramCodePoint:UC_CaseLower[pos];\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Char_ToUpperInvariant(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 paramCodePoint = ((U32*)pParams)[0];\n\tI32 pos;\n\n\tpos = SearchCaseArray(UC_CaseLower, (unsigned short)paramCodePoint);\n\t*(U32*)pReturnValue = (pos < 0)?paramCodePoint:UC_CaseUpper[pos];\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Char.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_CHAR_H)\n#define __SYSTEM_CHAR_H\n\n#include \"Types.h\"\n\ntAsyncCall* System_Char_GetUnicodeCategory(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Char_ToLowerInvariant(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Char_ToUpperInvariant(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.Console.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.String.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n#include \"Type.h\"\n\ntAsyncCall* System_Console_Write(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHEAP_PTR string;\n\tSTRING2 str;\n\tU32 i, strLen;\n\n\tstring = *(HEAP_PTR*)pParams;\n\tif (string != NULL) {\n#define SUB_LEN 128\n\t\tunsigned char str8[SUB_LEN+1];\n\t\tU32 start = 0;\n\t\tstr = SystemString_GetString(string, &strLen);\n\t\twhile (strLen > 0) {\n\t\t\tU32 thisLen = (strLen > SUB_LEN)?SUB_LEN:strLen;\n\t\t\tfor (i=0; i<thisLen; i++) {\n\t\t\t\tunsigned char c = str[start+i] & 0xff;\n\t\t\t\tstr8[i] = c?c:'?';\n\t\t\t}\n\t\t\tstr8[i] = 0;\n\t\t\tprintf(str8);\n\t\t\tstrLen -= thisLen;\n\t\t\tstart += thisLen;\n\t\t}\n\t}\n\n\treturn NULL;\n}\n\nstatic U32 nextKeybC = 0xffffffff;\nstatic U32 Internal_ReadKey_Check(PTR pThis_, PTR pParams, PTR pReturnValue, tAsyncCall *pAsync) {\n\tif (nextKeybC != 0xffffffff) {\n\t\t*(U32*)pReturnValue = nextKeybC;\n\t\tnextKeybC = 0xffffffff;\n\t\treturn 1;\n\t} else {\n#ifdef WIN32\n\t\tif (_kbhit()) {\n\t\t\tU32 c = _getch();\n\t\t\t*(U32*)pReturnValue = c;\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n#else\n\t\tstruct timeval tv_timeout;\n\t\tfd_set readfds;\n\t\tint res;\n\t\tU8 c;\n\t\t\n\t\ttv_timeout.tv_sec = 0;\n\t\ttv_timeout.tv_usec = 0;\n\t\tFD_ZERO(&readfds);\n\t\tFD_SET(STDIN_FILENO, &readfds);\n\t\t\n\t\tres = select(FD_SETSIZE, &readfds, NULL, NULL, &tv_timeout);\n\t\tif (res <= 0) {\n\t\t\t// timeout\n\t\t\treturn 0;\n\t\t}\n\t\tres = read(STDIN_FILENO, &c, 1);\n\t\tif (res == 1) {\n\t\t\t*(U32*)pReturnValue = c;\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn 0;\n#endif\n\t}\n}\n\ntAsyncCall* System_Console_Internal_ReadKey(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttAsyncCall *pAsync = TMALLOC(tAsyncCall);\n\n\tpAsync->sleepTime = -1;\n\tpAsync->checkFn = Internal_ReadKey_Check;\n\tpAsync->state = NULL;\n\n\treturn pAsync;\n}\n\ntAsyncCall* System_Console_Internal_KeyAvailable(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 c, isKey;\n\n\tisKey = Internal_ReadKey_Check(NULL, NULL, (PTR)&c, NULL);\n\tif (isKey) {\n\t\tnextKeybC = c;\n\t\t*(U32*)pReturnValue = 1;\n\t} else {\n\t\t*(U32*)pReturnValue = 0;\n\t}\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Console.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_CONSOLE_H)\n#define __SYSTEM_CONSOLE_H\n\n#include \"Types.h\"\n\ntAsyncCall* System_Console_Write(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Console_Internal_ReadKey(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Console_Internal_KeyAvailable(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.DateTime.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.DateTime.h\"\n\n#ifndef WIN32\n\n#include <sys/time.h>\n\n#endif\n\n#define TicksPerSecond 10000000L\n#define TicksPerMicroSecond 10L\n#define TicksAtUnixEpoch 621355968000000000L\n#define TicksAtFileTimeEpoch 504911232000000000L\n\ntAsyncCall* System_DateTime_InternalUtcNow(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\n#ifdef WIN32\n\n\tFILETIME ft;\n\n\tGetSystemTimeAsFileTime(&ft);\n\n\t*(U64*)pReturnValue = ((U64)ft.dwHighDateTime) * 0x100000000L + ((U64)ft.dwLowDateTime) + TicksAtFileTimeEpoch;\n\n#else\n\n\tstruct timeval tp;\n\n\tgettimeofday(&tp, NULL);\n\n\t*(U64*)pReturnValue = ((U64)tp.tv_sec) * TicksPerSecond + ((U64)tp.tv_usec) * TicksPerMicroSecond\n\t\t+ TicksAtUnixEpoch;\n\n#endif\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.DateTime.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_DATETIME_H)\n#define __SYSTEM_DATETIME_H\n\ntAsyncCall* System_DateTime_InternalUtcNow(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.Diagnostics.Debugger.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Char.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n#include \"Type.h\"\n\ntAsyncCall* System_Diagnostics_Debugger_Break(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tprintf(\"BREAK\\n\");\n#if defined(WIN32) && defined(_DEBUG)\n\t__debugbreak();\n#endif\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Diagnostics.Debugger.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_DIAGNOSTICS_DEBUGGER_H)\n#define __SYSTEM_DIAGNOSTICS_DEBUGGER_H\n\n#include \"Types.h\"\n\ntAsyncCall* System_Diagnostics_Debugger_Break(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.Enum.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Enum.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n#include \"Type.h\"\n#include \"System.RuntimeType.h\"\n#include \"System.Array.h\"\n#include \"System.String.h\"\n\ntAsyncCall* System_Enum_Internal_GetValue(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t*(U32*)pReturnValue = *(U32*)pThis_;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Enum_Internal_GetInfo(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttMD_TypeDef *pEnumType = RuntimeType_DeRef((PTR)((tMD_TypeDef**)pParams)[0]);\n\tU32 i, retIndex;\n\tHEAP_PTR names, values;\n\n\t// An enum type always has just one non-literal field, with all other fields being the values.\n\tnames = SystemArray_NewVector(types[TYPE_SYSTEM_ARRAY_STRING], pEnumType->numFields - 1);\n\tvalues = SystemArray_NewVector(types[TYPE_SYSTEM_ARRAY_INT32], pEnumType->numFields - 1);\n\t\n\tfor (i=0, retIndex=0; i<pEnumType->numFields; i++) {\n\t\ttMD_FieldDef *pField = pEnumType->ppFields[i];\n\t\tHEAP_PTR name;\n\t\tI32 value;\n\n\t\tif (!FIELD_ISLITERAL(pField)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tname = SystemString_FromCharPtrASCII(pField->name);\n\t\tSystemArray_StoreElement(names, retIndex, (PTR)&name);\n\t\tMetaData_GetConstant(pField->pMetaData, pField->tableIndex, (PTR)&value);\n\t\tSystemArray_StoreElement(values, retIndex, (PTR)&value);\n\t\tretIndex++;\n\t}\n\n\t*(((HEAP_PTR**)pParams)[1]) = names;\n\t*(((HEAP_PTR**)pParams)[2]) = values;\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Enum.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_ENUM_H)\n#define __SYSTEM_ENUM_H\n\n#include \"Types.h\"\n\ntAsyncCall* System_Enum_Internal_GetValue(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Enum_Internal_GetInfo(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.Environment.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Environment.h\"\n\n#include \"Type.h\"\n#include \"System.String.h\"\n#include \"Heap.h\"\n\n#include <time.h>\n\ntAsyncCall* System_Environment_get_TickCount(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tI32 t;\n\t\n\tt = (I32)msTime();\n\t*(I32*)pReturnValue = t;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Environment_GetOSVersionString(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tstatic HEAP_PTR versionString = NULL;\n\tif (versionString == NULL) {\n\t\tchar ver[64];\n#ifdef WIN32\n\t\tOSVERSIONINFO osVer;\n\t\tosVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\n\t\tGetVersionEx(&osVer);\n\t\tsprintf(ver, \"%d.%d.%d\", osVer.dwMajorVersion, osVer.dwMinorVersion, osVer.dwBuildNumber);\n#else\n\t\tstrcpy(ver, \"0.0.0\");\n#endif\n\t\tversionString = SystemString_FromCharPtrASCII(ver);\n\t\tHeap_MakeUndeletable(versionString);\n\t}\n\t*(HEAP_PTR*)pReturnValue = versionString;\n\treturn NULL;\n}\n\ntAsyncCall* System_Environment_get_Platform(PTR pThis_, PTR pParams, PTR pReturnValue) {\n#ifdef WIN32\n\tOSVERSIONINFO osVer;\n\tosVer.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);\n\tGetVersionEx(&osVer);\n\t*(U32*)pReturnValue = (osVer.dwPlatformId == VER_PLATFORM_WIN32_NT)?2:1; // Win32NT:Win32Windows\n#else\n\t*(U32*)pReturnValue = 4; // UNIX\n#endif\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Environment.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_ENVIRONMENT_H)\n#define __SYSTEM_ENVIRONMENT_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntAsyncCall* System_Environment_get_TickCount(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Environment_GetOSVersionString(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Environment_get_Platform(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.GC.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Array.h\"\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n#include \"Heap.h\"\n#include \"Type.h\"\n\ntAsyncCall* System_GC_Collect(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHeap_GarbageCollect();\n\treturn NULL;\n}\n\ntAsyncCall* System_GC_Internal_CollectionCount(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t*(U32*)pReturnValue = Heap_NumCollections();\n\treturn NULL;\n}\n\ntAsyncCall* System_GC_GetTotalMemory(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tif (*(U32*)pParams) {\n\t\tHeap_GarbageCollect();\n\t}\n\t*(U64*)pReturnValue = Heap_GetTotalMemory();\n\treturn NULL;\n}\n\ntAsyncCall* System_GC_SuppressFinalize(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHEAP_PTR obj = ((HEAP_PTR*)pParams)[0];\n\tHeap_UnmarkFinalizer(obj);\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.GC.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_GC_H)\n#define __SYSTEM_GC_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntAsyncCall* System_GC_Collect(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_GC_Internal_CollectionCount(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_GC_GetTotalMemory(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_GC_SuppressFinalize(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif"
  },
  {
    "path": "dna/System.IO.FileInternal.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Object.h\"\n\n#include \"Types.h\"\n#include \"Type.h\"\n#include \"Heap.h\"\n#include \"System.String.h\"\n#include \"System.Array.h\"\n\n#include \"errno.h\"\n\n#define ERROR_UNKNOWNMODE -1\n\n#define FILEMODE_CREATENEW 1\n#define FILEMODE_CREATE 2\n#define FILEMODE_OPEN 3\n#define FILEMODE_OPENORCREATE 4\n#define FILEMODE_TRUNCATE 5\n#define FILEMODE_APPEND 6\n\n#define FILEATTRIBUTES_DIRECTORY 0x00010\n\ntAsyncCall* System_IO_FileInternal_Open(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 filenameLen;\n\tSTRING2 filename2;\n\tU32 mode, access, share;\n\tU32 *pError;\n\tunsigned char filename[256];\n\tU32 i;\n\tI32 f = 0;\n\tint flags, error = 0;\n\t\n\tfilename2 = SystemString_GetString(((HEAP_PTR*)pParams)[0], &filenameLen);\n\tmode = ((U32*)pParams)[1];\n\taccess = ((U32*)pParams)[2];\n\tshare = ((U32*)pParams)[3];\n\tpError = ((U32**)pParams)[4];\n\n\tfor (i=0; i<filenameLen; i++) {\n\t\tfilename[i] = (unsigned char)filename2[i];\n\t}\n\tfilename[i] = 0;\n\n\tflags = O_BINARY;\n\tswitch (mode) {\n\tcase FILEMODE_OPEN:\n\t\tflags |= O_RDWR;\n\t\tbreak;\n\tdefault:\n\t\terror = ERROR_UNKNOWNMODE;\n\t\tgoto done;\n\t}\n\tf = open(filename, flags);\n\tif (f < 0) {\n\t\t// Failed to open\n\t\terror = errno;\n\t\tgoto done;\n\t}\n\ndone:\n\t*(I32*)pReturnValue = f;\n\t*pError = error;\n\treturn NULL;\n}\n\ntAsyncCall* System_IO_FileInternal_Read(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 f;\n\tHEAP_PTR dst;\n\tU32 startOfs, count;\n\tU32 *pError;\n\tPTR pFirstElement;\n\tI32 ret = 0, error = 0;\n\n\tf = ((U32*)pParams)[0];\n\tdst = ((HEAP_PTR*)pParams)[1];\n\tstartOfs = ((U32*)pParams)[2];\n\tcount = ((U32*)pParams)[3];\n\tpError = ((U32**)pParams)[4];\n\tpFirstElement = SystemArray_LoadElementAddress(dst, startOfs);\n\n\tret = read(f, pFirstElement, count);\n\tif (ret < 0) {\n\t\terror = errno;\n\t}\n\n\t*pError = error;\n\t*(U32*)pReturnValue = ret;\n\treturn NULL;\n}\n\ntAsyncCall* System_IO_FileInternal_Close(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 f;\n\tU32 *pError;\n\n\tf = ((U32*)pParams)[0];\n\tpError = ((U32**)pParams)[1];\n\n\tclose(f);\n\n\t*pError = 0;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_IO_FileInternal_GetCurrentDirectory(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 *pError = ((U32**)pParams)[0];\n\tHEAP_PTR curDir;\n#ifdef WIN32\n\tunsigned short dir[256];\n\tGetCurrentDirectoryW(256, dir);\n\tcurDir = SystemString_FromCharPtrUTF16(dir);\n#else\n\tunsigned char dir[256];\n\tgetcwd(dir, 256);\n\tcurDir = SystemString_FromCharPtrASCII(dir);\n#endif\n\t*pError = 0;\n\t*(HEAP_PTR*)pReturnValue = curDir;\n\treturn NULL;\n}\n\n#ifndef WIN32\n// Get attributes of file and map from UNIX to .NET attribute flags\nstatic U32 Attrs(unsigned char *pPath, U32 *pError) {\n\tstruct stat info;\n\tint err = stat(pPath, &info);\n\tif (err == 0) {\n\t\t// Success, so map attributes to .NET values\n\t\tU32 ret = 0;\n\t\tif (info.st_mode & S_IFDIR) {\n\t\t\tret |= FILEATTRIBUTES_DIRECTORY;\n\t\t}\n\t\t*pError = 0;\n\t\treturn ret;\n\t} else {\n\t\t// Error\n\t\t*pError = errno;\n\t\treturn (U32)-1;\n\t}\n}\n#endif\n\ntAsyncCall* System_IO_FileInternal_GetFileAttributes(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHEAP_PTR pathHeapPtr = ((HEAP_PTR*)pParams)[0];\n\tU32 *pError = ((U32**)pParams)[1];\n\tU32 pathLen;\n\tSTRING2 path = SystemString_GetString(pathHeapPtr, &pathLen);\n\tU32 ret;\n#ifdef WIN32\n\tunsigned short pathNullTerm[256];\n\tmemcpy(pathNullTerm, path, pathLen << 1);\n\tpathNullTerm[pathLen] = 0;\n\tret = GetFileAttributesW(pathNullTerm);\n\tif (ret == INVALID_FILE_ATTRIBUTES) {\n\t\tret = (U32)-1;\n\t}\n\t*pError = 0;\n#else\n\tunsigned char path8[256];\n\tU32 i;\n\tfor (i=0; i<pathLen; i++) {\n\t\tpath8[i] = (U8)path[i];\n\t}\n\tpath8[i] = 0;\n\tret = Attrs(path8, pError);\n#endif\n\t*(U32*)pReturnValue = ret;\n\treturn NULL;\n}\n\ntAsyncCall* System_IO_FileInternal_GetFileSystemEntries(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t//HEAP_PTR pathHP = ((HEAP_PTR*)pParams)[0];\n\tHEAP_PTR pathPatternHP = ((HEAP_PTR*)pParams)[1];\n\tU32 attrs = ((U32*)pParams)[2];\n\tU32 mask = ((U32*)pParams)[3];\n\tU32* pError = ((U32**)pParams)[4];\n\tU32 /*pathLen,*/ pathPatternLen;\n\t//STRING2 path = SystemString_GetString(pathHP, &pathLen);\n\tSTRING2 pathPattern = SystemString_GetString(pathPatternHP, &pathPatternLen);\n\tHEAP_PTR retArray;\n\tU32 tempStoreSize = 32, tempStoreOfs = 0, i;\n\tHEAP_PTR *pTempStore = malloc(tempStoreSize * sizeof(void*));\n\tPTR arrayElements;\n#ifdef WIN32\n\tunsigned short pathPatternNullTerm[256];\n\tHANDLE hFind;\n\tWIN32_FIND_DATA find;\n\tmemcpy(pathPatternNullTerm, pathPattern, pathPatternLen << 1);\n\tpathPatternNullTerm[pathPatternLen] = 0;\n\thFind = FindFirstFileW(pathPatternNullTerm, &find);\n\tif (hFind != INVALID_HANDLE_VALUE) {\n\t\tdo {\n\t\t\tif ((find.dwFileAttributes & mask) == attrs) {\n\t\t\t\tHEAP_PTR str;\n\t\t\t\t// Want this file, so store it in tempStore\n\t\t\t\tif (tempStoreOfs >= tempStoreSize) {\n\t\t\t\t\ttempStoreSize <<= 1;\n\t\t\t\t\tpTempStore = realloc(pTempStore, tempStoreSize * sizeof(void*));\n\t\t\t\t}\n\t\t\t\tstr = SystemString_FromCharPtrUTF16(find.cFileName);\n\t\t\t\t// Need to temporarily make these undeletable, in case a GC happens before they're in the array\n\t\t\t\tHeap_MakeUndeletable(str);\n\t\t\t\tpTempStore[tempStoreOfs++] = str;\n\t\t\t}\n\t\t} while (FindNextFile(hFind, &find) != 0);\n\t\tFindClose(hFind);\n\t}\n#else\n\tunsigned char path8[256];\n\tglob_t gl;\n\tfor (i=0; i<pathPatternLen; i++) {\n\t\tpath8[i] = (U8)pathPattern[i];\n\t}\n\tpath8[i] = 0;\n\ti = glob(path8, GLOB_NOSORT, NULL, &gl);\n\tif (i == 0) {\n\t\tfor (i=0; i<gl.gl_pathc; i++) {\n\t\t\tunsigned char *pResult = gl.gl_pathv[i];\n\t\t\tU32 fileAttrs = Attrs(pResult, pError);\n\t\t\tif (fileAttrs == (U32)-1) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ((fileAttrs & mask) == attrs) {\n\t\t\t\tHEAP_PTR str;\n\t\t\t\t// Want this file, so store it in tempStore\n\t\t\t\tif (tempStoreOfs >= tempStoreSize) {\n\t\t\t\t\ttempStoreSize <<= 1;\n\t\t\t\t\tpTempStore = realloc(pTempStore, tempStoreSize * sizeof(void*));\n\t\t\t\t}\n\t\t\t\tstr = SystemString_FromCharPtrASCII(pResult);\n\t\t\t\t// Need to temporarily make these undeletable, in case a GC happens before they're in the array\n\t\t\t\tHeap_MakeUndeletable(str);\n\t\t\t\tpTempStore[tempStoreOfs++] = str;\n\t\t\t}\n\t\t}\n\t\tglobfree(&gl);\n\t} else {\n\t\t*pError = errno;\n\t}\n#endif\n\t// Move the temp-store values into the final returnable array\n\tretArray = SystemArray_NewVector(types[TYPE_SYSTEM_ARRAY_STRING], tempStoreOfs);\n\tarrayElements = SystemArray_GetElements(retArray);\n\tmemcpy(arrayElements, pTempStore, tempStoreOfs * sizeof(void*));\n\tfree(pTempStore);\n\t*(HEAP_PTR*)pReturnValue = retArray;\n\t// Make the strings deletable again\n\tfor (i=0; i<tempStoreOfs; i++) {\n\t\tHeap_MakeDeletable(((HEAP_PTR*)arrayElements)[i]);\n\t}\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.IO.FileInternal.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_IO_FILEINTERNAL_H)\n#define __SYSTEM_IO_FILEINTERNAL_H\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n\ntAsyncCall* System_IO_FileInternal_Open(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_IO_FileInternal_Read(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_IO_FileInternal_Close(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_IO_FileInternal_GetCurrentDirectory(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_IO_FileInternal_GetFileAttributes(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_IO_FileInternal_GetFileSystemEntries(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n\n#endif\n"
  },
  {
    "path": "dna/System.Math.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Math.h\"\n\n#include <math.h>\n\ntAsyncCall* System_Math_Sin(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t*(double*)pReturnValue = sin(INTERNALCALL_PARAM(0, double));\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Math_Cos(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t*(double*)pReturnValue = cos(INTERNALCALL_PARAM(0, double));\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Math_Tan(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t*(double*)pReturnValue = tan(INTERNALCALL_PARAM(0, double));\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Math_Pow(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t*(double*)pReturnValue = pow(INTERNALCALL_PARAM(0, double), INTERNALCALL_PARAM(8, double));\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Math_Sqrt(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t*(double*)pReturnValue = sqrt(INTERNALCALL_PARAM(0, double));\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Math.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_MATH_H)\n#define __SYSTEM_MATH_H\n\n#include \"Types.h\"\n\ntAsyncCall* System_Math_Sin(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Math_Cos(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Math_Tan(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Math_Pow(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Math_Sqrt(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif"
  },
  {
    "path": "dna/System.Net.Dns.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Net.Dns.h\"\n\n#include \"Type.h\"\n#include \"System.Array.h\"\n#include \"System.String.h\"\n\n#ifndef WIN32\n#include <netdb.h>\n#endif\n\ntAsyncCall* System_Net_Dns_Internal_GetHostEnt(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tstruct hostent *pHostEnt;\n\tU32 i, len;\n\tSTRING2 name2;\n\tHEAP_PTR retArray;\n\tU8 nameU8[256];\n\n\tHEAP_PTR name = INTERNALCALL_PARAM(0, STRING);\n\tHEAP_PTR *pHostName = INTERNALCALL_PARAM(4, STRING*);\n\n\tname2 = SystemString_GetString(name, &len);\n\tfor (i=0; i<len && i<256; i++) {\n\t\tnameU8[i] = (U8)name2[i];\n\t}\n\tnameU8[i] = 0;\n\tpHostEnt = gethostbyname(nameU8);\n\t*pHostName = SystemString_FromCharPtrASCII(pHostEnt->h_name);\n\n\t// Count how many entries there are\n\tfor (i=0; pHostEnt->h_addr_list[i] != NULL; i++);\n\n\tretArray = SystemArray_NewVector(types[TYPE_SYSTEM_ARRAY_INT32], i);\n\t*(HEAP_PTR*)pReturnValue = retArray;\n\tfor (i=0; pHostEnt->h_addr_list[i] != NULL; i++) {\n\t\tSystemArray_StoreElement(retArray, i, pHostEnt->h_addr_list[i]);\n\t}\n\n\treturn NULL;\n\n}\n"
  },
  {
    "path": "dna/System.Net.Dns.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __SYSTEM_NET_DNS\n#define __SYSTEM_NET_DNS\n\ntAsyncCall* System_Net_Dns_Internal_GetHostEnt(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.Net.Sockets.Socket.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Net.Sockets.Socket.h\"\n\n#include \"System.Array.h\"\n\n#ifdef WIN32\n#define ERRNO WSAGetLastError()\n#define WOULDBLOCK WSAEWOULDBLOCK\n#else\n#include <sys/types.h>\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <errno.h>\n#define ERRNO errno\n#define WOULDBLOCK EWOULDBLOCK\n#endif\n\nvoid Socket_Init() {\n#ifdef WIN32\n\tWSADATA d;\n\tWSAStartup(0x0202, &d);\n#endif\n}\n\ntAsyncCall* System_Net_Sockets_Internal_CreateSocket(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\n\tint s;\n\n\tU32 family = INTERNALCALL_PARAM(0, U32);\n\tU32 type = INTERNALCALL_PARAM(4, U32);\n\tU32 proto = INTERNALCALL_PARAM(8, U32);\n\tU32 *pError = INTERNALCALL_PARAM(12, U32*);\n\n\t*(void**)pReturnValue = NULL;\n\n\ts = (int)socket(family, type, proto);\n\n\tif (s == -1) {\n\t\t// Error\n\t\t*pError = ERRNO;\n\t\ts = 0;\n\t} else {\n\t\t*pError = 0;\n\t}\n\n\t// Set socket to non-blocking\n#ifdef WIN32\n\t{\n\t\tu_long nonblock = 1;\n\t\tioctlsocket(s, FIONBIO, &nonblock);\n\t}\n#else\n\tfcntl(s, F_SETFL, O_NONBLOCK);\n#endif\n\n\t*(int*)pReturnValue = s;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Net_Sockets_Internal_Bind(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\n\tstruct sockaddr_in sa;\n\tint r;\n\n\tint s = INTERNALCALL_PARAM(0, int);\n\tU32 addr = INTERNALCALL_PARAM(4, U32);\n\tU32 port = INTERNALCALL_PARAM(8, U32);\n\tU32 *pError = INTERNALCALL_PARAM(12, U32*);\n\n\tsa.sin_family = AF_INET;\n#ifdef WIN32\n\tsa.sin_addr.S_un.S_addr = addr;\n#else\n\tsa.sin_addr.s_addr = addr;\n#endif\n\tsa.sin_port = htons(port);\n\n\tr = bind(s, (struct sockaddr*)&sa, sizeof(sa));\n\t*pError = (r != 0)?ERRNO:0;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Net_Sockets_Internal_Close(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\n\tint s = INTERNALCALL_PARAM(0, int);\n\n#ifdef WIN32\n\tclosesocket(s);\n#else\n\tclose(s);\n#endif\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Net_Sockets_Internal_Listen(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tint s = INTERNALCALL_PARAM(0, int);\n\tU32 backlog = INTERNALCALL_PARAM(4, U32);\n\tU32 *pError = INTERNALCALL_PARAM(8, U32*);\n\n\tint r = listen(s, backlog);\n\n\t*pError = (r != 0)?ERRNO:0;\n\n\treturn NULL;\n}\n\nstatic U32 Accept_Check(PTR pThis_, PTR pParams, PTR pReturnValue, tAsyncCall *pAsync) {\n\tint s = INTERNALCALL_PARAM(0, int);\n\tU32 *pError = INTERNALCALL_PARAM(4, U32*);\n\tint newS;\n\n\tnewS = (int)accept(s, NULL, 0);\n\tif (newS == -1) {\n\t\t// Blocked or error\n\t\tint err = ERRNO;\n\t\tif (err == WOULDBLOCK) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\t*(U32*)pReturnValue = 0;\n\t\t\t*pError = err;\n\t\t\treturn 1;\n\t\t}\n\t} else {\n\t\t*(U32*)pReturnValue = newS;\n\t\t*pError = 0;\n\t\treturn 1;\n\t}\n}\n\ntAsyncCall* System_Net_Sockets_Internal_Accept(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 ret = Accept_Check(pThis_, pParams, pReturnValue, NULL);\n\tif (ret) {\n\t\treturn NULL;\n\t} else {\n\t\ttAsyncCall *pAsync = TMALLOC(tAsyncCall);\n\t\tpAsync->sleepTime = -1;\n\t\tpAsync->checkFn = Accept_Check;\n\t\tpAsync->state = NULL;\n\t\treturn pAsync;\n\t}\n}\n\nstatic U32 Connect_Check(PTR pThis_, PTR pParams, PTR pReturnValue, tAsyncCall *pAsync) {\n\tstruct sockaddr_in sa;\n\tint r;\n\n\tint s = INTERNALCALL_PARAM(0, int);\n\tU32 addr = INTERNALCALL_PARAM(4, U32);\n\tU32 port = INTERNALCALL_PARAM(8, U32);\n\tU32 *pError = INTERNALCALL_PARAM(12, U32*);\n\n\tsa.sin_family = AF_INET;\n#ifdef WIN32\n\tsa.sin_addr.S_un.S_addr = addr;\n#else\n\tsa.sin_addr.s_addr = addr;\n#endif\n\tsa.sin_port = htons(port);\n\n\tr = connect(s, (struct sockaddr*)&sa, sizeof(sa));\n\t//printf(\"Connect_Check: r=%d\\n\", r);\n\tif (r == 0) {\n\t\t*pError = 0;\n\t\treturn 1;\n\t} else {\n\t\tint err = ERRNO;\n\t\t//printf(\"Connect_Check: errno=%d\\n\", err);\n#ifdef WIN32\n\t\tif (err == WSAEINVAL || err == WSAEWOULDBLOCK || err == WSAEALREADY) {\n#else\n\t\tif (err == EINPROGRESS || err == EALREADY) {\n#endif\n\t\t\t// Still waiting for connection\n\t\t\treturn 0;\n\t\t} else {\n#ifdef WIN32\n\t\t\tif (err == WSAEISCONN) {\n#else\n\t\t\tif (err == EISCONN) {\n#endif\n\t\t\t\t// The connection is fine\n\t\t\t\terr = 0;\n\t\t\t}\n\t\t\t// Connection failed\n\t\t\t*pError = err;\n\t\t\treturn 1;\n\t\t}\n\t}\n}\n\ntAsyncCall* System_Net_Sockets_Internal_Connect(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 ret = Connect_Check(pThis_, pParams, pReturnValue, NULL);\n\tif (ret) {\n\t\treturn NULL;\n\t} else {\n\t\ttAsyncCall *pAsync = TMALLOC(tAsyncCall);\n\t\tpAsync->sleepTime = -1;\n\t\tpAsync->checkFn = Connect_Check;\n\t\tpAsync->state = NULL;\n\t\treturn pAsync;\n\t}\n}\n\ntypedef struct tSendRecvState_ tSendRecvState;\nstruct tSendRecvState_ {\n\t// The number of bytes we've currently received\n\tU32 count;\n};\n\nstatic U32 Receive_Check(PTR pThis_, PTR pParams, PTR pReturnValue, tAsyncCall *pAsync) {\n\tPTR buffer;\n\tint r;\n\ttSendRecvState *pState = (tSendRecvState*)pAsync->state;\n\n\tint s = INTERNALCALL_PARAM(0, int);\n\tHEAP_PTR bufferArray = INTERNALCALL_PARAM(4, HEAP_PTR);\n\tU32 ofs = INTERNALCALL_PARAM(8, U32);\n\tU32 size = INTERNALCALL_PARAM(12, U32);\n\tU32 flags = INTERNALCALL_PARAM(16, U32);\n\tU32 *pError = INTERNALCALL_PARAM(20, U32*);\n\n\tbuffer = SystemArray_GetElements(bufferArray) + ofs + pState->count;\n\n\tr = recv(s, buffer, size, flags);\n\n\tif (r > 0) {\n\t\tpState->count += r;\n\t\tif (pState->count >= size) {\n\t\t\t// Got all required data\n\t\t\t*(U32*)pReturnValue = pState->count;\n\t\t\t*pError = 0;\n\t\t\treturn 1;\n\t\t} else {\n\t\t\t// Still more data to come\n\t\t\treturn 0;\n\t\t}\n\t} else if (r == 0) {\n\t\t// Connection has been closed, so finish\n\t\t*(U32*)pReturnValue = pState->count;\n\t\t*pError = 0;\n\t\treturn 1;\n\t} else {\n\t\tint err = ERRNO;\n\t//printf(\"Receive_Check: errno=%d\\n\", err);\n#ifdef WIN32\n\t\tif (err == WSAEINPROGRESS || err == WSAEWOULDBLOCK) {\n#else\n\t\tif (err == EAGAIN) {\n#endif\n\t\t\t// Still waiting for data\n\t\t\treturn 0;\n\t\t} else {\n\t\t\t*(U32*)pReturnValue = pState->count;\n\t\t\t*pError = err;\n\t\t\treturn 1;\n\t\t}\n\t}\n}\n\ntAsyncCall* System_Net_Sockets_Internal_Receive(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 ok;\n\ttAsyncCall *pAsync = TMALLOC(tAsyncCall);\n\ttSendRecvState *pState = TMALLOC(tSendRecvState);\n\tpAsync->sleepTime = -1;\n\tpAsync->checkFn = Receive_Check;\n\tpAsync->state = (PTR)pState;\n\tpState->count = 0;\n\tok = Receive_Check(pThis_, pParams, pReturnValue, pAsync);\n\tif (ok) {\n\t\tfree(pState);\n\t\tfree(pAsync);\n\t\treturn NULL;\n\t} else {\n\t\treturn pAsync;\n\t}\n}\n\nstatic U32 Send_Check(PTR pThis_, PTR pParams, PTR pReturnValue, tAsyncCall *pAsync) {\n\tPTR buffer;\n\tint r;\n\ttSendRecvState *pState = (tSendRecvState*)pAsync->state;\n\n\tint s = INTERNALCALL_PARAM(0, int);\n\tHEAP_PTR bufferArray = INTERNALCALL_PARAM(4, HEAP_PTR);\n\tU32 ofs = INTERNALCALL_PARAM(8, U32);\n\tU32 size = INTERNALCALL_PARAM(12, U32);\n\tU32 flags = INTERNALCALL_PARAM(16, U32);\n\tU32 *pError = INTERNALCALL_PARAM(20, U32*);\n\n\tbuffer = SystemArray_GetElements(bufferArray) + ofs + pState->count;\n\n\tr = send(s, buffer, size, flags);\n\t//printf(\"Send_Check: r=%d\\n\", r);\n\n\tif (r >= 0) {\n\t\tpState->count += r;\n\t\tif (pState->count >= size) {\n\t\t\t// All data sent\n\t\t\t*(U32*)pReturnValue = pState->count;\n\t\t\t*pError = 0;\n\t\t\treturn 1;\n\t\t} else {\n\t\t\t// Still more data to come\n\t\t\treturn 0;\n\t\t}\n\t} else {\n\t\tint err = ERRNO;\nprintf(\"Send_Check: errno=%d\\n\", err);\n#ifdef WIN32\n\t\tif (err == WSAEINPROGRESS || err == WSAEWOULDBLOCK) {\n#else\n\t\tif (err == EAGAIN) {\n#endif\n\t\t\treturn 0;\n\t\t} else {\n\t\t\t*(U32*)pReturnValue = pState->count;\n\t\t\t*pError = err;\n\t\t\treturn 1;\n\t\t}\n\t}\n}\n\ntAsyncCall* System_Net_Sockets_Internal_Send(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 ok;\n\ttAsyncCall *pAsync = TMALLOC(tAsyncCall);\n\ttSendRecvState *pState = TMALLOC(tSendRecvState);\n\tpAsync->sleepTime = -1;\n\tpAsync->checkFn = Receive_Check;\n\tpAsync->state = (PTR)pState;\n\tpState->count = 0;\n\tok = Send_Check(pThis_, pParams, pReturnValue, pAsync);\n\tif (ok) {\n\t\tfree(pState);\n\t\tfree(pAsync);\n\t\treturn NULL;\n\t} else {\n\t\treturn pAsync;\n\t}\n}\n"
  },
  {
    "path": "dna/System.Net.Sockets.Socket.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_NET_SOCKETS_SOCKET_H)\n#define __SYSTEM_NET_SOCKETS_SOCKET_H\n\nvoid Socket_Init();\n\ntAsyncCall* System_Net_Sockets_Internal_CreateSocket(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Net_Sockets_Internal_Bind(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Net_Sockets_Internal_Close(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Net_Sockets_Internal_Listen(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Net_Sockets_Internal_Accept(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Net_Sockets_Internal_Connect(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Net_Sockets_Internal_Receive(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Net_Sockets_Internal_Send(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.Object.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Object.h\"\n\n#include \"Types.h\"\n#include \"Type.h\"\n\ntAsyncCall* System_Object_Equals(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t*(U32*)pReturnValue = (pThis_ == *(PTR*)pParams);\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Object_Clone(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHEAP_PTR obj, clone;\n\n\tobj = ((HEAP_PTR*)pParams)[0];\n\tclone = Heap_Clone(obj);\n\t*(HEAP_PTR*)pReturnValue = clone;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Object_GetHashCode(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\t*(U32*)pReturnValue = ((((U32)pThis_) >> 2) * 2654435761UL);\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Object_GetType(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHEAP_PTR typeObject;\n\ttMD_TypeDef *pTypeDef;\n\n\tpTypeDef = Heap_GetType((HEAP_PTR)pThis_);\n\ttypeObject = Type_GetTypeObject(pTypeDef);\n\t*(HEAP_PTR*)pReturnValue = typeObject;\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Object.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_OBJECT_H)\n#define __SYSTEM_OBJECT_H\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n\ntAsyncCall* System_Object_Equals(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Object_Clone(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Object_GetHashCode(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Object_GetType(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif"
  },
  {
    "path": "dna/System.Runtime.CompilerServices.RuntimeHelpers.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Runtime.CompilerServices.RuntimeHelpers.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n#include \"Heap.h\"\n#include \"Type.h\"\n#include \"System.Array.h\"\n\ntAsyncCall* System_Runtime_CompilerServices_InitializeArray(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHEAP_PTR pArray;\n\tPTR pRawData;\n\ttMD_TypeDef *pArrayTypeDef;\n\tPTR pElements;\n\tU32 arrayLength;\n\n\tpArray = ((HEAP_PTR*)pParams)[0];\n\tpRawData = ((PTR*)pParams)[1];\n\tpArrayTypeDef = Heap_GetType(pArray);\n\tarrayLength = SystemArray_GetLength(pArray);\n\tpElements = SystemArray_GetElements(pArray);\n\tmemcpy(pElements, pRawData, pArrayTypeDef->pArrayElementType->arrayElementSize * arrayLength);\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Runtime.CompilerServices.RuntimeHelpers.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_RUNTIME_COMPILERSERVICES_RUNTIMEHELPERS_H)\n#define __SYSTEM_RUNTIME_COMPILERSERVICES_RUNTIMEHELPERS_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntAsyncCall* System_Runtime_CompilerServices_InitializeArray(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.RuntimeType.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.RuntimeType.h\"\n\n#include \"Types.h\"\n#include \"Type.h\"\n#include \"Heap.h\"\n#include \"System.String.h\"\n#include \"System.RuntimeType.h\"\n#include \"System.Array.h\"\n\nHEAP_PTR RuntimeType_New(tMD_TypeDef *pTypeDef) {\n\ttRuntimeType *pRuntimeType;\n\n\tpRuntimeType = (tRuntimeType*)Heap_AllocType(types[TYPE_SYSTEM_RUNTIMETYPE]);\n\tHeap_MakeUndeletable((HEAP_PTR)pRuntimeType);\n\tpRuntimeType->pTypeDef = pTypeDef;\n\n\treturn (HEAP_PTR)pRuntimeType;\n}\n\ntAsyncCall* System_RuntimeType_get_Name(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttRuntimeType *pRuntimeType = (tRuntimeType*)pThis_;\n\tHEAP_PTR strResult;\n\n\tstrResult = SystemString_FromCharPtrASCII(pRuntimeType->pTypeDef->name);\n\t*(HEAP_PTR*)pReturnValue = strResult;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_RuntimeType_get_Namespace(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttRuntimeType *pRuntimeType = (tRuntimeType*)pThis_;\n\tHEAP_PTR strResult;\n\n\tstrResult = SystemString_FromCharPtrASCII(pRuntimeType->pTypeDef->nameSpace);\n\t*(HEAP_PTR*)pReturnValue = strResult;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_RuntimeType_GetNestingParentType(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttRuntimeType *pRuntimeType = (tRuntimeType*)pThis_;\n\ttMD_TypeDef *pNestingParentType;\n\t\n\tpNestingParentType = pRuntimeType->pTypeDef->pNestedIn;\n\tif (pNestingParentType == NULL) {\n\t\t*(HEAP_PTR*)pReturnValue = NULL;\n\t} else {\n\t\t*(HEAP_PTR*)pReturnValue = Type_GetTypeObject(pNestingParentType);\n\t}\n\n\treturn NULL;\n}\n\ntAsyncCall* System_RuntimeType_get_BaseType(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttRuntimeType *pRuntimeType = (tRuntimeType*)pThis_;\n\ttMD_TypeDef *pBaseType = pRuntimeType->pTypeDef->pParent;\n\n\tif (pBaseType == NULL) {\n\t\t*(HEAP_PTR*)pReturnValue = NULL;\n\t} else {\n\t\t*(HEAP_PTR*)pReturnValue = Type_GetTypeObject(pBaseType);\n\t}\n\n\treturn NULL;\n}\n\ntAsyncCall* System_RuntimeType_get_IsEnum(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttMD_TypeDef *pType = ((tRuntimeType*)pThis_)->pTypeDef;\n\n\tU32 isEnum = pType->pParent == types[TYPE_SYSTEM_ENUM];\n\t*(U32*)pReturnValue = isEnum;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_RuntimeType_get_IsGenericType(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttMD_TypeDef *pType = ((tRuntimeType*)pThis_)->pTypeDef;\n\n\t*(U32*)pReturnValue = TYPE_ISGENERICINSTANCE(pType) || pType->isGenericDefinition;\n\treturn NULL;\n}\n\ntAsyncCall* System_RuntimeType_Internal_GetGenericTypeDefinition(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttMD_TypeDef *pType = ((tRuntimeType*)pThis_)->pTypeDef;\n\n\tif (TYPE_ISGENERICINSTANCE(pType)) {\n\t\tpType = pType->pGenericDefinition;\n\t}\n\n\t*(HEAP_PTR*)pReturnValue = Type_GetTypeObject(pType);\n\n\treturn NULL;\n}\n\ntAsyncCall* System_RuntimeType_GetGenericArguments(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttMD_TypeDef *pType = ((tRuntimeType*)pThis_)->pTypeDef;\n\ttMD_TypeDef *pCoreType;\n\tU32 i, argCount = 0;\n\tHEAP_PTR ret;\n\n\tpCoreType = pType->pGenericDefinition;\n\tif (pCoreType != NULL) {\n\t\t// Find the core instantiation of this type\n\t\ttGenericInstance *pInst = pCoreType->pGenericInstances;\n\t\twhile (pInst != NULL) {\n\t\t\tif (pInst->pInstanceTypeDef == pType) {\n\t\t\t\t// Found it!\n\t\t\t\targCount = pInst->numTypeArgs;\n\t\t\t}\n\t\t\tpInst = pInst->pNext;\n\t\t}\n\t}\n\n\tret = SystemArray_NewVector(types[TYPE_SYSTEM_ARRAY_TYPE], argCount);\n\t// Allocate to return value straight away, so it cannot be GCed\n\t*(HEAP_PTR*)pReturnValue = ret;\n\n\tfor (i=0; i<argCount; i++) {\n\t\tHEAP_PTR argType = Type_GetTypeObject(pType->ppClassTypeArgs[i]);\n\t\tSystemArray_StoreElement(ret, i, (PTR)&argType);\n\t}\n\n\treturn NULL;\n}\n\ntMD_TypeDef* RuntimeType_DeRef(PTR type) {\n\treturn ((tRuntimeType*)type)->pTypeDef;\n}"
  },
  {
    "path": "dna/System.RuntimeType.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_RUNTIMETYPE_H)\n#define __SYSTEM_RUNTIMETYPE_H\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n\ntypedef struct tRuntimeType_ tRuntimeType;\nstruct tRuntimeType_ {\n\t// The pointer to the TypeDef object of this type.\n\ttMD_TypeDef *pTypeDef;\n};\n\ntAsyncCall* System_RuntimeType_get_Name(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_RuntimeType_get_Namespace(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_RuntimeType_GetNestingParentType(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_RuntimeType_get_BaseType(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_RuntimeType_get_IsEnum(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_RuntimeType_get_IsGenericType(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_RuntimeType_Internal_GetGenericTypeDefinition(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_RuntimeType_GetGenericArguments(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n// Create a new heap object which is the RuntimeType object for the given type.\nHEAP_PTR RuntimeType_New(tMD_TypeDef *pTypeDef);\n// De-ref a runtime type pointer\ntMD_TypeDef* RuntimeType_DeRef(PTR type);\n\n#endif"
  },
  {
    "path": "dna/System.String.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.String.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n#include \"Heap.h\"\n#include \"Type.h\"\n#include \"System.Array.h\"\n\ntypedef struct tSystemString_ tSystemString;\n// This structure must tie up with string.cs\nstruct tSystemString_ {\n\t// Length in characters (not bytes)\n\tU32 length;\n\t// The characters\n\tU16 chars[0];\n};\n\n// length in characters, not bytes\nstatic tSystemString* CreateStringHeapObj(U32 len) {\n\ttSystemString *pSystemString;\n\tU32 totalSize;\n\t\n\ttotalSize = sizeof(tSystemString) + (len << 1);\n\tpSystemString = (tSystemString*)Heap_Alloc(types[TYPE_SYSTEM_STRING], totalSize);\n\tpSystemString->length = len;\n\treturn pSystemString;\n}\n\ntAsyncCall* System_String_ctor_CharInt32(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *pSystemString;\n\tCHAR2 c;\n\tU32 i, len;\n\n\tc = (CHAR2)(((U32*)pParams)[0]);\n\tlen = ((U32*)pParams)[1];\n\tpSystemString = CreateStringHeapObj(len);\n\tfor (i=0; i<len; i++) {\n\t\tpSystemString->chars[i] = c;\n\t}\n\t*(HEAP_PTR*)pReturnValue = (HEAP_PTR)pSystemString;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_String_ctor_CharAIntInt(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *pSystemString;\n\tHEAP_PTR charArray;\n\tPTR charElements;\n\tU32 startIndex, length;\n\n\tcharArray = ((HEAP_PTR*)pParams)[0];\n\tstartIndex = ((U32*)pParams)[1];\n\tlength = ((U32*)pParams)[2];\n\n\tcharElements = SystemArray_GetElements(charArray);\n\tpSystemString = CreateStringHeapObj(length);\n\tmemcpy(pSystemString->chars, charElements + (startIndex << 1), length << 1);\n\t*(HEAP_PTR*)pReturnValue = (HEAP_PTR)pSystemString;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_String_ctor_StringIntInt(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *pThis, *pStr;\n\tU32 startIndex, length;\n\n\tpStr = ((tSystemString**)pParams)[0];\n\tstartIndex = ((U32*)pParams)[1];\n\tlength = ((U32*)pParams)[2];\n\n\tpThis = CreateStringHeapObj(length);\n\tmemcpy(pThis->chars, &pStr->chars[startIndex], length << 1);\n\t*(HEAP_PTR*)pReturnValue = (HEAP_PTR)pThis;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_String_get_Chars(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *pThis = (tSystemString*)pThis_;\n\tU32 index;\n\n\tindex = *(U32*)pParams;\n\t*(U32*)pReturnValue = pThis->chars[index];\n\n\treturn NULL;\n}\n\ntAsyncCall* System_String_InternalConcat(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *s0, *s1, *ret;\n\n\ts0 = (tSystemString*)(((HEAP_PTR*)pParams)[0]);\n\ts1 = (tSystemString*)(((HEAP_PTR*)pParams)[1]);\n\tret = CreateStringHeapObj(s0->length + s1->length);\n\tmemcpy(ret->chars, s0->chars, s0->length << 1);\n\tmemcpy(&ret->chars[s0->length], s1->chars, s1->length << 1);\n\t*(HEAP_PTR*)pReturnValue = (HEAP_PTR)ret;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_String_InternalTrim(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *pThis = (tSystemString*)pThis_;\n\tHEAP_PTR pWhiteChars;\n\tU32 trimType, i, j, checkCharsLen;\n\tU32 ofsStart, ofsEnd;\n\tU16 *pCheckChars;\n\tU32 isWhiteSpace;\n\ttSystemString *pRet;\n\tU16 c;\n\n\tpWhiteChars = ((HEAP_PTR*)pParams)[0];\n\ttrimType = ((U32*)pParams)[1];\n\tpCheckChars = (U16*)SystemArray_GetElements(pWhiteChars);\n\tcheckCharsLen = SystemArray_GetLength(pWhiteChars);\n\n\tofsStart = 0;\n\tofsEnd = pThis->length;\n\tif (trimType & 1) {\n\t\t// Trim start\n\t\tfor (i=ofsStart; i<ofsEnd; i++) {\n\t\t\t// Check if each char is in the array\n\t\t\tisWhiteSpace = 0;\n\t\t\tc = pThis->chars[i];\n\t\t\tfor (j=0; j<checkCharsLen; j++) {\n\t\t\t\tif (c == pCheckChars[j]) {\n\t\t\t\t\tisWhiteSpace = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isWhiteSpace == 0) {\n\t\t\t\tofsStart = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (trimType & 2) {\n\t\t// Trim end\n\t\tfor (i=ofsEnd-1; i>=ofsStart; i--) {\n\t\t\t// Check if each char is in the array\n\t\t\tisWhiteSpace = 0;\n\t\t\tc = pThis->chars[i];\n\t\t\tfor (j=0; j<checkCharsLen; j++) {\n\t\t\t\tif (c == pCheckChars[j]) {\n\t\t\t\t\tisWhiteSpace = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isWhiteSpace == 0) {\n\t\t\t\tofsEnd = i + 1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tpRet = CreateStringHeapObj(ofsEnd - ofsStart);\n\tmemcpy(pRet->chars, &pThis->chars[ofsStart], (ofsEnd - ofsStart) << 1);\n\t*(HEAP_PTR*)pReturnValue = (HEAP_PTR)pRet;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_String_Equals(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *a, *b;\n\tU32 ret;\n\n\ta = ((tSystemString**)pParams)[0];\n\tb = ((tSystemString**)pParams)[1];\n\n\tif (a == b) {\n\t\tret = 1;\n\t} else if (a == NULL || b == NULL || a->length != b->length) {\n\t\tret = 0;\n\t} else {\n\t\tret = (memcmp(a->chars, b->chars, a->length<<1) == 0)?1:0;\n\t}\n\t*(U32*)pReturnValue = ret;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_String_GetHashCode(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *pThis = (tSystemString*)pThis_;\n\tU16 *pChar, *pEnd;\n\tI32 hash;\n\t\n\thash = 0;\n\tpChar = pThis->chars;\n\tpEnd = pChar + pThis->length - 1;\n\tfor (; pChar < pEnd; pChar += 2) {\n\t\thash = (hash << 5) - hash + pChar[0];\n\t\thash = (hash << 5) - hash + pChar[1];\n\t}\n\tif (pChar <= pEnd) {\n\t\thash = (hash << 5) - hash + pChar[0];\n\t}\n\t*(I32*)pReturnValue = hash;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_String_InternalReplace(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *pThis = (tSystemString*)pThis_;\n\ttSystemString *pOld = ((tSystemString**)pParams)[0];\n\ttSystemString *pNew = ((tSystemString**)pParams)[1];\n\ttSystemString *pResult;\n\tU32 thisLen, oldLen, newLen;\n\tU16 *pThisChar0, *pOldChar0, *pNewChar0, *pResultChar0;\n\tU32 i, j, replacements, dstIndex;\n\tU32 resultLen;\n\n\t// This function (correctly) assumes that the old string is not empty\n\tthisLen = pThis->length;\n\toldLen = pOld->length;\n\tnewLen = pNew->length;\n\tpThisChar0 = pThis->chars;\n\tpOldChar0 = pOld->chars;\n\tpNewChar0 = pNew->chars;\n\n\treplacements = 0;\n\tfor (i=0; i<thisLen-oldLen+1; i++) {\n\t\tU32 match = 1;\n\t\tfor (j=0; j<oldLen; j++) {\n\t\t\tif (pThisChar0[i+j] != pOldChar0[j]) {\n\t\t\t\tmatch = 0;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (match) {\n\t\t\ti += oldLen - 1;\n\t\t\treplacements++;\n\t\t}\n\t}\n\tresultLen = thisLen - (oldLen - newLen) * replacements;\n\tpResult = CreateStringHeapObj(resultLen);\n\tpResultChar0 = pResult->chars;\n\tdstIndex = 0;\n\tfor (i=0; i<thisLen; i++) {\n\t\tU32 match;\n\t\tif (i<thisLen-oldLen+1) {\n\t\t\tfor (j=0; j<oldLen; j++) {\n\t\t\t\tmatch = 1;\n\t\t\t\tif (pThisChar0[i+j] != pOldChar0[j]) {\n\t\t\t\t\tmatch = 0;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tmatch = 0;\n\t\t}\n\t\tif (match) {\n\t\t\tmemcpy(&pResultChar0[dstIndex], pNewChar0, newLen << 1);\n\t\t\tdstIndex += newLen;\n\t\t\ti += oldLen - 1;\n\t\t} else {\n\t\t\tpResultChar0[dstIndex++] = pThisChar0[i];\n\t\t}\n\t}\n\t*(HEAP_PTR*)pReturnValue = (HEAP_PTR)pResult;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_String_InternalIndexOf(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *pThis = (tSystemString*)pThis_;\n\tU16 value = ((U16*)pParams)[0];\n\tI32 startIndex = ((I32*)pParams)[1];\n\tI32 count = ((I32*)pParams)[2];\n\tU32 forwards = ((U32*)pParams)[3];\n\n\tI32 lastIndex;\n\tI32 inc;\n\tI32 i;\n\n\tif (forwards) {\n\t\tlastIndex = startIndex + count;\n\t\tinc = 1;\n\t\ti = startIndex;\n\t} else {\n\t\tlastIndex = startIndex - 1;\n\t\tinc = -1;\n\t\ti = startIndex + count - 1;\n\t}\n\tfor (; i != lastIndex; i += inc) {\n\t\tif (pThis->chars[i] == value) {\n\t\t\t*(I32*)pReturnValue = i;\n\t\t\treturn NULL;\n\t\t}\n\t}\n\t*(I32*)pReturnValue = -1;\n\treturn NULL;\n}\n\ntAsyncCall* System_String_InternalIndexOfAny(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttSystemString *pThis = (tSystemString*)pThis_;\n\tHEAP_PTR valueArray = ((HEAP_PTR*)pParams)[0];\n\tI32 startIndex = ((I32*)pParams)[1];\n\tI32 count = ((I32*)pParams)[2];\n\tU32 forwards = ((U32*)pParams)[3];\n\n\tPTR valueChars = SystemArray_GetElements(valueArray);\n\tU32 numValueChars = SystemArray_GetLength(valueArray);\n\n\tI32 lastIndex;\n\tI32 inc;\n\tI32 i, j;\n\n\tif (forwards) {\n\t\tlastIndex = startIndex + count;\n\t\tinc = 1;\n\t\ti = startIndex;\n\t} else {\n\t\tlastIndex = startIndex - 1;\n\t\tinc = -1;\n\t\ti = startIndex + count - 1;\n\t}\n\tfor (; i != lastIndex; i += inc) {\n\t\tU16 thisChar = pThis->chars[i];\n\t\tfor (j=numValueChars - 1; j>=0; j--) {\n\t\t\tif (thisChar == ((U16*)valueChars)[j]) {\n\t\t\t\t*(I32*)pReturnValue = i;\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\t}\n\t*(I32*)pReturnValue = -1;\n\treturn NULL;\n}\n\nHEAP_PTR SystemString_FromUserStrings(tMetaData *pMetaData, IDX_USERSTRINGS index) {\n\tunsigned int stringLen;\n\tSTRING2 string;\n\ttSystemString *pSystemString;\n\t\n\tstring = MetaData_GetUserString(pMetaData, index, &stringLen);\n\t// Note: stringLen is in bytes\n\tpSystemString = (tSystemString*)CreateStringHeapObj(stringLen >> 1);\n\tmemcpy(pSystemString->chars, string, stringLen);\n\treturn (HEAP_PTR)pSystemString;\n}\n\nHEAP_PTR SystemString_FromCharPtrASCII(U8 *pStr) {\n\tint stringLen, i;\n\ttSystemString *pSystemString;\n\n\tstringLen = (int)strlen(pStr);\n\tpSystemString = CreateStringHeapObj(stringLen);\n\tfor (i=0; i<stringLen; i++) {\n\t\tpSystemString->chars[i] = pStr[i];\n\t}\n\treturn (HEAP_PTR)pSystemString;\n}\n\nHEAP_PTR SystemString_FromCharPtrUTF16(U16 *pStr) {\n\ttSystemString *pSystemString;\n\tint strLen = 0;\n\n\twhile (pStr[strLen] != 0) {\n\t\tstrLen++;\n\t}\n\tpSystemString = CreateStringHeapObj(strLen);\n\tmemcpy(pSystemString->chars, pStr, strLen << 1);\n\treturn (HEAP_PTR)pSystemString;\n}\n\nSTRING2 SystemString_GetString(HEAP_PTR pThis_, U32 *pLength) {\n\ttSystemString *pThis = (tSystemString*)pThis_;\n\n\tif (pLength != NULL) {\n\t\t*pLength = pThis->length;\n\t}\n\treturn pThis->chars;\n}\n\nU32 SystemString_GetNumBytes(HEAP_PTR pThis_) {\n\treturn (((tSystemString*)pThis_)->length << 1) + sizeof(tSystemString);\n}"
  },
  {
    "path": "dna/System.String.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_STRING_H)\n#define __SYSTEM_STRING_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntAsyncCall* System_String_ctor_CharInt32(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_ctor_CharAIntInt(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_ctor_StringIntInt(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_get_Chars(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_InternalConcat(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_InternalTrim(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_Equals(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_GetHashCode(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_InternalReplace(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_InternalIndexOf(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_String_InternalIndexOfAny(PTR pThis_, PTR pParams, PTR pReturnValue);\n\nHEAP_PTR SystemString_FromUserStrings(tMetaData *pMetaData, IDX_USERSTRINGS index);\nHEAP_PTR SystemString_FromCharPtrASCII(U8 *pStr);\nHEAP_PTR SystemString_FromCharPtrUTF16(U16 *pStr);\nSTRING2 SystemString_GetString(HEAP_PTR pThis_, U32 *pLength);\nU32 SystemString_GetNumBytes(HEAP_PTR pThis_);\n\n#endif"
  },
  {
    "path": "dna/System.Threading.Interlocked.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Threading.Interlocked.h\"\n\ntAsyncCall* System_Threading_Interlocked_CompareExchange_Int32(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 *pLoc = INTERNALCALL_PARAM(0, U32*);\n\tU32 value = INTERNALCALL_PARAM(4, U32);\n\tU32 comparand = INTERNALCALL_PARAM(8, U32);\n\n\t*(U32*)pReturnValue = *pLoc;\n\tif (*pLoc == comparand) {\n\t\t*pLoc = value;\n\t}\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Threading_Interlocked_Increment_Int32(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tI32 *pLoc = INTERNALCALL_PARAM(0, I32*);\n\n\t(*pLoc)++;\n\t*(I32*)pReturnValue = *pLoc;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Threading_Interlocked_Decrement_Int32(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tI32 *pLoc = INTERNALCALL_PARAM(0, I32*);\n\n\t(*pLoc)--;\n\t*(I32*)pReturnValue = *pLoc;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Threading_Interlocked_Add_Int32(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 *pLoc = INTERNALCALL_PARAM(0, U32*);\n\tU32 value = INTERNALCALL_PARAM(4, U32);\n\n\t*pLoc += value;\n\t*(U32*)pReturnValue = *pLoc;\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Threading_Interlocked_Exchange_Int32(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 *pLoc = INTERNALCALL_PARAM(0, U32*);\n\tU32 value = INTERNALCALL_PARAM(4, U32);\n\n\t*(U32*)pReturnValue = *pLoc;\n\t*pLoc = value;\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Threading.Interlocked.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __SYSTEM_THREADING_INTERLOCKED_H\n#define __SYSTEM_THREADING_INTERLOCKED_H\n\ntAsyncCall* System_Threading_Interlocked_CompareExchange_Int32(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Threading_Interlocked_Increment_Int32(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Threading_Interlocked_Decrement_Int32(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Threading_Interlocked_Add_Int32(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Threading_Interlocked_Exchange_Int32(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif\n"
  },
  {
    "path": "dna/System.Threading.Monitor.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Threading.Monitor.h\"\n\n#include \"Type.h\"\n#include \"Types.h\"\n\nstatic U32 Internal_TryEntry_Check(PTR pThis_, PTR pParams, PTR pReturnValue, tAsyncCall *pAsync) {\n\tHEAP_PTR pObj = ((HEAP_PTR*)pParams)[0];\n\tI32 timeout = ((I32*)pParams)[1];\n\tU32 ret = Heap_SyncTryEnter(pObj);\n\tU64 now;\n\tif (ret) {\n\t\t// Lock achieved, so return that we've got it, and unblock this thread\n\t\t*(U32*)pReturnValue = 1;\n\t\treturn 1;\n\t}\n\t// Can't get lock - check timeout\n\tif (timeout < 0) {\n\t\t// Infinite timeout, continue to block thread\n\t\treturn 0;\n\t}\n\tif (timeout == 0) {\n\t\t// Timeout is 0, so always unblock, and return failure to get lock\n\t\t*(U32*)pReturnValue = 0;\n\t\treturn 1;\n\t}\n\tif (pAsync == NULL) {\n\t\t// This is the first time, so it can always block thread and wait\n\t\treturn 0;\n\t}\n\tnow = msTime();\n\tif ((I32)(now - pAsync->startTime) > timeout) {\n\t\t// Lock not got, but timeout has expired, unblock thread and return no lock\n\t\t*(U32*)pReturnValue = 0;\n\t\treturn 1;\n\t}\n\t// Continue waiting, timeout not yet expired\n\treturn 0;\n}\n\ntAsyncCall* System_Threading_Monitor_Internal_TryEnter(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tU32 ok = Internal_TryEntry_Check(pThis_, pParams, pReturnValue, NULL);\n\ttAsyncCall *pAsync;\n\tif (ok) {\n\t\t// Got lock already, so don't block thread\n\t\treturn NULL;\n\t}\n\tpAsync = TMALLOC(tAsyncCall);\n\tpAsync->sleepTime = -1;\n\tpAsync->checkFn = Internal_TryEntry_Check;\n\tpAsync->state = NULL;\n\treturn pAsync;\n}\n\ntAsyncCall* System_Threading_Monitor_Internal_Exit(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHEAP_PTR pObj = ((HEAP_PTR*)pParams)[0];\n\tHeap_SyncExit(pObj);\n\treturn ASYNC_LOCK_EXIT;\n}\n"
  },
  {
    "path": "dna/System.Threading.Monitor.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_THREADING_MONITOR_H)\n#define __SYSTEM_THREADING_MONITOR_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntAsyncCall* System_Threading_Monitor_Internal_TryEnter(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Threading_Monitor_Internal_Exit(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif"
  },
  {
    "path": "dna/System.Threading.Thread.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Threading.Thread.h\"\n\n#include \"Types.h\"\n#include \"Type.h\"\n#include \"Delegate.h\"\n#include \"Thread.h\"\n\ntAsyncCall* System_Threading_Thread_ctor(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttThread *pThread = Thread();\n\tpThread->startDelegate = ((PTR*)pParams)[0];\n\t*(HEAP_PTR*)pReturnValue = (HEAP_PTR)pThread;\n\treturn NULL;\n}\n\ntAsyncCall* System_Threading_Thread_ctorParam(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttThread *pThread = Thread();\n\tpThread->startDelegate = ((PTR*)pParams)[0];\n\t*(HEAP_PTR*)pReturnValue = (HEAP_PTR)pThread;\n\tpThread->hasParam = 1;\n\treturn NULL;\n}\n\ntAsyncCall* System_Threading_Thread_Start(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttThread *pThread = (tThread*)pThis_;\n\ttMD_MethodDef *pStartMethod;\n\tHEAP_PTR pStartObj;\n\tPTR params[2];\n\tU32 paramBytes = 0;\n\n\t// This selects the RUNNING state (=0), without changing the IsBackground bit\n\tpThread->state &= THREADSTATE_BACKGROUND;\n\n\tpStartMethod = Delegate_GetMethodAndStore(pThread->startDelegate, &pStartObj, NULL);\n\n\tif (pStartObj != NULL) {\n\t\t// If this method is not static, so it has a start object, then make it the first parameter\n\t\tparams[0] = (PTR)pStartObj;\n\t\tparamBytes = sizeof(void*);\n\t}\n\tif (pThread->hasParam) {\n\t\t// If this method has an object parameter (ParameterizedThreadStart)\n\t\tparams[paramBytes] = (PTR)pThread->param;\n\t\tparamBytes += sizeof(void*);\n\t}\n\n\tThread_SetEntryPoint(pThread, pStartMethod->pMetaData, pStartMethod->tableIndex, (PTR)&params, paramBytes);\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Threading_Thread_Sleep(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttAsyncCall *pAsync = TMALLOC(tAsyncCall);\n\n\tpAsync->sleepTime = ((I32*)pParams)[0];\n\n\treturn pAsync;\n}\n\ntAsyncCall* System_Threading_Thread_get_CurrentThread(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttThread *pThread = Thread_GetCurrent();\n\t*(HEAP_PTR*)pReturnValue = (HEAP_PTR)pThread;\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.Threading.Thread.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_THREADING_THREAD_H)\n#define __SYSTEM_THREADING_THREAD_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntAsyncCall* System_Threading_Thread_ctor(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Threading_Thread_ctorParam(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Threading_Thread_Start(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Threading_Thread_Sleep(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Threading_Thread_get_CurrentThread(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif"
  },
  {
    "path": "dna/System.Type.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Type.h\"\n#include \"System.RuntimeType.h\"\n\n#include \"Types.h\"\n#include \"Type.h\"\n\ntAsyncCall* System_Type_GetTypeFromHandle(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttMD_TypeDef *pTypeDef = *(tMD_TypeDef**)pParams;\n\n\t*(HEAP_PTR*)pReturnValue = Type_GetTypeObject(pTypeDef);\n\n\treturn NULL;\n}\n\ntAsyncCall* System_Type_get_IsValueType(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttRuntimeType *pRuntimeType = (tRuntimeType*)pThis_;\n\t\n\t*(U32*)pReturnValue = pRuntimeType->pTypeDef->isValueType;\n\n\treturn NULL;\n}"
  },
  {
    "path": "dna/System.Type.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_TYPE_H)\n#define __SYSTEM_TYPE_H\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n\ntAsyncCall* System_Type_GetTypeFromHandle(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_Type_get_IsValueType(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif"
  },
  {
    "path": "dna/System.ValueType.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.ValueType.h\"\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n#include \"Heap.h\"\n#include \"Type.h\"\n#include \"System.Array.h\"\n\n// Get all the fields in the value-types in the parameters.\n// If the 2nd parameter is NULL, then don't include it!\n// The type of the objects will always be identical.\ntAsyncCall* System_ValueType_GetFields(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\tHEAP_PTR o1,o2, ret;\n\ttMD_TypeDef *pType;\n\ttMetaData *pMetaData;\n\tU32 i, retOfs, numInstanceFields;\n\n\to1 = ((HEAP_PTR*)pParams)[0];\n\to2 = ((HEAP_PTR*)pParams)[1];\n\tpType = Heap_GetType(o1);\n\tpMetaData = pType->pMetaData;\n\n\tnumInstanceFields = 0;\n\tfor (i=0; i<pType->numFields; i++) {\n\t\tif (!FIELD_ISSTATIC(pType->ppFields[i])) {\n\t\t\tnumInstanceFields++;\n\t\t}\n\t}\n\n\tret = SystemArray_NewVector(types[TYPE_SYSTEM_ARRAY_OBJECT], numInstanceFields << ((o2 == NULL)?0:1));\n\n\tretOfs = 0;\n\tfor (i=0; i<pType->numFields; i++) {\n\t\ttMD_FieldDef *pField;\n\n\t\tpField = pType->ppFields[i];\n\t\tif (!FIELD_ISSTATIC(pField)) {\n\t\t\tif (pField->pType->isValueType) {\n\t\t\t\tHEAP_PTR boxed;\n\n\t\t\t\tboxed = Heap_Box(pField->pType, o1 + pField->memOffset);\n\t\t\t\tSystemArray_StoreElement(ret, retOfs++, (PTR)&boxed);\n\t\t\t\tif (o2 != NULL) {\n\t\t\t\t\tboxed = Heap_Box(pField->pType, o2 + pField->memOffset);\n\t\t\t\t\tSystemArray_StoreElement(ret, retOfs++, (PTR)&boxed);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tSystemArray_StoreElement(ret, retOfs++, o1 + pField->memOffset);\n\t\t\t\tif (o2 != NULL) {\n\t\t\t\t\tSystemArray_StoreElement(ret, retOfs++, o2 + pField->memOffset);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t*(HEAP_PTR*)pReturnValue = ret;\n\n\treturn NULL;\n}\n"
  },
  {
    "path": "dna/System.ValueType.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_VALUETYPE_H)\n#define __SYSTEM_VALUETYPE_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntAsyncCall* System_ValueType_GetFields(PTR pThis_, PTR pParams, PTR pReturnValue);\n\n#endif"
  },
  {
    "path": "dna/System.WeakReference.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"System.Array.h\"\n\n#include \"Types.h\"\n#include \"MetaData.h\"\n#include \"Heap.h\"\n#include \"Type.h\"\n\ntypedef struct tWeakRef_ tWeakRef;\nstruct tWeakRef_ {\n\t// The target of this weak-ref\n\tHEAP_PTR target;\n\t// Does this weak-ref track resurrection?\n\tU32 trackRes;\n\t// Link to the next weak-ref that points to the same target\n\ttWeakRef *pNextWeakRef;\n};\n\ntAsyncCall* System_WeakReference_get_Target(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttWeakRef *pThis = (tWeakRef*)pThis_;\n\t*(HEAP_PTR*)pReturnValue = pThis->target;\n\treturn NULL;\n}\n\ntAsyncCall* System_WeakReference_set_Target(PTR pThis_, PTR pParams, PTR pReturnValue) {\n\ttWeakRef *pThis = (tWeakRef*)pThis_;\n\tHEAP_PTR target = ((HEAP_PTR*)pParams)[0];\n\n\tif (pThis->target != NULL) {\n\t\ttWeakRef **ppWeakRef = (tWeakRef**)Heap_GetWeakRefAddress(pThis->target);\n\t\twhile (*ppWeakRef != NULL) {\n\t\t\ttWeakRef *pWeakRef = *ppWeakRef;\n\t\t\tif (pWeakRef == pThis) {\n\t\t\t\t*ppWeakRef = pWeakRef->pNextWeakRef;\n\t\t\t\tHeap_RemovedWeakRefTarget(pWeakRef->target);\n\t\t\t\tgoto foundOK;\n\t\t\t}\n\t\t\tppWeakRef = &(pWeakRef->pNextWeakRef);\n\t\t}\n\t\tCrash(\"WeakRef.set_Target() Error: cannot find weak-ref target for removal\");\nfoundOK:;\n\t}\n\tpThis->target = target;\n\tif (target != NULL) {\n\t\tpThis->pNextWeakRef = (tWeakRef*)Heap_SetWeakRefTarget(target, (HEAP_PTR)pThis);\n\t}\n\n\treturn NULL;\n}\n\nvoid SystemWeakReference_TargetGone(HEAP_PTR *ppWeakRef_, U32 removeLongRefs) {\n\ttWeakRef **ppWeakRef = (tWeakRef**)ppWeakRef_;\n\ttWeakRef *pWeakRef = *ppWeakRef;\n\twhile (pWeakRef != NULL) {\n\t\tif (removeLongRefs || !pWeakRef->trackRes) {\n\t\t\t// Really remove it\n\t\t\tpWeakRef->target = NULL;\n\t\t} else {\n\t\t\t// Long ref, so keep it\n\t\t\t*ppWeakRef = pWeakRef;\n\t\t\tppWeakRef = &(pWeakRef->pNextWeakRef);\n\t\t}\n\t\tpWeakRef = pWeakRef->pNextWeakRef;\n\t}\n\t*ppWeakRef = NULL;\n}\n"
  },
  {
    "path": "dna/System.WeakReference.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__SYSTEM_WEAKREFERENCE_H)\n#define __SYSTEM_WEAKREFERENCE_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\ntAsyncCall* System_WeakReference_get_Target(PTR pThis_, PTR pParams, PTR pReturnValue);\ntAsyncCall* System_WeakReference_set_Target(PTR pThis_, PTR pParams, PTR pReturnValue);\n\nvoid SystemWeakReference_TargetGone(HEAP_PTR *ppWeakRef_, U32 removeLongRefs);\n\n#endif"
  },
  {
    "path": "dna/Thread.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"Thread.h\"\n\n#include \"MethodState.h\"\n#include \"Heap.h\"\n#include \"Type.h\"\n\nstatic tThread *pAllThreads = NULL;\nstatic tThread *pCurrentThread;\n\ntThread* Thread() {\n\tstatic U32 threadID = 0;\n\ttThread *pThis;\n\n\t// Create thread and initial method state. This is allocated on the managed heap, and\n\t// mark as undeletable. When the thread exits, it was marked as deletable.\n\tpThis = (tThread*)Heap_AllocType(types[TYPE_SYSTEM_THREADING_THREAD]);\n\tHeap_MakeUndeletable((HEAP_PTR)pThis);\n\tpThis->threadID = ++threadID;\n\tpThis->pCurrentMethodState = NULL;\n\tpThis->threadExitValue = 0;\n\tpThis->nextFinallyUnwindStack = 0;\n\tpThis->pAsync = NULL;\n\tpThis->hasParam = 0;\n\n\tpThis->startDelegate = NULL;\n\tpThis->param = NULL;\n\tpThis->state = THREADSTATE_UNSTARTED;\n\n\t// Allocate the first chunk of thread-local stack\n\tpThis->pThreadStack = TMALLOC(tThreadStack);\n\tpThis->pThreadStack->ofs = 0;\n\tpThis->pThreadStack->pNext = NULL;\n\n\t// Add to list of all thread\n\tpThis->pNextThread = pAllThreads;\n\tpAllThreads = pThis;\n\n\treturn pThis;\n}\n\nvoid* Thread_StackAlloc(tThread *pThread, U32 size) {\n\ttThreadStack *pStack = pThread->pThreadStack;\n\tvoid *pAddr = pStack->memory + pStack->ofs;\n#if _DEBUG\n\t*(U32*)pAddr = 0xabababab;\n\t((U32*)pAddr)++;\n\tpStack->ofs += 4;\n#endif\n\tpStack->ofs += size;\n\tif (pStack->ofs > THREADSTACK_CHUNK_SIZE) {\n\t\tCrash(\"Thread-local stack is too large\");\n\t}\n#if _DEBUG\n\tmemset(pAddr, 0xcd, size);\n\t*(U32*)(((char*)pAddr) + size) = 0xfbfbfbfb;\n\tpStack->ofs += 4;\n#endif\n\treturn pAddr;\n}\n\nvoid Thread_StackFree(tThread *pThread, void *pAddr) {\n\ttThreadStack *pStack = pThread->pThreadStack;\n#if _DEBUG\n\t((U32*)pAddr)--;\n\tmemset(pAddr, 0xfe, pStack->ofs - (U32)(((unsigned char*)pAddr) - pStack->memory));\n#endif\n\tpStack->ofs = (U32)(((unsigned char*)pAddr) - pStack->memory);\n}\n\nvoid Thread_SetEntryPoint(tThread *pThis, tMetaData *pMetaData, IDX_TABLE entryPointToken, PTR params, U32 paramBytes) {\n\t// Set up the initial MethodState\n\tpThis->pCurrentMethodState = MethodState(pThis, pMetaData, entryPointToken, NULL);\n\t// Insert initial parameters (if any)\n\tif (paramBytes > 0) {\n\t\tmemcpy(pThis->pCurrentMethodState->pParamsLocals, params, paramBytes);\n\t}\n}\n\nstatic void Thread_Delete(tThread *pThis) {\n\ttThreadStack *pStack = pThis->pThreadStack;\n\twhile (pStack != NULL) {\n\t\ttThreadStack *pNextStack = pStack->pNext;\n\t\tfree(pStack);\n\t\tpStack = pNextStack;\n\t}\n\tHeap_MakeDeletable((HEAP_PTR)pThis);\n}\n\nI32 Thread_Execute() {\n\ttThread *pThread, *pPrevThread;\n\tU32 status;\n\n\tpThread = pAllThreads;\n\t// Set the initial thread to the RUNNING state.\n\tpThread->state = THREADSTATE_RUNNING;\n\t// Set the initial CurrentThread\n\tpCurrentThread = pThread;\n\n\tfor (;;) {\n\t\tU32 minSleepTime = 0xffffffff;\n\t\tI32 threadExitValue;\n\n\t\tstatus = JIT_Execute(pThread, 100);\n\t\tswitch (status) {\n\t\tcase THREAD_STATUS_EXIT:\n\t\t\tthreadExitValue = pThread->threadExitValue;\n\t\t\tlog_f(1, \"Thread ID#%d exited. Return value: %d\\n\", (int)pThread->threadID, (int)threadExitValue);\n\t\t\t// Remove the current thread from the running threads list.\n\t\t\t// Note that this list may have changed since before the call to JIT_Execute().\n\t\t\t{\n\t\t\t\ttThread **ppThread = &pAllThreads;\n\t\t\t\twhile (*ppThread != pThread) {\n\t\t\t\t\tppThread = &((*ppThread)->pNextThread);\n\t\t\t\t}\n\t\t\t\t*ppThread = (*ppThread)->pNextThread;\n\t\t\t}\n\t\t\t// Delete the current thread\n\t\t\tThread_Delete(pThread);\n\t\t\t// If there are no more threads left running, then exit application (by returning)\n\t\t\t// Threads that are unstarted or background do not stop the exit\n\t\t\t{\n\t\t\t\ttThread *pThread = pAllThreads;\n\t\t\t\tU32 canExit = 1;\n\t\t\t\twhile (pThread != NULL) {\n\t\t\t\t\tif ((!(pThread->state & THREADSTATE_BACKGROUND)) && ((pThread->state & (~THREADSTATE_BACKGROUND)) != THREADSTATE_UNSTARTED)) {\n\t\t\t\t\t\tcanExit = 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tpThread = pThread->pNextThread;\n\t\t\t\t}\n\t\t\t\tif (canExit) {\n\t\t\t\t\treturn threadExitValue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpThread = pAllThreads; // This is not really correct, but it'll work for the time being\n\t\t\tbreak;\n\t\tcase THREAD_STATUS_RUNNING:\n\t\tcase THREAD_STATUS_LOCK_EXIT:\n\t\t\t// Nothing to do\n\t\t\tbreak;\n\t\tcase THREAD_STATUS_ASYNC:\n\t\t\tpThread->pAsync->startTime = msTime();\n\t\t\tbreak;\t\t\n\t\t}\n\n\t\t// Move on to the next thread.\n\t\t// Find the next thread that isn't sleeping or blocked on IO\n\t\tpPrevThread = pThread;\n\t\tfor (;;) {\n\t\t\tpThread = pThread->pNextThread;\n\t\t\tif (pThread == NULL) {\n\t\t\t\tpThread = pAllThreads;\n\t\t\t}\n\t\t\t// Set the CurrentThread correctly\n\t\t\tpCurrentThread = pThread;\n\t\t\tif ((pThread->state & (~THREADSTATE_BACKGROUND)) != 0) {\n\t\t\t\t// Thread is not running\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (pThread->pAsync != NULL) {\n\t\t\t\t// Discover if whatever is being waited for is finished\n\t\t\t\ttAsyncCall *pAsync = pThread->pAsync;\n\t\t\t\tif (pAsync->sleepTime >= 0) {\n\t\t\t\t\t// This is a sleep\n\t\t\t\t\tU64 nowTime = msTime();\n\t\t\t\t\tI32 msSleepRemaining = pAsync->sleepTime - (I32)(nowTime - pAsync->startTime);\n\t\t\t\t\tif (msSleepRemaining <= 0) {\n\t\t\t\t\t\t// Sleep is finished\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t// Sleep is not finished, so continue to next thread\n\t\t\t\t\tif ((U32)msSleepRemaining < minSleepTime) {\n\t\t\t\t\t\tminSleepTime = msSleepRemaining;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// This is blocking IO, or a lock\n\t\t\t\t\ttMethodState *pMethodState = pThread->pCurrentMethodState;\n\t\t\t\t\tPTR pThis;\n\t\t\t\t\tU32 thisOfs;\n\t\t\t\t\tU32 unblocked;\n\n\t\t\t\t\tif (METHOD_ISSTATIC(pMethodState->pMethod)) {\n\t\t\t\t\t\tpThis = NULL;\n\t\t\t\t\t\tthisOfs = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tpThis = *(PTR*)pMethodState->pParamsLocals;\n\t\t\t\t\t\tthisOfs = 4;\n\t\t\t\t\t}\n\t\t\t\t\tunblocked = pAsync->checkFn(pThis, pMethodState->pParamsLocals + thisOfs, pMethodState->pEvalStack, pAsync);\n\t\t\t\t\tif (unblocked) {\n\t\t\t\t\t\t// The IO has unblocked, and the return value is ready.\n\t\t\t\t\t\t// So delete the async object.\n\t\t\t\t\t\t// TODO: The async->state object needs to be deleted somehow (maybe)\n\t\t\t\t\t\tfree(pAsync);\n\t\t\t\t\t\t// And remove it from the thread\n\t\t\t\t\t\tpThread->pAsync = NULL;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tminSleepTime = 5;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Thread is ready to run\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (pThread == pPrevThread) {\n\t\t\t\t// When it gets here, it means that all threads are currently blocked.\n\t\t\t\t//printf(\"All blocked; sleep(%d)\\n\", minSleepTime);\n\t\t\t\tSleepMS(minSleepTime);\n\t\t\t}\n\t\t}\n\t}\n\n}\n\ntThread* Thread_GetCurrent() {\n\treturn pCurrentThread;\n}\n\nvoid Thread_GetHeapRoots(tHeapRoots *pHeapRoots) {\n\ttThread *pThread;\n\n\tpThread = pAllThreads;\n\twhile (pThread != NULL) {\n\t\ttMethodState *pMethodState;\n\n\t\tpMethodState = pThread->pCurrentMethodState;\n\t\twhile (pMethodState != NULL) {\n\t\t\t// Put the evaluation stack on the roots\n\t\t\tHeap_SetRoots(pHeapRoots, pMethodState->pEvalStack, pMethodState->pMethod->pJITted->maxStack);\n\t\t\t// Put the params/locals on the roots\n\t\t\tHeap_SetRoots(pHeapRoots, pMethodState->pParamsLocals,\n\t\t\t\tpMethodState->pMethod->parameterStackSize+pMethodState->pMethod->pJITted->localsStackSize);\n\n\t\t\tpMethodState = pMethodState->pCaller;\n\t\t}\n\n\t\tpThread = pThread->pNextThread;\n\t}\n}\n"
  },
  {
    "path": "dna/Thread.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__THREAD_H)\n#define __THREAD_H\n\ntypedef struct tThread_ tThread;\ntypedef struct tThreadStack_ tThreadStack;\n\n#include \"MetaData.h\"\n#include \"MethodState.h\"\n#include \"Heap.h\"\n#include \"Types.h\"\n\n#define THREADSTACK_CHUNK_SIZE 10000\n\nstruct tThreadStack_ {\n\t// This chunk of stack memory\n\tunsigned char memory[THREADSTACK_CHUNK_SIZE];\n\t// Current offset into this memory chunk\n\tU32 ofs;\n\t// Pointer to the next chunk.\n\ttThreadStack *pNext;\n};\n\nstruct tThread_ {\n\t// Stuff that's synced with Thread.cs\n\t// The threadID of this thread\n\tU32 threadID;\n\t// The delegate that this thread starts by executing\n\tPTR startDelegate;\n\t// The parameter to pass to the starting method (this is ignored if no parameter is needed).\n\tHEAP_PTR param;\n\t// The current state of the thread (running/paused/etc...)\n\tU32 state;\n\t// The current culture of the thread. Never accessed in C\n\tvoid *pCurrentCulture;\n\n\t// Stuff that is independant of Thread.cs\n\t// Note that the size of this can be anything we like, as the size of the Thread .NET type is ignored.\n\n\t// This thread's currently executing method\n\ttMethodState *pCurrentMethodState;\n\t// Thread exit value\n\tI32 threadExitValue;\n\t// The current exception object of this thread (for use by RETHROW)\n\tHEAP_PTR pCurrentExceptionObject;\n\t// When unwinding the stack after a throw, this keeps track of which finally clauses have already been executed\n\tU32 nextFinallyUnwindStack;\n\t// And the method state that we're aiming for..\n\ttMethodState *pCatchMethodState;\n\t// And the exception catch handler we're aiming for...\n\ttExceptionHeader *pCatchExceptionHandler;\n\t// If this thread is waiting on async data, then the details are stored here\n\ttAsyncCall *pAsync;\n\t// Does this thread start with a parameter?\n\tU32 hasParam;\n\t// Pointer to the first chunk of thread-stack memory\n\ttThreadStack *pThreadStack;\n\n\t// The next thread in the system (needed for garbage collection and theading)\n\ttThread *pNextThread;\n};\n\n// The thread has finished\n#define THREAD_STATUS_EXIT 1\n// The thread is still running, but has completed its timeslot\n#define THREAD_STATUS_RUNNING 2\n// The thread is waiting on some async data (sleep or IO)\n#define THREAD_STATUS_ASYNC 3\n// The thread has just exited a lock, so allow other threads to acquire it if they are waiting\n#define THREAD_STATUS_LOCK_EXIT 4\n\n#define ASYNC_LOCK_EXIT ((tAsyncCall*)0x00000001)\n\n// These are the same as the C# definitions in corelib,\n// and can be ORed together.\n#define THREADSTATE_RUNNING\t\t\t0x0000\n#define THREADSTATE_BACKGROUND\t\t0x0004\n#define THREADSTATE_UNSTARTED\t\t0x0008\n#define THREADSTATE_STOPPED\t\t\t0x0010\n#define THREADSTATE_SUSPENDED\t\t0x0040\n\ntThread* Thread();\nvoid Thread_SetEntryPoint(tThread *pThis, tMetaData *pMetaData, IDX_TABLE entryPointToken, PTR params, U32 paramBytes);\nI32 Thread_Execute();\ntThread* Thread_GetCurrent();\nvoid* Thread_StackAlloc(tThread *pThread, U32 size);\nvoid Thread_StackFree(tThread *pThread, void *pAddr);\n\nvoid Thread_GetHeapRoots(tHeapRoots *pHeapRoots);\n\n#endif\n"
  },
  {
    "path": "dna/Type.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"Type.h\"\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n#include \"EvalStack.h\"\n#include \"Generics.h\"\n#include \"System.RuntimeType.h\"\n#include \"Thread.h\"\n\ntypedef struct tArrayTypeDefs_ tArrayTypeDefs;\nstruct tArrayTypeDefs_ {\n\ttMD_TypeDef *pArrayType;\n\ttMD_TypeDef *pElementType;\n\n\ttArrayTypeDefs *pNext;\n};\n\nstatic tArrayTypeDefs *pArrays;\n\n#define GENERICARRAYMETHODS_NUM 13\nstatic U8 genericArrayMethodsInited = 0;\nstatic tMD_MethodDef *ppGenericArrayMethods[GENERICARRAYMETHODS_NUM];\n\n#define GENERICARRAYMETHODS_Internal_GetGenericEnumerator 0\n#define GENERICARRAYMETHODS_get_Length 1\n#define GENERICARRAYMETHODS_get_IsReadOnly 2\n#define GENERICARRAYMETHODS_Internal_GenericAdd 3\n#define GENERICARRAYMETHODS_Internal_GenericClear 4\n#define GENERICARRAYMETHODS_Internal_GenericContains 5\n#define GENERICARRAYMETHODS_Internal_GenericCopyTo 6\n#define GENERICARRAYMETHODS_Internal_GenericRemove 7\n#define GENERICARRAYMETHODS_Internal_GenericIndexOf 8\n#define GENERICARRAYMETHODS_Internal_GenericInsert 9\n#define GENERICARRAYMETHODS_Internal_GenericRemoveAt 10\n#define GENERICARRAYMETHODS_Internal_GenericGetItem 11\n#define GENERICARRAYMETHODS_Internal_GenericSetItem 12\nstatic char *pGenericArrayMethodsInit[GENERICARRAYMETHODS_NUM] = {\n\t\"Internal_GetGenericEnumerator\",\n\t\"get_Length\",\n\t\"Internal_GenericIsReadOnly\",\n\t\"Internal_GenericAdd\",\n\t\"Internal_GenericClear\",\n\t\"Internal_GenericContains\",\n\t\"Internal_GenericCopyTo\",\n\t\"Internal_GenericRemove\",\n\t\"Internal_GenericIndexOf\",\n\t\"Internal_GenericInsert\",\n\t\"Internal_GenericRemoveAt\",\n\t\"Internal_GenericGetItem\",\n\t\"Internal_GenericSetItem\",\n};\n\nstatic void GetMethodDefs() {\n\tIDX_TABLE token, last;\n\ttMetaData *pMetaData;\n\n\tpMetaData = types[TYPE_SYSTEM_ARRAY_NO_TYPE]->pMetaData;\n\tlast = types[TYPE_SYSTEM_ARRAY_NO_TYPE]->isLast?\n\t\tMAKE_TABLE_INDEX(MD_TABLE_METHODDEF, pMetaData->tables.numRows[MD_TABLE_METHODDEF]):\n\t\t(types[TYPE_SYSTEM_ARRAY_NO_TYPE][1].methodList - 1);\n\ttoken = types[TYPE_SYSTEM_ARRAY_NO_TYPE]->methodList;\n\tfor (; token <= last; token++) {\n\t\ttMD_MethodDef *pMethod;\n\t\tU32 i;\n\n\t\tpMethod = (tMD_MethodDef*)MetaData_GetTableRow(pMetaData, token);\n\t\tfor (i=0; i<GENERICARRAYMETHODS_NUM; i++) {\n\t\t\tif (strcmp(pMethod->name, pGenericArrayMethodsInit[i]) == 0) {\n\t\t\t\tppGenericArrayMethods[i] = pMethod;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t}\n\tgenericArrayMethodsInited = 1;\n}\n\nstatic void CreateNewArrayType(tMD_TypeDef *pNewArrayType, tMD_TypeDef *pElementType, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\tMetaData_Fill_TypeDef(types[TYPE_SYSTEM_ARRAY_NO_TYPE], NULL, NULL);\n\n\tmemcpy(pNewArrayType, types[TYPE_SYSTEM_ARRAY_NO_TYPE], sizeof(tMD_TypeDef));\n\tpNewArrayType->pArrayElementType = pElementType;\n\tpNewArrayType->isFilled = 1;\n\n\t// Auto-generate the generic interfaces IEnumerable<T>, ICollection<T> and IList<T> for this array\n\t{\n\t\ttInterfaceMap *pInterfaceMap, *pAllIMs;\n\t\ttMD_TypeDef *pInterfaceT;\n\t\ttMD_MethodDef *pMethod;\n\t\tU32 orgNumInterfaces;\n\n\t\tif (genericArrayMethodsInited == 0) {\n\t\t\tGetMethodDefs();\n\t\t}\n\n\t\torgNumInterfaces = pNewArrayType->numInterfaces;\n\t\tpNewArrayType->numInterfaces += 3;\n\t\tpAllIMs = (tInterfaceMap*)mallocForever(pNewArrayType->numInterfaces * sizeof(tInterfaceMap));\n\t\tmemcpy(pAllIMs, pNewArrayType->pInterfaceMaps, orgNumInterfaces * sizeof(tInterfaceMap));\n\t\tpNewArrayType->pInterfaceMaps = pAllIMs;\n\n\t\t// Get the IEnumerable<T> interface\n\t\tpInterfaceMap = &pAllIMs[orgNumInterfaces + 0];\n\t\tpInterfaceT = Generics_GetGenericTypeFromCoreType(types[TYPE_SYSTEM_COLLECTIONS_GENERIC_IENUMERABLE_T], 1, &pElementType);\n\t\tpInterfaceMap->pInterface = pInterfaceT;\n\t\tpInterfaceMap->pVTableLookup = NULL;\n\t\tpInterfaceMap->ppMethodVLookup = mallocForever(pInterfaceT->numVirtualMethods * sizeof(tMD_MethodDef*));\n\t\tpMethod = Generics_GetMethodDefFromCoreMethod(ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GetGenericEnumerator], pNewArrayType, 1, &pElementType);\n\t\tpInterfaceMap->ppMethodVLookup[0] = pMethod;\n\n\t\t// Get the ICollection<T> interface\n\t\tpInterfaceMap = &pAllIMs[orgNumInterfaces + 1];\n\t\tpInterfaceT = Generics_GetGenericTypeFromCoreType(types[TYPE_SYSTEM_COLLECTIONS_GENERIC_ICOLLECTION_T], 1, &pElementType);\n\t\tpInterfaceMap->pInterface = pInterfaceT;\n\t\tpInterfaceMap->pVTableLookup = NULL;\n\t\tpInterfaceMap->ppMethodVLookup = mallocForever(pInterfaceT->numVirtualMethods * sizeof(tMD_MethodDef*));\n\t\tpInterfaceMap->ppMethodVLookup[0] = ppGenericArrayMethods[GENERICARRAYMETHODS_get_Length];\n\t\tpInterfaceMap->ppMethodVLookup[1] = ppGenericArrayMethods[GENERICARRAYMETHODS_get_IsReadOnly];\n\t\tpInterfaceMap->ppMethodVLookup[2] = Generics_GetMethodDefFromCoreMethod(ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericAdd], pNewArrayType, 1, &pElementType);\n\t\tpInterfaceMap->ppMethodVLookup[3] = ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericClear];\n\t\tpInterfaceMap->ppMethodVLookup[4] = Generics_GetMethodDefFromCoreMethod(ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericContains], pNewArrayType, 1, &pElementType);\n\t\tpInterfaceMap->ppMethodVLookup[5] = Generics_GetMethodDefFromCoreMethod(ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericCopyTo], pNewArrayType, 1, &pElementType);\n\t\tpInterfaceMap->ppMethodVLookup[6] = Generics_GetMethodDefFromCoreMethod(ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericRemove], pNewArrayType, 1, &pElementType);\n\n\t\t// Get the IList<T> interface\n\t\tpInterfaceMap = &pAllIMs[orgNumInterfaces + 2];\n\t\tpInterfaceT = Generics_GetGenericTypeFromCoreType(types[TYPE_SYSTEM_COLLECTIONS_GENERIC_ILIST_T], 1, &pElementType); //, ppClassTypeArgs, ppMethodTypeArgs);\n\t\tpInterfaceMap->pInterface = pInterfaceT;\n\t\tpInterfaceMap->pVTableLookup = NULL;\n\t\tpInterfaceMap->ppMethodVLookup = mallocForever(pInterfaceT->numVirtualMethods * sizeof(tMD_MethodDef*));\n\t\tpInterfaceMap->ppMethodVLookup[0] = Generics_GetMethodDefFromCoreMethod(ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericIndexOf], pNewArrayType, 1, &pElementType);\n\t\tpInterfaceMap->ppMethodVLookup[1] = Generics_GetMethodDefFromCoreMethod(ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericInsert], pNewArrayType, 1, &pElementType);\n\t\tpInterfaceMap->ppMethodVLookup[2] = ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericRemoveAt];\n\t\tpInterfaceMap->ppMethodVLookup[3] = Generics_GetMethodDefFromCoreMethod(ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericGetItem], pNewArrayType, 1, &pElementType);\n\t\tpInterfaceMap->ppMethodVLookup[4] = Generics_GetMethodDefFromCoreMethod(ppGenericArrayMethods[GENERICARRAYMETHODS_Internal_GenericSetItem], pNewArrayType, 1, &pElementType);\n\t}\n\n\tlog_f(2, \"Array: Array[%s.%s]\\n\", pElementType->nameSpace, pElementType->name);\n}\n\n// Returns a TypeDef for an array to the given element type\ntMD_TypeDef* Type_GetArrayTypeDef(tMD_TypeDef *pElementType, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\ttArrayTypeDefs *pIterArrays;\n\n\tif (pElementType == NULL) {\n\t\treturn types[TYPE_SYSTEM_ARRAY_NO_TYPE];\n\t}\n\t\n\tpIterArrays = pArrays;\n\twhile (pIterArrays != NULL) {\n\t\tif (pIterArrays->pElementType == pElementType) {\n\t\t\treturn pIterArrays->pArrayType;\n\t\t}\n\t\tpIterArrays = pIterArrays->pNext;\n\t}\n\n\t// Must have this new array type in the linked-list of array types before it is initialised\n\t// (otherwise it can get stuck in an infinite loop)\n\tpIterArrays = TMALLOCFOREVER(tArrayTypeDefs);\n\tpIterArrays->pElementType = pElementType;\n\tpIterArrays->pNext = pArrays;\n\tpArrays = pIterArrays;\n\tpIterArrays->pArrayType = TMALLOC(tMD_TypeDef);\n\n\tCreateNewArrayType(pIterArrays->pArrayType, pElementType, ppClassTypeArgs, ppMethodTypeArgs);\n\treturn pIterArrays->pArrayType;\n}\n\nU32 Type_IsValueType(tMD_TypeDef *pTypeDef) {\n\t// If this type is an interface, then return 0\n\tif (TYPE_ISINTERFACE(pTypeDef)) {\n\t\treturn 0;\n\t}\n\t// If this type is Object or ValueType then return an answer\n\tif (strcmp(pTypeDef->nameSpace, \"System\") == 0) {\n\t\tif (strcmp(pTypeDef->name, \"ValueType\") == 0) {\n\t\t\treturn 1;\n\t\t}\n\t\tif (strcmp(pTypeDef->name, \"Object\") == 0) {\n\t\t\treturn 0;\n\t\t}\n\t}\n\t// Return the isValueType determined by parent type\n\tpTypeDef = MetaData_GetTypeDefFromDefRefOrSpec(pTypeDef->pMetaData, pTypeDef->extends, NULL, NULL);\n\tMetaData_Fill_TypeDef(pTypeDef, NULL, NULL);\n\treturn pTypeDef->isValueType;\n}\n\n// Get the TypeDef from the type signature\n// Also get the size of a field from the signature\n// This is needed to avoid recursive sizing of types like System.Boolean,\n// that has a field of type System.Boolean\ntMD_TypeDef* Type_GetTypeFromSig(tMetaData *pMetaData, SIG *pSig, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs) {\n\tU32 entry;\n\n\tentry = MetaData_DecodeSigEntry(pSig);\n\tswitch (entry) {\n\t\tcase ELEMENT_TYPE_VOID:\n\t\t\treturn NULL;\n\n\t\tcase ELEMENT_TYPE_BOOLEAN:\n\t\t\treturn types[TYPE_SYSTEM_BOOLEAN];\n\n\t\tcase ELEMENT_TYPE_CHAR:\n\t\t\treturn types[TYPE_SYSTEM_CHAR];\n\n\t\tcase ELEMENT_TYPE_I1:\n\t\t\treturn types[TYPE_SYSTEM_SBYTE];\n\n\t\tcase ELEMENT_TYPE_U1:\n\t\t\treturn types[TYPE_SYSTEM_BYTE];\n\n\t\tcase ELEMENT_TYPE_I2:\n\t\t\treturn types[TYPE_SYSTEM_INT16];\n\n\t\tcase ELEMENT_TYPE_U2:\n\t\t\treturn types[TYPE_SYSTEM_UINT16];\n\n\t\tcase ELEMENT_TYPE_I4:\n\t\t\treturn types[TYPE_SYSTEM_INT32];\n\n\t\tcase ELEMENT_TYPE_I8:\n\t\t\treturn types[TYPE_SYSTEM_INT64];\n\n\t\tcase ELEMENT_TYPE_U8:\n\t\t\treturn types[TYPE_SYSTEM_UINT64];\n\n\t\tcase ELEMENT_TYPE_U4:\n\t\t\treturn types[TYPE_SYSTEM_UINT32];\n\n\t\tcase ELEMENT_TYPE_R4:\n\t\t\treturn types[TYPE_SYSTEM_SINGLE];\n\n\t\tcase ELEMENT_TYPE_R8:\n\t\t\treturn types[TYPE_SYSTEM_DOUBLE];\n\n\t\tcase ELEMENT_TYPE_STRING:\n\t\t\treturn types[TYPE_SYSTEM_STRING];\n\n\t\tcase ELEMENT_TYPE_PTR:\n\t\t\treturn types[TYPE_SYSTEM_UINTPTR];\n\n\t\tcase ELEMENT_TYPE_BYREF:\n\t\t\t{\n\t\t\t\ttMD_TypeDef *pByRefType;\n\n\t\t\t\t// type of the by-ref parameter, don't care\n\t\t\t\tpByRefType = Type_GetTypeFromSig(pMetaData, pSig, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t}\n\t\t\t// fall-through\n\t\tcase ELEMENT_TYPE_INTPTR:\n\t\t\treturn types[TYPE_SYSTEM_INTPTR];\n\n\t\tcase ELEMENT_TYPE_VALUETYPE:\n\t\tcase ELEMENT_TYPE_CLASS:\n\t\t\tentry = MetaData_DecodeSigEntryToken(pSig);\n\t\t\treturn MetaData_GetTypeDefFromDefRefOrSpec(pMetaData, entry, ppClassTypeArgs, ppMethodTypeArgs);\n\n\t\tcase ELEMENT_TYPE_VAR:\n\t\t\tentry = MetaData_DecodeSigEntry(pSig); // This is the argument number\n\t\t\tif (ppClassTypeArgs == NULL) {\n\t\t\t\t// Return null here as we don't yet know what the type really is.\n\t\t\t\t// The generic instantiation code figures this out later.\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t\t\t\treturn ppClassTypeArgs[entry];\n\t\t\t}\n\n\t\tcase ELEMENT_TYPE_GENERICINST:\n\t\t\t{\n\t\t\t\ttMD_TypeDef *pType;\n\n\t\t\t\tpType = Generics_GetGenericTypeFromSig(pMetaData, pSig, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\treturn pType;\n\t\t\t}\n\n\t\t//case ELEMENT_TYPE_INTPTR:\n\t\t//\treturn types[TYPE_SYSTEM_INTPTR];\n\n\t\tcase ELEMENT_TYPE_UINTPTR:\n\t\t\treturn types[TYPE_SYSTEM_UINTPTR];\n\n\t\tcase ELEMENT_TYPE_OBJECT:\n\t\t\treturn types[TYPE_SYSTEM_OBJECT];\n\n\t\tcase ELEMENT_TYPE_SZARRAY:\n\t\t\t{\n\t\t\t\ttMD_TypeDef *pElementType;\n\n\t\t\t\tpElementType = Type_GetTypeFromSig(pMetaData, pSig, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t\treturn Type_GetArrayTypeDef(pElementType, ppClassTypeArgs, ppMethodTypeArgs);\n\t\t\t}\n\n\t\tcase ELEMENT_TYPE_MVAR:\n\t\t\tentry = MetaData_DecodeSigEntry(pSig); // This is the argument number\n\t\t\tif (ppMethodTypeArgs == NULL) {\n\t\t\t\t// Can't do anything sensible, as we don't have any type args\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t\t\t\treturn ppMethodTypeArgs[entry];\n\t\t\t}\n\n\t\tdefault:\n\t\t\tCrash(\"Type_GetTypeFromSig(): Cannot handle signature element type: 0x%02x\", entry);\n\t\t\tFAKE_RETURN;\n\t}\n}\n\ntMD_TypeDef **types;\nstatic U32 numInitTypes;\n\ntypedef struct tTypeInit_ tTypeInit;\nstruct tTypeInit_ {\n\tchar *assemblyName;\n\tchar *nameSpace;\n\tchar *name;\n\tU8 stackType;\n\tU8 stackSize;\n\tU8 arrayElementSize;\n\tU8 instanceMemSize;\n};\n\nstatic char mscorlib[] = \"mscorlib\";\nstatic char System[] = \"System\";\nstatic char SystemCollectionsGeneric[] = \"System.Collections.Generic\";\nstatic char SystemThreading[] = \"System.Threading\";\nstatic char SystemIO[] = \"System.IO\";\nstatic char SystemGlobalization[] = \"System.Globalization\";\n\nstatic tTypeInit typeInit[] = {\n\t{mscorlib, System, \"Object\", EVALSTACK_O,\t\t4, 4, 0},\n\t{mscorlib, System, \"Array\", EVALSTACK_O,\t\t4, 4, 0},\n\t{mscorlib, System, \"Void\", EVALSTACK_O,\t\t\t4, 4, 0},\n\t{mscorlib, System, \"Boolean\", EVALSTACK_INT32,\t4, 4, 4},\n\t{mscorlib, System, \"Byte\", EVALSTACK_INT32,\t\t4, 1, 4},\n\t{mscorlib, System, \"SByte\", EVALSTACK_INT32,\t4, 1, 4},\n\t{mscorlib, System, \"Char\", EVALSTACK_INT32,\t\t4, 2, 4},\n\t{mscorlib, System, \"Int16\", EVALSTACK_INT32,\t4, 2, 4},\n\t{mscorlib, System, \"Int32\", EVALSTACK_INT32,\t4, 4, 4},\n\t{mscorlib, System, \"String\", EVALSTACK_O,\t\t4, 4, 0},\n\t{mscorlib, System, \"IntPtr\", EVALSTACK_PTR,\t\tsizeof(void*), sizeof(void*), 0},\n\t{mscorlib, System, \"RuntimeFieldHandle\", EVALSTACK_O, 4, 4, 0},\n\t{mscorlib, System, \"InvalidCastException\", EVALSTACK_O, 0, 0, 0},\n\t{mscorlib, System, \"UInt32\", EVALSTACK_INT32,\t4, 4, 4},\n\t{mscorlib, System, \"UInt16\", EVALSTACK_INT32,\t4, 2, 4},\n\t{NULL, NULL, (char*)TYPE_SYSTEM_CHAR, 0, 0, 0, 0},\n\t{NULL, NULL, (char*)TYPE_SYSTEM_OBJECT, 0, 0, 0, 0},\n\t{mscorlib, SystemCollectionsGeneric, \"IEnumerable`1\", EVALSTACK_O,\t4, 4, 0},\n\t{mscorlib, SystemCollectionsGeneric, \"ICollection`1\", EVALSTACK_O,\t4, 4, 0},\n\t{mscorlib, SystemCollectionsGeneric, \"IList`1\", EVALSTACK_O,\t\t4, 4, 0},\n\t{mscorlib, System, \"MulticastDelegate\", EVALSTACK_O,\t\t\t\t0, 0, 0},\n\t{mscorlib, System, \"NullReferenceException\", EVALSTACK_O,\t\t\t0, 0, 0},\n\t{mscorlib, System, \"Single\", EVALSTACK_F32,\t\t4, 4, 4},\n\t{mscorlib, System, \"Double\", EVALSTACK_F64,\t\t8, 8, 8},\n\t{mscorlib, System, \"Int64\", EVALSTACK_INT64,\t8, 8, 8},\n\t{mscorlib, System, \"UInt64\", EVALSTACK_INT64,\t8, 8, 8},\n\t{mscorlib, System, \"RuntimeType\", EVALSTACK_O,\t4, 4, sizeof(tRuntimeType)},\n\t{mscorlib, System, \"Type\", EVALSTACK_O,\t\t\t4, 4, 0},\n\t{mscorlib, System, \"RuntimeTypeHandle\", EVALSTACK_O, 4, 4, 0},\n\t{mscorlib, System, \"RuntimeMethodHandle\", EVALSTACK_O, 4, 4, 0},\n\t{mscorlib, System, \"Enum\", EVALSTACK_VALUETYPE, 0, 0, 0},\n\t{NULL, NULL, (char*)TYPE_SYSTEM_STRING, 0, 0, 0, 0},\n\t{NULL, NULL, (char*)TYPE_SYSTEM_INT32, 0, 0, 0, 0},\n\t{mscorlib, SystemThreading, \"Thread\", EVALSTACK_O, 4, 4, sizeof(tThread)},\n\t{mscorlib, SystemThreading, \"ThreadStart\", EVALSTACK_O, 0, 0, 0},\n\t{mscorlib, SystemThreading, \"ParameterizedThreadStart\", EVALSTACK_O, 0, 0, 0},\n\t{mscorlib, System, \"WeakReference\", EVALSTACK_O, 4, 4, 0},\n\t{mscorlib, SystemIO, \"FileMode\", EVALSTACK_O, 0, 0, 0},\n\t{mscorlib, SystemIO, \"FileAccess\", EVALSTACK_O, 0, 0, 0},\n\t{mscorlib, SystemIO, \"FileShare\", EVALSTACK_O, 0, 0, 0},\n\t{NULL, NULL, (char*)TYPE_SYSTEM_BYTE, 0, 0, 0, 0},\n\t{mscorlib, SystemGlobalization, \"UnicodeCategory\", EVALSTACK_INT32,\t0, 0, 0},\n\t{mscorlib, System, \"OverflowException\", EVALSTACK_O,\t\t\t\t0, 0, 0},\n\t{mscorlib, System, \"PlatformID\", EVALSTACK_INT32,\t\t\t\t\t0, 0, 0},\n\t{mscorlib, SystemIO, \"FileAttributes\", EVALSTACK_O, 0, 0, 0},\n\t{mscorlib, System, \"UIntPtr\", EVALSTACK_PTR,\t\tsizeof(void*), sizeof(void*), 0},\n\t{mscorlib, System, \"Nullable`1\", EVALSTACK_VALUETYPE, 0, 0, 0},\n\t{NULL, NULL, (char*)TYPE_SYSTEM_TYPE, 0, 0, 0, 0},\n};\n\nint CorLibDone = 0;\n\nvoid Type_Init() {\n\tU32 i;\n\n\t// Build all the types needed by the interpreter.\n\tnumInitTypes = sizeof(typeInit) / sizeof(typeInit[0]);\n\ttypes = (tMD_TypeDef**)mallocForever(numInitTypes * sizeof(tMD_TypeDef*));\n\tfor (i=0; i<numInitTypes; i++) {\n\t\tif (typeInit[i].assemblyName != NULL) {\n\t\t\t// Normal type initialisation\n\t\t\ttypes[i] = MetaData_GetTypeDefFromFullName(typeInit[i].assemblyName, typeInit[i].nameSpace, typeInit[i].name);\n\t\t\t// For the pre-defined system types, fill in the well-known memory sizes\n\t\t\ttypes[i]->stackType = typeInit[i].stackType;\n\t\t\ttypes[i]->stackSize = typeInit[i].stackSize;\n\t\t\ttypes[i]->arrayElementSize = typeInit[i].arrayElementSize;\n\t\t\ttypes[i]->instanceMemSize = typeInit[i].instanceMemSize;\n\t\t}\n\t}\n\tfor (i=0; i<numInitTypes; i++) {\n\t\tif (typeInit[i].assemblyName != NULL) {\n\t\t\tMetaData_Fill_TypeDef(types[i], NULL, NULL);\n\t\t} else {\n\t\t\t// Special initialisation for arrays of particular types.\n\t\t\ttypes[i] = Type_GetArrayTypeDef(types[(U32)(typeInit[i].name)], NULL, NULL);\n\t\t}\n\t}\n\tCorLibDone = 1;\n}\n\nU32 Type_IsMethod(tMD_MethodDef *pMethod, STRING name, tMD_TypeDef *pReturnType, U32 numParams, U8 *pParamTypeIndexs) {\n\tSIG sig;\n\tU32 sigLen, numSigParams, i, nameLen;\n\n\tnameLen = (U32)strlen(name);\n\tif (name[nameLen-1] == '>') {\n\t\t// Generic instance method\n\t\tif (strncmp(pMethod->name, name, nameLen - 1) != 0) {\n\t\t\treturn 0;\n\t\t}\n\t} else {\n\t\tif (strcmp(pMethod->name, name) != 0) {\n\t\t\treturn 0;\n\t\t}\n\t}\n\n\tsig = MetaData_GetBlob(pMethod->signature, &sigLen);\n\ti = MetaData_DecodeSigEntry(&sig); // Don't care about this\n\tif (i & SIG_METHODDEF_GENERIC) {\n\t\tMetaData_DecodeSigEntry(&sig);\n\t}\n\tnumSigParams = MetaData_DecodeSigEntry(&sig);\n\n\tif (numParams != numSigParams) {\n\t\treturn 0;\n\t}\n\n\tif (pReturnType == types[TYPE_SYSTEM_VOID]) {\n\t\tpReturnType = NULL;\n\t}\n\n\tfor (i=0; i<numParams + 1; i++) {\n\t\ttMD_TypeDef *pSigType, *pParamType;\n\n\t\tpSigType = Type_GetTypeFromSig(pMethod->pMetaData, &sig, NULL, NULL);\n\t\tpParamType = (i == 0)?pReturnType:types[pParamTypeIndexs[i-1]];\n\n\t\tif (pSigType != NULL && TYPE_ISARRAY(pSigType) && pParamType == types[TYPE_SYSTEM_ARRAY_NO_TYPE]) {\n\t\t\t// It's ok...\n\t\t} else {\n\t\t\tif (pSigType != pParamType) {\n\t\t\t\tgoto endBad;\n\t\t\t}\n\t\t}\n\t}\n\treturn 1;\n\nendBad:\n\treturn 0;\n}\n\nU32 Type_IsDerivedFromOrSame(tMD_TypeDef *pBaseType, tMD_TypeDef *pTestType) {\n\twhile (pTestType != NULL) {\n\t\tif (pTestType == pBaseType) {\n\t\t\treturn 1;\n\t\t}\n\t\tMetaData_Fill_TypeDef(pTestType, NULL, NULL);\n\t\tpTestType = pTestType->pParent;\n\t}\n\treturn 0;\n}\n\nU32 Type_IsImplemented(tMD_TypeDef *pInterface, tMD_TypeDef *pTestType) {\n\tU32 i;\n\n\tfor (i=0; i<pTestType->numInterfaces; i++) {\n\t\tif (pTestType->pInterfaceMaps[i].pInterface == pInterface) {\n\t\t\treturn 1;\n\t\t}\n\t}\n\treturn 0;\n}\n\nU32 Type_IsAssignableFrom(tMD_TypeDef *pToType, tMD_TypeDef *pFromType) {\n\treturn\n\t\tType_IsDerivedFromOrSame(pToType, pFromType) ||\n\t\t(TYPE_ISINTERFACE(pToType) && Type_IsImplemented(pToType, pFromType));\n}\n\nHEAP_PTR Type_GetTypeObject(tMD_TypeDef *pTypeDef) {\n\tif (pTypeDef->typeObject == NULL) {\n\t\tpTypeDef->typeObject = RuntimeType_New(pTypeDef);\n\t}\n\treturn pTypeDef->typeObject;\n}"
  },
  {
    "path": "dna/Type.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__TYPE_H)\n#define __TYPE_H\n\n#include \"MetaData.h\"\n#include \"Types.h\"\n\n#define ELEMENT_TYPE_VOID\t\t0x01\n#define ELEMENT_TYPE_BOOLEAN\t0x02\n#define ELEMENT_TYPE_CHAR\t\t0x03\n#define ELEMENT_TYPE_I1\t\t\t0x04\n#define ELEMENT_TYPE_U1\t\t\t0x05\n#define ELEMENT_TYPE_I2\t\t\t0x06\n#define ELEMENT_TYPE_U2\t\t\t0x07\n#define ELEMENT_TYPE_I4\t\t\t0x08\n#define ELEMENT_TYPE_U4\t\t\t0x09\n#define ELEMENT_TYPE_I8\t\t\t0x0a\n#define ELEMENT_TYPE_U8\t\t\t0x0b\n#define ELEMENT_TYPE_R4\t\t\t0x0c\n#define ELEMENT_TYPE_R8\t\t\t0x0d\n#define ELEMENT_TYPE_STRING\t\t0x0e\n#define ELEMENT_TYPE_PTR\t\t0x0f\n#define ELEMENT_TYPE_BYREF\t\t0x10\n#define ELEMENT_TYPE_VALUETYPE\t0x11\n#define ELEMENT_TYPE_CLASS\t\t0x12\n#define ELEMENT_TYPE_VAR\t\t0x13 // Generic argument type\n\n#define ELEMENT_TYPE_GENERICINST 0x15\n\n#define ELEMENT_TYPE_INTPTR\t\t0x18\n#define ELEMENT_TYPE_UINTPTR\t0x19\n\n#define ELEMENT_TYPE_OBJECT\t\t0x1c\n#define ELEMENT_TYPE_SZARRAY\t0x1d\n#define ELEMENT_TYPE_MVAR\t\t0x1e\n\n\nextern tMD_TypeDef **types;\n#define TYPE_SYSTEM_OBJECT 0\n#define TYPE_SYSTEM_ARRAY_NO_TYPE 1\n#define TYPE_SYSTEM_VOID 2\n#define TYPE_SYSTEM_BOOLEAN 3\n#define TYPE_SYSTEM_BYTE 4\n#define TYPE_SYSTEM_SBYTE 5\n#define TYPE_SYSTEM_CHAR 6\n#define TYPE_SYSTEM_INT16 7\n#define TYPE_SYSTEM_INT32 8\n#define TYPE_SYSTEM_STRING 9\n#define TYPE_SYSTEM_INTPTR 10\n#define TYPE_SYSTEM_RUNTIMEFIELDHANDLE 11\n#define TYPE_SYSTEM_INVALIDCASTEXCEPTION 12\n#define TYPE_SYSTEM_UINT32 13\n#define TYPE_SYSTEM_UINT16 14\n#define TYPE_SYSTEM_ARRAY_CHAR 15\n#define TYPE_SYSTEM_ARRAY_OBJECT 16\n#define TYPE_SYSTEM_COLLECTIONS_GENERIC_IENUMERABLE_T 17\n#define TYPE_SYSTEM_COLLECTIONS_GENERIC_ICOLLECTION_T 18\n#define TYPE_SYSTEM_COLLECTIONS_GENERIC_ILIST_T 19\n#define TYPE_SYSTEM_MULTICASTDELEGATE 20\n#define TYPE_SYSTEM_NULLREFERENCEEXCEPTION 21\n#define TYPE_SYSTEM_SINGLE 22\n#define TYPE_SYSTEM_DOUBLE 23\n#define TYPE_SYSTEM_INT64 24\n#define TYPE_SYSTEM_UINT64 25\n#define TYPE_SYSTEM_RUNTIMETYPE 26\n#define TYPE_SYSTEM_TYPE 27\n#define TYPE_SYSTEM_RUNTIMETYPEHANDLE 28\n#define TYPE_SYSTEM_RUNTIMEMETHODHANDLE 29\n#define TYPE_SYSTEM_ENUM 30\n#define TYPE_SYSTEM_ARRAY_STRING 31\n#define TYPE_SYSTEM_ARRAY_INT32 32\n#define TYPE_SYSTEM_THREADING_THREAD 33\n#define TYPE_SYSTEM_THREADING_THREADSTART 34\n#define TYPE_SYSTEM_THREADING_PARAMETERIZEDTHREADSTART 35\n#define TYPE_SYSTEM_WEAKREFERENCE 36\n#define TYPE_SYSTEM_IO_FILEMODE 37\n#define TYPE_SYSTEM_IO_FILEACCESS 38\n#define TYPE_SYSTEM_IO_FILESHARE 39\n#define TYPE_SYSTEM_ARRAY_BYTE 40\n#define TYPE_SYSTEM_GLOBALIZATION_UNICODECATEGORY 41\n#define TYPE_SYSTEM_OVERFLOWEXCEPTION 42\n#define TYPE_SYSTEM_PLATFORMID 43\n#define TYPE_SYSTEM_IO_FILESYSTEMATTRIBUTES 44\n#define TYPE_SYSTEM_UINTPTR 45\n#define TYPE_SYSTEM_NULLABLE 46\n#define TYPE_SYSTEM_ARRAY_TYPE 47\n\n//U32 Type_IsMethod(tMD_MethodDef *pMethod, STRING name, tMD_TypeDef *pReturnType, U32 numParams, ...);\nU32 Type_IsMethod(tMD_MethodDef *pMethod, STRING name, tMD_TypeDef *pReturnType, U32 numParams, U8 *pParamTypeIndexs);\n\nvoid Type_Init();\n\nU32 Type_IsValueType(tMD_TypeDef *pTypeDef);\n\ntMD_TypeDef* Type_GetTypeFromSig(tMetaData *pMetaData, SIG *pSig, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\n\n// Is TestType derived from BaseType or the same as BaseType?\nU32 Type_IsDerivedFromOrSame(tMD_TypeDef *pBaseType, tMD_TypeDef *pTestType);\n// Does TestType implement pInterface?\nU32 Type_IsImplemented(tMD_TypeDef *pInterface, tMD_TypeDef *pTestType);\n// Can a variable of FromType be assigend to ToType?\nU32 Type_IsAssignableFrom(tMD_TypeDef *pToType, tMD_TypeDef *pFromType);\n\ntMD_TypeDef* Type_GetArrayTypeDef(tMD_TypeDef *pElementType, tMD_TypeDef **ppClassTypeArgs, tMD_TypeDef **ppMethodTypeArgs);\n\nHEAP_PTR Type_GetTypeObject(tMD_TypeDef *pTypeDef);\n\n#endif"
  },
  {
    "path": "dna/Types.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#if !defined(__TYPES_H)\n#define __TYPES_H\n\n// Indexes into the user-string heap\ntypedef unsigned int IDX_USERSTRINGS;\n\n// Index into a table. most significant byte stores which table, other 3 bytes store index\ntypedef unsigned int IDX_TABLE;\n\n// Flag types\ntypedef unsigned int FLAGS32;\ntypedef unsigned short FLAGS16;\n\n// Pointers\ntypedef unsigned char* HEAP_PTR;\ntypedef unsigned char* PTR;\ntypedef unsigned char* SIG;\ntypedef unsigned char* STRING; // UTF8/ASCII string\ntypedef unsigned short* STRING2; // UTF16 string\ntypedef unsigned char* BLOB_;\ntypedef unsigned char* GUID_;\n\n// Int types\ntypedef long long I64;\ntypedef unsigned long long U64;\n\n#ifdef WIN32\n\ntypedef int I32;\ntypedef unsigned int U32;\ntypedef short I16;\ntypedef unsigned short U16;\ntypedef char I8;\ntypedef unsigned char U8;\n\n#endif // WIN32\n\ntypedef union uConvDouble_ uConvDouble;\nunion uConvDouble_ {\n\tdouble d;\n\tU64 u64;\n\tstruct {\n\t\tU32 a;\n\t\tU32 b;\n\t} u32;\n};\n\ntypedef union uConvFloat_ uConvFloat;\nunion uConvFloat_ {\n\tfloat f;\n\tU32 u32;\n};\n\n// other types!\ntypedef unsigned short CHAR2;\n\ntypedef struct tAsyncCall_ tAsyncCall;\n\n// Native function call\ntypedef tAsyncCall* (*fnInternalCall)(PTR pThis_, PTR pParams, PTR pReturnValue);\n// Native function call check routine for blocking IO\ntypedef U32 (*fnInternalCallCheck)(PTR pThis_, PTR pParams, PTR pReturnValue, tAsyncCall *pAsync);\n\nstruct tAsyncCall_ {\n\t// If this is a sleep call, then put the sleep time in ms here.\n\t// -1 means it's not a sleep call. Inifite timeouts are not allowed.\n\tI32 sleepTime;\n\t// If this is a blocking IO call, then this is the function to poll to see if the result is available.\n\tfnInternalCallCheck checkFn;\n\t// A state pointer for general use for blocking IO calls.\n\tPTR state;\n\t// Not for most functions to use. Record the start time of this async call\n\tU64 startTime;\n};\n\n#endif\n"
  },
  {
    "path": "dna/dna.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"Compat.h\"\n#include \"Sys.h\"\n\n#include \"CLIFile.h\"\n#include \"MetaData.h\"\n#include \"Type.h\"\n#include \"Heap.h\"\n#include \"Finalizer.h\"\n#include \"System.Net.Sockets.Socket.h\"\n#include \"MethodState.h\"\n\nstatic void ShowUsage() {\n\tprintf(\"Usage:\\n\");\n\tprintf(\"\\tdna [-v] <.Net executable to execute> [.Net executable arguments]\\n\");\n\tprintf(\"\\n\");\n\tprintf(\"\\t-v  : Verbose output of files loaded and GC statistics\\n\");\n\tprintf(\"\\t-vv : More verbose output, including methods JITted and types/arrays/generics use\\n\");\n\tprintf(\"\\n\");\n\texit(1);\n}\n\nint main(int argc, char **argp) {\n\ttCLIFile *pCLIFile;\n\tchar *pFileName;\n\tU32 i;\n\tI32 retValue;\n#ifdef DIAG_TOTAL_TIME\n\tU64 startTime;\n#endif\n\n\tif (argc < 2) {\n\t\tShowUsage();\n\t}\n\n\t// Read any flags passed in\n\tfor (i=1; i < (U32)argc; i++) {\n\t\tif (argp[i][0] == '-') {\n\t\t\tU32 j;\n\n\t\t\tfor (j=1; ; j++) {\n\t\t\t\tswitch (argp[i][j]) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tgoto doneArgs;\n\t\t\t\t\tcase 'v':\n\t\t\t\t\t\tlogLevel++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tCrash(\"Invalid argument: -%c\", argp[i][1]);\n\t\t\t\t}\n\t\t\t}\ndoneArgs:;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tJIT_Execute_Init();\n\tMetaData_Init();\n\tType_Init();\n\tHeap_Init();\n\tFinalizer_Init();\n\tSocket_Init();\n\n#ifdef DIAG_OPCODE_TIMES\n#ifdef WIN32\n\t{\n\t\tHANDLE hProcess = GetCurrentProcess();\n\t\tSetProcessAffinityMask(hProcess, 1);\n\t}\n#endif\n\tmemset(opcodeTimes, 0, sizeof(opcodeTimes));\n#endif\n\n#ifdef DIAG_OPCODE_USE\n\tmemset(opcodeNumUses, 0, sizeof(opcodeNumUses));\n#endif\n\n\tpFileName = argp[i];\n\n\tpCLIFile = CLIFile_Load(pFileName);\n\n#ifdef DIAG_TOTAL_TIME\n\tstartTime = microTime();\n#endif\n\n\tretValue = CLIFile_Execute(pCLIFile, argc - i, argp + i);\n\n#ifdef DIAG_TOTAL_TIME\n\tprintf(\"Total execution time = %d ms\\n\", (int)((microTime() - startTime) / 1000));\n#endif\n\n#ifdef DIAG_GC\n\tprintf(\"Total GC time = %d ms\\n\", (int)(gcTotalTime / 1000));\n#endif\n\n#ifdef DIAG_METHOD_CALLS\n\t{\n\t\tU32 numMethods, i;\n\t\tI32 howMany = 25;\n\t\ttMetaData *pCorLib;\n\t\t// Report on most-used methods\n\t\tpCorLib = CLIFile_GetMetaDataForAssembly(\"mscorlib\");\n\t\tnumMethods = pCorLib->tables.numRows[MD_TABLE_METHODDEF];\n\t\tprintf(\"\\nCorLib method usage:\\n\");\n\t\tfor (; howMany > 0; howMany--) {\n\t\t\ttMD_MethodDef *pMethod;\n\t\t\tU32 maxCount = 0, maxIndex = 0;\n\t\t\tfor (i=1; i<=numMethods; i++) {\n\t\t\t\tpMethod = (tMD_MethodDef*)MetaData_GetTableRow(pCorLib, MAKE_TABLE_INDEX(MD_TABLE_METHODDEF, i));\n\t\t\t\tif (pMethod->callCount > maxCount) {\n\t\t\t\t\tmaxCount = pMethod->callCount;\n\t\t\t\t\tmaxIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpMethod = (tMD_MethodDef*)MetaData_GetTableRow(pCorLib, MAKE_TABLE_INDEX(MD_TABLE_METHODDEF, maxIndex));\n\t\t\tprintf(\"%d: %s (%d)\\n\", (int)pMethod->callCount, Sys_GetMethodDesc(pMethod), (int)(pMethod->totalTime/1000));\n\t\t\tpMethod->callCount = 0;\n\t\t}\n\t\tprintf(\"\\n\");\n\t}\n\t{\n\t\tU32 numMethods, i;\n\t\tI32 howMany = 25;\n\t\ttMetaData *pCorLib;\n\t\t// Report on most-used methods\n\t\tpCorLib = CLIFile_GetMetaDataForAssembly(\"mscorlib\");\n\t\tnumMethods = pCorLib->tables.numRows[MD_TABLE_METHODDEF];\n\t\tprintf(\"\\nCorLib method execution time:\\n\");\n\t\tfor (; howMany > 0; howMany--) {\n\t\t\ttMD_MethodDef *pMethod;\n\t\t\tU64 maxTime = 0;\n\t\t\tU32 maxIndex = 0;\n\t\t\tfor (i=1; i<=numMethods; i++) {\n\t\t\t\tpMethod = (tMD_MethodDef*)MetaData_GetTableRow(pCorLib, MAKE_TABLE_INDEX(MD_TABLE_METHODDEF, i));\n\t\t\t\tif (pMethod->totalTime > maxTime) {\n\t\t\t\t\tmaxTime = pMethod->totalTime;\n\t\t\t\t\tmaxIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpMethod = (tMD_MethodDef*)MetaData_GetTableRow(pCorLib, MAKE_TABLE_INDEX(MD_TABLE_METHODDEF, maxIndex));\n\t\t\tprintf(\"%d: %s (%d)\\n\", (int)pMethod->callCount, Sys_GetMethodDesc(pMethod), (int)(pMethod->totalTime/1000));\n\t\t\tpMethod->totalTime = 0;\n\t\t}\n\t\tprintf(\"\\n\");\n\t}\n#endif\n#ifdef DIAG_OPCODE_TIMES\n\t{\n\t\tI32 howMany = 25;\n\t\tU32 i;\n\t\tprintf(\"\\nOpCodes execution time:\\n\");\n\t\tfor (; howMany > 0; howMany--) {\n\t\t\tU64 maxTime = 0;\n\t\t\tU32 maxIndex = 0;\n\t\t\tfor (i=0; i<JIT_OPCODE_MAXNUM; i++) {\n\t\t\t\tif (opcodeTimes[i] > maxTime) {\n\t\t\t\t\tmaxTime = opcodeTimes[i];\n\t\t\t\t\tmaxIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tprintf(\"0x%03x: %dms (used %d times) (ave = %d)\\n\",\n\t\t\t\tmaxIndex, (int)(maxTime / 1000), (int)opcodeNumUses[maxIndex], (int)(maxTime / opcodeNumUses[maxIndex]));\n\t\t\topcodeTimes[maxIndex] = 0;\n\t\t}\n\t}\n#endif\n#ifdef DIAG_OPCODE_USE\n\t{\n\t\tI32 howMany = 25;\n\t\tU32 i, j;\n\t\tprintf(\"\\nOpcode use:\\n\");\n\t\tfor (j=1; howMany>0; howMany--, j++) {\n\t\t\tU32 maxUse = 0;\n\t\t\tU32 maxIndex = 0;\n\t\t\tfor (i=0; i<JIT_OPCODE_MAXNUM; i++) {\n\t\t\t\tif (opcodeNumUses[i] > maxUse) {\n\t\t\t\t\tmaxUse = opcodeNumUses[i];\n\t\t\t\t\tmaxIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tprintf(\"%02d 0x%03x: %d\\n\", j, maxIndex, maxUse);\n\t\t\topcodeNumUses[maxIndex] = 0;\n\t\t}\n\t}\n#endif\n\n\t//Crash(\"FINISHED!!!\");\n\n\treturn retValue;\n}\n"
  },
  {
    "path": "dna/dna.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\r\n<VisualStudioProject\r\n\tProjectType=\"Visual C++\"\r\n\tVersion=\"9.00\"\r\n\tName=\"dna\"\r\n\tProjectGUID=\"{888AAA01-F58E-4E41-8BBB-78294D9DABF7}\"\r\n\tRootNamespace=\"dna\"\r\n\tKeyword=\"Win32Proj\"\r\n\tTargetFrameworkVersion=\"131072\"\r\n\t>\r\n\t<Platforms>\r\n\t\t<Platform\r\n\t\t\tName=\"Win32\"\r\n\t\t/>\r\n\t</Platforms>\r\n\t<ToolFiles>\r\n\t</ToolFiles>\r\n\t<Configurations>\r\n\t\t<Configuration\r\n\t\t\tName=\"Debug|Win32\"\r\n\t\t\tOutputDirectory=\"$(ProjectDir)$(ConfigurationName)\"\r\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\r\n\t\t\tConfigurationType=\"1\"\r\n\t\t\tCharacterSet=\"1\"\r\n\t\t\t>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPreBuildEventTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCCustomBuildTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCMIDLTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCCLCompilerTool\"\r\n\t\t\t\tOptimization=\"0\"\r\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_CONSOLE\"\r\n\t\t\t\tMinimalRebuild=\"true\"\r\n\t\t\t\tBasicRuntimeChecks=\"3\"\r\n\t\t\t\tRuntimeLibrary=\"3\"\r\n\t\t\t\tUsePrecompiledHeader=\"0\"\r\n\t\t\t\tWarningLevel=\"3\"\r\n\t\t\t\tDetect64BitPortabilityProblems=\"true\"\r\n\t\t\t\tDebugInformationFormat=\"4\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCResourceCompilerTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPreLinkEventTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCLinkerTool\"\r\n\t\t\t\tAdditionalDependencies=\"ws2_32.lib\"\r\n\t\t\t\tLinkIncremental=\"2\"\r\n\t\t\t\tGenerateDebugInformation=\"true\"\r\n\t\t\t\tSubSystem=\"1\"\r\n\t\t\t\tRandomizedBaseAddress=\"1\"\r\n\t\t\t\tDataExecutionPrevention=\"0\"\r\n\t\t\t\tTargetMachine=\"1\"\r\n\t\t\t\tProfile=\"true\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCALinkTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCManifestTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCXDCMakeTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCBscMakeTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCFxCopTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCAppVerifierTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPostBuildEventTool\"\r\n\t\t\t\tCommandLine=\"copy $(TargetDir)$(TargetFileName) $(SolutionDir)Builds\\$(ConfigurationName)\\\"\r\n\t\t\t/>\r\n\t\t</Configuration>\r\n\t\t<Configuration\r\n\t\t\tName=\"Release|Win32\"\r\n\t\t\tOutputDirectory=\"$(ProjectDir)$(ConfigurationName)\"\r\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\r\n\t\t\tConfigurationType=\"1\"\r\n\t\t\tCharacterSet=\"1\"\r\n\t\t\tWholeProgramOptimization=\"1\"\r\n\t\t\t>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPreBuildEventTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCCustomBuildTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCMIDLTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCCLCompilerTool\"\r\n\t\t\t\tOptimization=\"3\"\r\n\t\t\t\tInlineFunctionExpansion=\"2\"\r\n\t\t\t\tEnableIntrinsicFunctions=\"true\"\r\n\t\t\t\tOmitFramePointers=\"true\"\r\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_CONSOLE;\"\r\n\t\t\t\tRuntimeLibrary=\"2\"\r\n\t\t\t\tUsePrecompiledHeader=\"0\"\r\n\t\t\t\tWarningLevel=\"3\"\r\n\t\t\t\tDetect64BitPortabilityProblems=\"true\"\r\n\t\t\t\tDebugInformationFormat=\"3\"\r\n\t\t\t\tCompileAs=\"1\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCResourceCompilerTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPreLinkEventTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCLinkerTool\"\r\n\t\t\t\tAdditionalDependencies=\"ws2_32.lib\"\r\n\t\t\t\tLinkIncremental=\"1\"\r\n\t\t\t\tGenerateDebugInformation=\"true\"\r\n\t\t\t\tSubSystem=\"1\"\r\n\t\t\t\tOptimizeReferences=\"2\"\r\n\t\t\t\tEnableCOMDATFolding=\"2\"\r\n\t\t\t\tRandomizedBaseAddress=\"1\"\r\n\t\t\t\tDataExecutionPrevention=\"0\"\r\n\t\t\t\tTargetMachine=\"1\"\r\n\t\t\t\tProfile=\"true\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCALinkTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCManifestTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCXDCMakeTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCBscMakeTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCFxCopTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCAppVerifierTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPostBuildEventTool\"\r\n\t\t\t/>\r\n\t\t</Configuration>\r\n\t</Configurations>\r\n\t<References>\r\n\t</References>\r\n\t<Files>\r\n\t\t<Filter\r\n\t\t\tName=\"Source Files\"\r\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\r\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\r\n\t\t\t>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\CLIFile.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Delegate.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\dna.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Finalizer.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Generics.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Heap.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\InternalCall.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\JIT.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\JIT_Execute.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\MetaData.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\MetaData_Fill.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\MetaData_Search.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\MethodState.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\PInvoke.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\RVA.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Sys.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Thread.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Type.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<Filter\r\n\t\t\t\tName=\"Internal\"\r\n\t\t\t\t>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Array.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Char.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Console.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.DateTime.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Diagnostics.Debugger.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Enum.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Environment.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.GC.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.IO.FileInternal.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Math.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Net.Dns.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Net.Sockets.Socket.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Object.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Runtime.CompilerServices.RuntimeHelpers.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.RuntimeType.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.String.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Threading.Interlocked.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Threading.Monitor.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Threading.Thread.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Type.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.ValueType.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.WeakReference.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t</Filter>\r\n\t\t</Filter>\r\n\t\t<Filter\r\n\t\t\tName=\"Header Files\"\r\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\r\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\r\n\t\t\t>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\CIL_OpCodes.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\CLIFile.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Compat.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Config.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Delegate.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\EvalStack.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Finalizer.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Generics.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Heap.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\InternalCall.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\JIT.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\JIT_OpCodes.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\MetaData.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\MetaDataTables.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\MethodState.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\PInvoke.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\PInvoke_CaseCode.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\PInvoke_TypeDef.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\RVA.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Sys.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Thread.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Type.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Types.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<Filter\r\n\t\t\t\tName=\"Internal\"\r\n\t\t\t\t>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Array.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Char.CaseConversion.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Char.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Char.UC_IndexRuns.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Console.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.DateTime.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Diagnostics.Debugger.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Enum.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Environment.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.GC.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.IO.FileInternal.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Math.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Net.Dns.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Net.Sockets.Socket.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Object.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Runtime.CompilerServices.RuntimeHelpers.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.RuntimeType.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.String.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Threading.Interlocked.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Threading.Monitor.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Threading.Thread.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.Type.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.ValueType.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\System.WeakReference.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t</Filter>\r\n\t\t</Filter>\r\n\t\t<Filter\r\n\t\t\tName=\"Resource Files\"\r\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav\"\r\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\r\n\t\t\t>\r\n\t\t</Filter>\r\n\t</Files>\r\n\t<Globals>\r\n\t</Globals>\r\n</VisualStudioProject>\r\n"
  },
  {
    "path": "dna.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 11\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"dna\", \"dna\\dna.vcxproj\", \"{888AAA01-F58E-4E41-8BBB-78294D9DABF7}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"libIGraph\", \"libIGraph\\libIGraph.vcxproj\", \"{E8C90D0B-0F97-485C-8765-FC14202EF252}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Win32 = Debug|Win32\n\t\tRelease|Win32 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{888AAA01-F58E-4E41-8BBB-78294D9DABF7}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{888AAA01-F58E-4E41-8BBB-78294D9DABF7}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{888AAA01-F58E-4E41-8BBB-78294D9DABF7}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{888AAA01-F58E-4E41-8BBB-78294D9DABF7}.Release|Win32.Build.0 = Release|Win32\n\t\t{E8C90D0B-0F97-485C-8765-FC14202EF252}.Debug|Win32.ActiveCfg = Debug|Win32\n\t\t{E8C90D0B-0F97-485C-8765-FC14202EF252}.Debug|Win32.Build.0 = Debug|Win32\n\t\t{E8C90D0B-0F97-485C-8765-FC14202EF252}.Release|Win32.ActiveCfg = Release|Win32\n\t\t{E8C90D0B-0F97-485C-8765-FC14202EF252}.Release|Win32.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "libIGraph/Bitmap.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Bitmap.h\"\n#include \"Graphics.h\"\n\ntBitmap* CreateBitmap_(I32 width, I32 height, U32 pixelFormat) {\n\ttBitmap *pBitmap;\n\tU32 bitsPerPixel;\n\tU32 memSize, stride;\n\tU32 ok;\n\t\n\tswitch (pixelFormat) {\n\t\tcase PixelFormat_Format32bppArgb:\n\t\t\tbitsPerPixel = 32;\n\t\t\tbreak;\n\t\tcase PixelFormat_Gdi:\n\t\t\tbitsPerPixel = 4;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn NULL;\n\t}\n\n\t// Ensure stride is always a multiple of 32 bits\n\tstride = (width * bitsPerPixel + 31) & 0xffffffe0;\n\tstride /= 8;\n\tmemSize = stride * height;\n\tpBitmap = malloc(sizeof(tBitmap) + memSize);\n\n\tok = InitImage(&pBitmap->image, IMAGE_TYPE_BITMAP, width, height, pixelFormat);\n\tif (!ok) {\n\t\tfree(pBitmap);\n\t\treturn NULL;\n\t}\n\n\tmemset(pBitmap->pBmp, 0, memSize);\n\tpBitmap->memSize = memSize;\n\tpBitmap->stride = stride;\n\n\treturn pBitmap;\n}\n\ntGraphics* GetGraphicsFromBitmap_(tBitmap *pBitmap) {\n\ttGraphics *pGraphics = InitGraphics();\n\n\tpGraphics->memSize = pBitmap->memSize;\n\tpGraphics->pImage = (tImage*)pBitmap;\n\tpGraphics->pixelFormat = pBitmap->image.pixelFormat;\n\tpGraphics->pixelFormatIndex = pBitmap->image.pixelFormatIndex;\n\tpGraphics->pScan0 = pBitmap->pBmp;\n\tpGraphics->screenPtr = NULL;\n\tpGraphics->stride = pBitmap->stride;\n\tpGraphics->textRenderingHint = TextRenderingHint_SystemDefault;\n\tpGraphics->xSize = pBitmap->image.width;\n\tpGraphics->ySize = pBitmap->image.height;\n\n\treturn pGraphics;\n}\n\n"
  },
  {
    "path": "libIGraph/Bitmap.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __BITMAP_H\n#define __BITMAP_H\n\n#include \"libIGraph.h\"\n\n#include \"Image.h\"\n\ntypedef struct tBitmap_ tBitmap;\nstruct tBitmap_ {\n\ttImage image;\n\tU32 memSize;\n\tU32 stride;\n\tU8 pBmp[0];\n};\n\ntBitmap* CreateBitmap_(I32 width, I32 height, U32 pixelFormat);\ntGraphics* GetGraphicsFromBitmap_(tBitmap *pBitmap);\ntBitmap* BitmapFromFile_(STRING filename, I32 *pWidth, I32 *pHeight, U32 *pPixelFormat);\n\n#endif\n"
  },
  {
    "path": "libIGraph/BitmapLoader.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Bitmap.h\"\n\n#include \"tinyjpeg.h\"\n\ntypedef struct tBitmapFileHeader_ tBitmapFileHeader;\nstruct tBitmapFileHeader_ {\n\tU16 bfType;\n\tU32 bfSize;\n\tU16 bfReserved1;\n\tU16 bfReserved2;\n\tU32 bfOffBits;\n};\n\ntypedef struct tBitmapInfoHeader_ tBitmapInfoHeader;\nstruct tBitmapInfoHeader_ {\n\tU32 biSize;\n\tI32 biWidth;\n\tI32 biHeight;\n\tU16 biPlanes;\n\tU16 biBitCount;\n\tU32 biCompression;\n\tU32 biSizeImage;\n\tI32 biXPelsPerMetre;\n\tI32 biYPelsPerMetre;\n\tU32 biClrUsed;\n\tU32 biClrImportant;\n};\n\ntypedef struct tRGBQuad_ tRGBQuad;\nstruct tRGBQuad_ {\n\tU8 blue;\n\tU8 green;\n\tU8 red;\n\tU8 unused;\n};\n\n#define BI_RGB        0L\n#define BI_RLE8       1L\n#define BI_RLE4       2L\n\ntBitmap* LoadBMP(U8 *pFile, I32 *pWidth, I32 *pHeight, U32 *pPixelFormat) {\n\ttBitmapInfoHeader bih;\n\ttBitmap *pBmp;\n\tU8 u8;\n\tU32 x, y, r, g, b, col, col2;\n\tU32 width, height;\n\tU32 linePadding;\n\tU8 *pFilePicMem;\n\tU32 *pBmpMem;\n\tU32 i;\n\ttRGBQuad *pColTable;\n\n\t// Need to do it this way as the data is not 32-bit aligned in file :(\n\tmemcpy(&bih, pFile + 14, sizeof(tBitmapInfoHeader));\n\tif (bih.biSize != 40) {\n\t\t// Only handle BMP v3 files\n\t\treturn NULL;\n\t}\n\n\tpBmp = CreateBitmap_(bih.biWidth, bih.biHeight, PixelFormat_Format32bppArgb);\n\t*pWidth = width = pBmp->image.width;\n\t*pHeight = height = pBmp->image.height;\n\t*pPixelFormat = pBmp->image.pixelFormat;\n\tpBmpMem = (U32*)(pBmp->pBmp + (bih.biHeight-1) * pBmp->stride);\n\tpFilePicMem = pFile + 14 + sizeof(tBitmapInfoHeader);\n\n\tswitch (bih.biBitCount) {\n\t\tcase 4:\n\t\t\tpColTable = (tRGBQuad*)pFilePicMem;\n\t\t\tpFilePicMem += 16 * 4;\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tpColTable = (tRGBQuad*)pFilePicMem;\n\t\t\tpFilePicMem += 256 * 4;\n\t\t\tbreak;\n\t}\n\n\tlinePadding = (32 - ((((bih.biBitCount * bih.biWidth) & 0x1f)) >> 3)) & 0x3;\n\n\tswitch (bih.biBitCount) {\n\t\tcase 4:\n\t\t\tswitch (bih.biCompression) {\n\t\t\t\tcase BI_RGB:\n\t\t\t\t\tfor (y=0; y<height; y++) {\n\t\t\t\t\t\tfor (x=0; x<(width>>1); x++) {\n\t\t\t\t\t\t\tcol2 = *pFilePicMem++;\n\t\t\t\t\t\t\tcol = col2 >> 4;\n\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\tcol = ARGB(255, r, g, b);\n\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t\tcol = col2 & 0xf;\n\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\tcol = ARGB(255, r, g, b);\n\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (width & 1) {\n\t\t\t\t\t\t\tcol2 = *pFilePicMem++;\n\t\t\t\t\t\t\tcol = col2 >> 4;\n\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\tcol = ARGB(255, r, g, b);\n\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpBmpMem -= pBmp->stride >> 1;\n\t\t\t\t\t\tpFilePicMem += linePadding;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase BI_RLE4:\n\t\t\t\t\tx = y = 0;\n\t\t\t\t\tfor (;;) {\n\t\t\t\t\t\tu8 = *pFilePicMem++;\n\t\t\t\t\t\tif (u8 == 0) {\n\t\t\t\t\t\t\tu8 = *pFilePicMem++;\n\t\t\t\t\t\t\tswitch (u8) {\n\t\t\t\t\t\t\t\tcase 0: // End of line\n\t\t\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\t\t\t\tif (y > (U32)bih.biHeight) {\n\t\t\t\t\t\t\t\t\t\tgoto doneBad;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor (; x < (U32)bih.biWidth; x++) {\n\t\t\t\t\t\t\t\t\t\t*pBmpMem++ = ARGB(255,0,0,0);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tx = 0;\n\t\t\t\t\t\t\t\t\tpBmpMem -= pBmp->stride >> 1;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 1: // End of bitmap\n\t\t\t\t\t\t\t\t\tgoto doneGood;\n\t\t\t\t\t\t\t\tcase 2: // Delta - can only handle horizontal deltas\n\t\t\t\t\t\t\t\t\tu8 = *pFilePicMem++;\n\t\t\t\t\t\t\t\t\tif (*pFilePicMem++ != 0) {\n\t\t\t\t\t\t\t\t\t\tgoto doneBad;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor (i=u8 - 1; i>0; i--) {\n\t\t\t\t\t\t\t\t\t\t*pBmpMem++ = ARGB(255,0,0,0);\n\t\t\t\t\t\t\t\t\t\tx++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault: // absolute mode\n\t\t\t\t\t\t\t\t\tx += u8;\n\t\t\t\t\t\t\t\t\tif (x > (U32)bih.biWidth) {\n\t\t\t\t\t\t\t\t\t\t// Problem with bitmap file - too many pixels in row\n\t\t\t\t\t\t\t\t\t\tgoto doneBad;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor (i=u8 >> 1; i>0; i--) {\n\t\t\t\t\t\t\t\t\t\tcol2 = *pFilePicMem++;\n\t\t\t\t\t\t\t\t\t\tcol = col2 >> 4;\n\t\t\t\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\t\t\t\tcol = ARGB(255, r, b, g);\n\t\t\t\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t\t\t\t\tcol = col2 & 0x0f;\n\t\t\t\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\t\t\t\tcol = ARGB(255, r, b, g);\n\t\t\t\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (u8 & 1) {\n\t\t\t\t\t\t\t\t\t\tcol = *pFilePicMem++;\n\t\t\t\t\t\t\t\t\t\tcol >>= 4;\n\t\t\t\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\t\t\t\tcol = ARGB(255, r, b, g);\n\t\t\t\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ((u8 & 0x3) == 1 || (u8 & 0x3) == 2) {\n\t\t\t\t\t\t\t\t\t\tpFilePicMem++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tx += u8;\n\t\t\t\t\t\t\tif (x > (U32)bih.biWidth) {\n\t\t\t\t\t\t\t\t// Problem with bitmap file - too many pixels in row\n\t\t\t\t\t\t\t\tgoto doneBad;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcol2 = *pFilePicMem++;\n\t\t\t\t\t\t\tcol = col2 >> 4;\n\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\tcol = ARGB(255, r, g, b);\n\t\t\t\t\t\t\tcol2 &= 0x0f;\n\t\t\t\t\t\t\tr = pColTable[col2].red;\n\t\t\t\t\t\t\tg = pColTable[col2].green;\n\t\t\t\t\t\t\tb = pColTable[col2].blue;\n\t\t\t\t\t\t\tcol2 = ARGB(255, r, g, b);\n\t\t\t\t\t\t\tfor (i=u8 >> 1; i>0; i--) {\n\t\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t\t\t*pBmpMem++ = col2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (u8 & 1) {\n\t\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tgoto doneBad;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 8:\n\t\t\tswitch (bih.biCompression) {\n\t\t\t\tcase BI_RGB:\n\t\t\t\t\tfor (y=0; y<height; y++) {\n\t\t\t\t\t\tfor (x=0; x<width; x++) {\n\t\t\t\t\t\t\tcol = *pFilePicMem++;\n\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\tcol = ARGB(255, r, g, b);\n\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpBmpMem -= pBmp->stride >> 1;\n\t\t\t\t\t\tpFilePicMem += linePadding;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase BI_RLE8:\n\t\t\t\t\tx = y = 0;\n\t\t\t\t\tfor (;;) {\n\t\t\t\t\t\tu8 = *pFilePicMem++;\n\t\t\t\t\t\tif (u8 == 0) {\n\t\t\t\t\t\t\tu8 = *pFilePicMem++;\n\t\t\t\t\t\t\tswitch (u8) {\n\t\t\t\t\t\t\t\tcase 0: // End of line\n\t\t\t\t\t\t\t\t\ty++;\n\t\t\t\t\t\t\t\t\tif (y > (U32)bih.biHeight) {\n\t\t\t\t\t\t\t\t\t\tgoto doneBad;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor (; x < (U32)bih.biWidth; x++) {\n\t\t\t\t\t\t\t\t\t\t*pBmpMem++ = ARGB(255,0,0,0);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tx = 0;\n\t\t\t\t\t\t\t\t\tpBmpMem -= pBmp->stride >> 1;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase 1: // End of bitmap\n\t\t\t\t\t\t\t\t\tgoto doneGood;\n\t\t\t\t\t\t\t\tcase 2: // Delta - can't handle these\n\t\t\t\t\t\t\t\t\tgoto doneBad;\n\t\t\t\t\t\t\t\tdefault: // absolute mode\n\t\t\t\t\t\t\t\t\tx += u8;\n\t\t\t\t\t\t\t\t\tif (x > (U32)bih.biWidth) {\n\t\t\t\t\t\t\t\t\t\t// Problem with bitmap file - too many pixels in row\n\t\t\t\t\t\t\t\t\t\tgoto doneBad;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfor (i = u8; i>0; i--) {\n\t\t\t\t\t\t\t\t\t\tcol = *pFilePicMem++;\n\t\t\t\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\t\t\t\tcol = ARGB(255, r, b, g);\n\t\t\t\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (u8 & 1) {\n\t\t\t\t\t\t\t\t\t\tpFilePicMem++;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tx += u8;\n\t\t\t\t\t\t\tif (x > (U32)bih.biWidth) {\n\t\t\t\t\t\t\t\t// Problem with bitmap file - too many pixels in row\n\t\t\t\t\t\t\t\tgoto doneBad;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcol = *pFilePicMem++;\n\t\t\t\t\t\t\tr = pColTable[col].red;\n\t\t\t\t\t\t\tg = pColTable[col].green;\n\t\t\t\t\t\t\tb = pColTable[col].blue;\n\t\t\t\t\t\t\tcol = ARGB(255, r, b, g);\n\t\t\t\t\t\t\tfor (i=u8; i>0; i--) {\n\t\t\t\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tgoto doneBad;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 24:\n\t\t\tfor (y=0; y<height; y++) {\n\t\t\t\tfor (x=0; x<width; x++) {\n\t\t\t\t\tr = *pFilePicMem++;\n\t\t\t\t\tg = *pFilePicMem++;\n\t\t\t\t\tb = *pFilePicMem++;\n\t\t\t\t\tcol = ARGB(255, r, g, b);\n\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t}\n\t\t\t\tpBmpMem -= pBmp->stride >> 1;\n\t\t\t\tpFilePicMem += linePadding;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 32:\n\t\t\tfor (y=0; y<height; y++) {\n\t\t\t\tfor (x=0; x<width; x++) {\n\t\t\t\t\tr = *pFilePicMem++;\n\t\t\t\t\tg = *pFilePicMem++;\n\t\t\t\t\tb = *pFilePicMem++;\n\t\t\t\t\tpFilePicMem++;\n\t\t\t\t\tcol = ARGB(255, r, g, b);\n\t\t\t\t\t*pBmpMem++ = col;\n\t\t\t\t}\n\t\t\t\tpBmpMem -= pBmp->stride >> 1;\n\t\t\t\tpFilePicMem += linePadding;\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\ndoneBad:\n\t\t\tDisposeImage_((tImage*)pBmp);\n\t\t\treturn NULL;\n\t}\n\ndoneGood:\n\treturn pBmp;\n}\n\ntypedef struct tGifHeader_ tGifHeader;\nstruct tGifHeader_ {\n\tunsigned char gif[3];\n\tunsigned char version[3];\n};\n\n// This always follows directly after the GifHeader\ntypedef struct tGifLogicalScreenDescriptor_ tGifLogicalScreenDescriptor;\nstruct tGifLogicalScreenDescriptor_ {\n\tU16 width;\n\tU16 height;\n\tU8 flags;\n\tU8 transparentIndex;\n\tU8 pixelAspectRatio;\n};\n#define GIF_LSD_HAS_GLOBALCOLOURTABLE 0x80\n#define GIF_LSD_GLOBALCOLOURTABLE_SIZE_MASK 0x7\n\ntypedef struct tGifColourTableEntry_ tGifColourTableEntry;\nstruct tGifColourTableEntry_ {\n\tU8 red;\n\tU8 green;\n\tU8 blue;\n};\n\ntypedef struct tGifImageDescriptor_ tGifImageDescriptor;\nstruct tGifImageDescriptor_ {\n\tU8 imageSeparator;\n\tU8 xPos1, xPos2;\n\tU8 yPos1, yPos2;\n\tU8 width1, width2;\n\tU8 height1, height2;\n\tU8 flags;\n};\n#define GIF_ID_HAS_LOCALCOLOURTABLE 0x80\n#define GIF_ID_IS_INTERLACED 0x40\n\ntypedef struct tGifDictEntry_ tGifDictEntry;\nstruct tGifDictEntry_ {\n\tU16 prevIndex;\n\tU16 suffix;\n};\n\ntBitmap* LoadGIF(U8 *pFile, I32 *pWidth, I32 *pHeight, U32 *pPixelFormat) {\n\ttBitmap *pBmp;\n\tU32 width, height;\n\tU32 *pBmpMem;\n\ttGifLogicalScreenDescriptor *pLSD;\n\tU32 gctSize;\n\ttGifColourTableEntry *pColTable;\n\ttGifImageDescriptor *pImageDesc;\n\tU32 isInterlaced;\n\tU8 blockLen;\n\tU8 *pFileBlock;\n\tU32 bitsPerCode, codeMask;\n\tU32 clearCode, endCode;\n\tU32 curCode, curCodeBitCount;\n\ttGifDictEntry *pDict = NULL;\n\tU32 dictOfs;\n\tU32 codeSize;\n\tU32 i, w;\n\tU32 x, y;\n\tU16 *pLineRedirect = NULL;\n\t\n\tpLSD = (tGifLogicalScreenDescriptor*)(pFile + sizeof(tGifHeader));\n\tif (!(pLSD->flags & GIF_LSD_HAS_GLOBALCOLOURTABLE)) {\n\t\t// Can only decode GIF's with global colour table\n\t\treturn NULL;\n\t}\n\n\tpBmp = CreateBitmap_(pLSD->width, pLSD->height, PixelFormat_Format32bppArgb);\n\t*pWidth = width = pBmp->image.width;\n\t*pHeight = height = pBmp->image.height;\n\t*pPixelFormat = pBmp->image.pixelFormat;\n\tpBmpMem = (U32*)(pBmp->pBmp);\n\tgctSize = 1 << ((pLSD->flags & GIF_LSD_GLOBALCOLOURTABLE_SIZE_MASK) + 1);\n\tpColTable = (tGifColourTableEntry*)(((U8*)pLSD) + 7);\n\t\n\tpImageDesc = (tGifImageDescriptor*)(pColTable + gctSize);\n\tif (pImageDesc->imageSeparator != 0x2c ||\n\t\tpImageDesc->xPos1 != 0 || pImageDesc->xPos2 != 0 ||\n\t\tpImageDesc->yPos1 != 0 || pImageDesc->yPos2 != 0 ||\n\t\tpImageDesc->width1 != (width & 0xff) || pImageDesc->width2 != (width >> 8) ||\n\t\tpImageDesc->height1 != (height & 0xff) || pImageDesc->height2 != (height >> 8) ||\n\t\t(pImageDesc->flags & GIF_ID_HAS_LOCALCOLOURTABLE))  {\n\t\tgoto doneBad;\n\t}\n\tisInterlaced = pImageDesc->flags & GIF_ID_IS_INTERLACED;\n\n\tpLineRedirect = (U16*)malloc(height << 1);\n\tif (isInterlaced) {\n\t\tstatic U8 passes[] = {3,0, 3,4, 2,2, 1,1};\n\t\tU32 pass = 0, iOfs = 0;\n\t\tfor (i=0; i<height; i++) {\n\t\t\tU32 target;\nreTarget:\n\t\t\ttarget = ((i - iOfs) << passes[pass]) + passes[pass+1];\n\t\t\tif (target >= height) {\n\t\t\t\tpass += 2;\n\t\t\t\tiOfs = i;\n\t\t\t\tgoto reTarget;\n\t\t\t}\n\t\t\tpLineRedirect[i] = target;\n\t\t}\n\t} else {\n\t\tfor (i=0; i<height; i++) {\n\t\t\tpLineRedirect[i] = i;\n\t\t}\n\t}\n\n\t// Process all the image blocks\n\tpFileBlock = ((U8*)pImageDesc) + 10;\n\tcodeSize = *pFileBlock++;\n\tbitsPerCode = codeSize + 1;\n\tcodeMask = (1 << bitsPerCode) - 1;\n\tclearCode = 1 << (bitsPerCode - 1);\n\tendCode = clearCode + 1;\n\tcurCode = 0;\n\tcurCodeBitCount = 0;\n\tpDict = malloc(0x1000 * sizeof(tGifDictEntry));\n\tfor (i=0; i<clearCode; i++) {\n\t\tpDict[i].prevIndex = 0xffff;\n\t\tpDict[i].suffix = i;\n\t}\n\tw = 0xffffffff;\n\tdictOfs = endCode + 1;\n\tx = y = 0;\n\twhile ((blockLen = *pFileBlock++) != 0) {\n\t\tfor (;;) {\n\t\t\tU32 code;\n\t\t\tU32 pixelCount, codeChain, codeChain0;\n\t\t\twhile (curCodeBitCount < bitsPerCode) {\n\t\t\t\tif (blockLen == 0) {\n\t\t\t\t\tgoto blockDone;\n\t\t\t\t}\n\t\t\t\tblockLen--;\n\t\t\t\tcurCode |= (*pFileBlock++) << curCodeBitCount;\n\t\t\t\tcurCodeBitCount += 8;\n\t\t\t}\n\t\t\tcode = curCode & codeMask;\n\t\t\tcurCode >>= bitsPerCode;\n\t\t\tcurCodeBitCount -= bitsPerCode;\n\t\t\tif (code == clearCode) {\n\t\t\t\tdictOfs = endCode + 1;\n\t\t\t\tbitsPerCode = codeSize + 1;\n\t\t\t\tcodeMask = (1 << bitsPerCode) - 1;\n\t\t\t\tw = 0xffffffff;\n\t\t\t} else if (code == endCode) {\n\t\t\t\tgoto doneGood;\n\t\t\t} else {\n\t\t\t\tU32 dontAddToDict = 0;\n\t\t\t\tif (code > clearCode) {\n\t\t\t\t\tif (code == dictOfs) {\n\t\t\t\t\t\t// Special case - add to dictionary here, and don't later\n\t\t\t\t\t\tdontAddToDict = 1;\n\t\t\t\t\t\tpDict[dictOfs].prevIndex = w;\n\t\t\t\t\t\tcodeChain = w;\n\t\t\t\t\t\twhile (pDict[codeChain].prevIndex != 0xffff) {\n\t\t\t\t\t\t\tcodeChain = pDict[codeChain].prevIndex;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpDict[dictOfs].suffix = codeChain;\n\t\t\t\t\t\tdictOfs++;\n\t\t\t\t\t} else if (code > dictOfs){\n\t\t\t\t\t\t// Invalid code\n\t\t\t\t\t\tgoto doneGood;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Put the data identifed by entry into the final bitmap\n\t\t\t\t// Count how many pixels are about to be set\n\t\t\t\tcodeChain = code;\n\t\t\t\tpixelCount=1;\n\t\t\t\twhile (pDict[codeChain].prevIndex != 0xffff) {\n\t\t\t\t\tcodeChain = pDict[codeChain].prevIndex;\n\t\t\t\t\tpixelCount++;\n\t\t\t\t}\n\t\t\t\tcodeChain0 = codeChain;\n\t\t\t\t// Fill up the pixels\n\t\t\t\tcodeChain = code;\n\t\t\t\tfor (i = pixelCount; i > 0; i--) {\n\t\t\t\t\t// TODO: Optimize!!! This is horribly inefficient.\n\t\t\t\t\ttGifColourTableEntry *pCol = &pColTable[pDict[codeChain].suffix];\n\t\t\t\t\tU32 col = ARGB(255, pCol->red, pCol->green, pCol->blue);\n\t\t\t\t\tU32 xLocal = x + i - 1;\n\t\t\t\t\tU32 yLocal = y + xLocal / width;\n\t\t\t\t\txLocal %= width;\n\t\t\t\t\t*(pBmpMem + pLineRedirect[yLocal] * width + xLocal) = col;\n\t\t\t\t\tcodeChain = pDict[codeChain].prevIndex;\n\t\t\t\t}\n\n\t\t\t\tx += pixelCount;\n\t\t\t\ty += x / width;\n\t\t\t\tx %= width;\n\t\t\t\tif (y >= height && x > 0) {\n\t\t\t\t\tgoto doneBad;\n\t\t\t\t}\n\n\t\t\t\tif (w != 0xffffffff && !dontAddToDict && dictOfs < 0x1000) {\n\t\t\t\t\tpDict[dictOfs].prevIndex = w;\n\t\t\t\t\tpDict[dictOfs].suffix = codeChain0;\n\t\t\t\t\tdictOfs++;\n\t\t\t\t}\n\t\t\t\tw = code;\n\t\t\t\tif (dictOfs > codeMask) {\n\t\t\t\t\tbitsPerCode++;\n\t\t\t\t\tcodeMask = (1 << bitsPerCode) - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\nblockDone:;\n\t}\n\ndoneGood:\n\tfree(pDict);\n\treturn pBmp;\n\ndoneBad:\n\tfree(pDict);\n\tDisposeImage_((tImage*)pBmp);\n\treturn NULL;\n}\n\ntBitmap* LoadJPEG(U8 *pFile, U32 fileSize, I32 *pWidth, I32 *pHeight, U32 *pPixelFormat) {\n\tstruct jdec_private *pJpegDecoder;\n\tint res;\n\tU32 width, height;\n\tU8 *pRGB;\n\ttBitmap *pBmp;\n\tU32 i;\n\tU32 *pBmpMem;\n\n\tpJpegDecoder = tinyjpeg_init();\n\tif (pJpegDecoder == NULL) {\n\t\treturn NULL;\n\t}\n\tres = tinyjpeg_parse_header(pJpegDecoder, pFile, fileSize);\n\tif (res < 0) {\n\t\ttinyjpeg_free(pJpegDecoder);\n\t\treturn NULL;\n\t}\n\ttinyjpeg_get_size(pJpegDecoder, (unsigned int*)&width, (unsigned int*)&height);\n\t*pWidth = (I32)width;\n\t*pHeight = (I32)height;\n\t*pPixelFormat = PixelFormat_Format32bppArgb;\n\tres = tinyjpeg_decode(pJpegDecoder, TINYJPEG_FMT_RGB24);\n\tif (res < 0) {\n\t\ttinyjpeg_free(pJpegDecoder);\n\t\treturn NULL;\n\t}\n\ttinyjpeg_get_components(pJpegDecoder, &pRGB);\n\n\tpBmp = CreateBitmap_(width, height, PixelFormat_Format32bppArgb);\n\tpBmpMem = (U32*)(pBmp->pBmp);\n\tfor (i = width*height; i>0; i--) {\n\t\t*pBmpMem++ = ARGB(255, pRGB[0], pRGB[1], pRGB[2]);\n\t\tpRGB += 3;\n\t}\n\n\ttinyjpeg_free(pJpegDecoder);\n\n\treturn pBmp;\n}\n\ntBitmap* BitmapFromFile_(STRING filename, I32 *pWidth, I32 *pHeight, U32 *pPixelFormat) {\n\n\tU8 *pFile;\n\tU32 fileSize;\n\ttBitmap *pBmp;\n\n\t{\n\t\tU32 bytesRead;\n\t\tint f;\n\t\tf = open(filename, O_BINARY | O_RDONLY);\n\t\tif (f < 0) {\n\t\t\treturn NULL;\n\t\t}\n\t\tfileSize = (U32)lseek(f, 0, SEEK_END);\n\t\tlseek(f, 0, SEEK_SET);\n\t\tpFile = (U8*)malloc(fileSize);\n\t\tbytesRead = read(f, pFile, fileSize);\n\t\tclose(f);\n\t\tif (bytesRead != fileSize) {\n\t\t\tfree(pFile);\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tpBmp = NULL;\n\t// See what kind of file this is\n\tif (pFile[0] == 'B' && pFile[1] == 'M') {\n\t\t// It's a bmp file\n\t\tprintf(\"BMP\\n\");\n\t\tpBmp = LoadBMP(pFile, pWidth, pHeight, pPixelFormat);\n\t}\n\telse\n\tif (pFile[0] == 'G' && pFile[1] == 'I' && pFile[2] == 'F') {\n\t\t// It's a GIF file\n\t\tpBmp = LoadGIF(pFile, pWidth, pHeight, pPixelFormat);\n\t}\n\telse\n\tif (pFile[0] == 0xff && pFile[1] == 0xd8) {\n\t\t// It's a JPEG file\n\t\tpBmp = LoadJPEG(pFile, fileSize, pWidth, pHeight, pPixelFormat);\n\t}\n\n\tfree(pFile);\n\n\treturn pBmp;\n}\n"
  },
  {
    "path": "libIGraph/Brush.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Brush.h\"\n\n#include \"HatchBrushDefs.h\"\n\n#include <math.h>\n\n#define WrapMode_Tile 0\n#define WrapMode_TileFlipX 1\n#define WrapMode_TileFlipY 2\n#define WrapMode_TileFlipXY 3\n#define WrapMode_Clamp 4\n\ntBrush* CreateBrush_Solid_(U32 argb) {\n\ttSolidBrush *pBrush = TMALLOC(tSolidBrush);\n\n\tpBrush->root.brushType = BRUSHTYPE_SOLID;\n\tpBrush->col = argb;\n\n\treturn (tBrush*)pBrush;\n}\n\ntBrush* CreateBrush_Hatch_(U32 hatchStyle, U32 foreCol, U32 backCol) {\n\ttHatchBrush *pBrush = TMALLOC(tHatchBrush);\n\n\tpBrush->root.brushType = BRUSHTYPE_HATCH;\n\tpBrush->pHatchDef = hatchDefs[hatchStyle];\n\tpBrush->foreCol = foreCol;\n\tpBrush->backCol = backCol;\n\n\treturn (tBrush*)pBrush;\n}\n\n// See http://www.osix.net/modules/article/?id=770\n// Approx. solution - average error ~0.005%\nI32 CalcLen(I32 x, I32 y) {\n\tI32 a, b;\n\tx = abs(x);\n\ty = abs(y);\n\tif (x > y) {\n\t\ta = x; b = y;\n\t} else {\n\t\tb = x; a = y;\n\t}\n\t// 106 = (sqrt(2) - 1) << 8\n\ta = (a << 8) + (106 * b * b) / a;\n\ta = ((a >> 8) + ((x*x + y*y) / (a >> 8))) >> 1;\n\treturn a;\n}\n\n#define LG_BRUSH_ANGLE_PRECISION_BITS 10\n\ntBrush* CreateBrush_LinearGradient_(I32 x1, I32 y1, I32 x2, I32 y2, U32 col1, U32 col2) {\n\tI32 x, y;\n\tI32 hyp;\n\ttLinearGradientBrush *pBrush = TMALLOC(tLinearGradientBrush);\n\n\tpBrush->root.brushType = BRUSHTYPE_LINEARGRADIENT;\n\tpBrush->wrapMode = WrapMode_Tile;\n\tpBrush->x1 = x1;\n\tpBrush->y1 = y1;\n\tpBrush->x2 = x2;\n\tpBrush->y2 = y2;\n\tpBrush->col1 = col1;\n\tpBrush->col2 = col2;\n\n\tx = x2 - x1;\n\ty = y2 - y1;\n\thyp = CalcLen(x, y);\n\t// cos angle\n\tpBrush->rotVec00 = (x << LG_BRUSH_ANGLE_PRECISION_BITS) / hyp;\n\t// sin angle\n\tpBrush->rotVec10 = (y << LG_BRUSH_ANGLE_PRECISION_BITS) / hyp;\n\t// grad length\n\tpBrush->gradLength = hyp;\n\n\treturn (tBrush*)pBrush;\n}\n\nvoid DisposeBrush_(tBrush *pBrush) {\n\tfree(pBrush);\n}\n\nstatic U32 Brush_GetPixelCol_Solid(tBrush *pBrush, tGraphics *pGraphics, I32 x, I32 y) {\n\treturn ((tSolidBrush*)pBrush)->col;\n}\n\n\nstatic U32 Brush_GetPixelCol_Hatch(tBrush *pBrush, tGraphics *pGraphics, I32 x, I32 y) {\n\tU8 bits = ((tHatchBrush*)pBrush)->pHatchDef[y & 0x7];\n\treturn (bits & (1 << (x & 0x7)))?((tHatchBrush*)pBrush)->foreCol:((tHatchBrush*)pBrush)->backCol;\n}\n\n#define LG(pBrush) ((tLinearGradientBrush*)pBrush)\nstatic U32 Brush_GetPixelCol_LinearGradient(tBrush *pBrush, tGraphics *pGraphics, I32 x, I32 y) {\n\tI32 xr;\n\tI32 gradLength;\n\tU32 col1, col2;\n\tU32 a, r, g, b;\n\n\tgradLength = LG(pBrush)->gradLength;\n\t// Rotate just the x parameter around point 1\n\txr = LG(pBrush)->rotVec00 * (x - LG(pBrush)->x1) + LG(pBrush)->rotVec10 * (y - LG(pBrush)->y1);\n\txr >>= LG_BRUSH_ANGLE_PRECISION_BITS;\n\txr %= gradLength;\n\tif (xr < 0) {\n\t\txr += gradLength;\n\t}\n\n\tcol1 = LG(pBrush)->col1;\n\tcol2 = LG(pBrush)->col2;\n\n\tr = ((I32)R(col1)) + (((((I32)R(col2)) - ((I32)R(col1))) * xr) / gradLength);\n\tg = ((I32)G(col1)) + (((((I32)G(col2)) - ((I32)G(col1))) * xr) / gradLength);\n\tb = ((I32)B(col1)) + (((((I32)B(col2)) - ((I32)B(col1))) * xr) / gradLength);\n\ta = ((I32)A(col1)) + (((((I32)A(col2)) - ((I32)A(col1))) * xr) / gradLength);\n\n\treturn ARGB(a,r,g,b);\n}\n#undef LG\n\ntBrush_GetPixelCol mBrush_GetPixelCol_[BRUSHTYPE_NUM] = {\n\tBrush_GetPixelCol_Solid,\n\tBrush_GetPixelCol_Hatch,\n\tBrush_GetPixelCol_LinearGradient\n};\n\n"
  },
  {
    "path": "libIGraph/Brush.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __BRUSH_H\n#define __BRUSH_H\n\n#include \"libIGraph.h\"\n\n#include \"Graphics.h\"\n\n#define BRUSHTYPE_NUM 3\n\n#define BRUSHTYPE_SOLID 0\n#define BRUSHTYPE_HATCH 1\n#define BRUSHTYPE_LINEARGRADIENT 2\n\ntypedef struct tBrush_ tBrush;\nstruct tBrush_ {\n\tU32 brushType;\n};\n\ntypedef struct tSolidBrush_ tSolidBrush;\nstruct tSolidBrush_ {\n\ttBrush root;\n\tU32 col;\n};\n\ntypedef struct tHatchBrush_ tHatchBrush;\nstruct tHatchBrush_ {\n\ttBrush root;\n\tU32 foreCol, backCol;\n\tU8 *pHatchDef;\n};\n\ntypedef struct tLinearGradientBrush_ tLinearGradientBrush;\nstruct tLinearGradientBrush_ {\n\ttBrush root;\n\tU32 wrapMode;\n\tI32 x1, y1;\n\tI32 x2, y2;\n\tU32 col1, col2;\n\t// Pre-calculated rotation matrix to rotate all incoming points by\n\tI32 rotVec00, rotVec10;\n\t// Pre-calulated gradient length of one traverse from point1 to point2\n\tI32 gradLength;\n};\n\ntBrush* CreateBrush_Solid_(U32 argb);\ntBrush* CreateBrush_Hatch_(U32 hatchStyle, U32 foreCol, U32 backCol);\ntBrush* CreateBrush_LinearGradient_(I32 x1, I32 y1, I32 x2, I32 y2, U32 col1, U32 col2);\nvoid DisposeBrush_(tBrush *pBrush);\n\ntypedef U32 (*tBrush_GetPixelCol)(tBrush *pBrush, tGraphics *pGraphics, I32 x, I32 y);\nextern tBrush_GetPixelCol mBrush_GetPixelCol_[BRUSHTYPE_NUM];\n#define mBrush_GetPixelCol(pBrush, pGraphics, x, y) mBrush_GetPixelCol_[(pBrush)->brushType](pBrush, pGraphics, x, y)\n\n#endif\n"
  },
  {
    "path": "libIGraph/Config.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __CONFIG_H\n#define __CONFIG_H\n\n// Include code to use the freetype library to display text\n#define INCLUDE_FREETYPE\n\n// Include code to be able to load BMP image files\n#define INCLUDE_IMAGE_BMP\n\n// Include code to be able to load GIF image files\n#define INCLUDE_IMAGE_GIF\n\n// Include code to be able to load JPEG image files\n#define INCLUDE_IMAGE_JPEG\n\n#endif\n"
  },
  {
    "path": "libIGraph/DrawEllipses.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"DrawEllipses.h\"\n#include \"Pixels.h\"\n\ntypedef void (*tEllipsePoint)(I32 x, I32 y, I32 cx, I32 cy, tGraphics *pGraphics, void *pData);\n\n// See http://www.cs.drexel.edu/~david/Classes/CS430/Lectures/L-06_Circles.6.pdf for algorithm\n\nstatic void CalcPoints(I32 width, I32 height, tEllipsePoint cb, I32 cx, I32 cy, tGraphics *pGraphics, void *pData, U32 isFill) {\n\tI32 rx = width >> 1;\n\tI32 ry = height >> 1;\n\tI32 rx2 = rx * rx;\n\tI32 ry2 = ry * ry;\n\tI32 x, y, d;\n\n\td = ry2 - rx2 * ry + rx2;\n\tx = 0;\n\ty = ry;\n\n\tfor (; ry2 * x < rx2 * y; x++) {\n\t\tif (d < 0) {\n\t\t\td += ry2 * (2 * x + 3);\n\t\t\tif (!isFill) {\n\t\t\t\tcb(x, y, cx, cy, pGraphics, pData);\n\t\t\t}\n\t\t} else {\n\t\t\td += ry2 * (2 * x + 3) - rx2 * (2 * y + 2);\n\t\t\tcb(x, y, cx, cy, pGraphics, pData);\n\t\t\ty--;\n\t\t}\n\t}\n\n\td = ry2 * (x * x + x) + rx2 * (y - 1) * (y - 1) - rx2 * ry2;\n\tfor (; y >= 0; y--) {\n\t\tcb(x, y, cx, cy, pGraphics, pData);\n\t\tif (d < 0) {\n\t\t\td += ry2 * (2 * x + 2) - rx2 * (2 * y + 3);\n\t\t\tx++;\n\t\t} else {\n\t\t\td -= rx2 * (2 * y + 3);\n\t\t}\n\t}\n}\n\nstatic void DrawEllipse_All_CB(I32 x, I32 y, I32 cx, I32 cy, tGraphics *pGraphics, void *pData) {\n\tmSetPixel(pGraphics, cx - x, cy - y, ((tPen*)pData)->col);\n\tif (x != 0) {\n\t\tmSetPixel(pGraphics, cx + x, cy - y, ((tPen*)pData)->col);\n\t}\n\tif (y != 0) {\n\t\tmSetPixel(pGraphics, cx - x, cy + y, ((tPen*)pData)->col);\n\t\tif (x != 0) {\n\t\t\tmSetPixel(pGraphics, cx + x, cy + y, ((tPen*)pData)->col);\n\t\t}\n\t}\n}\n\nstatic void DrawEllipse_All(tGraphics *pGraphics, tPen *pPen, I32 x, I32 y, I32 width, I32 height) {\n\tCalcPoints(width, height, DrawEllipse_All_CB, x + (width>>1), y + (height>>1), pGraphics, pPen, 0);\n}\n\ntDrawEllipse mDrawEllipse_[FMT_NUM] = {\n\tDrawEllipse_All,\n\tDrawEllipse_All\n};\n\nstatic void FillEllipse_All_CB(I32 x, I32 y, I32 cx, I32 cy, tGraphics *pGraphics, void *pData) {\n\tI32 i;\n\tI32 y1 = cy - y;\n\tI32 y2 = cy + y;\n\tfor (i=cx - x; i<= cx + x; i++) {\n\t\tU32 col;\n\t\tcol = mBrush_GetPixelCol((tBrush*)pData, pGraphics, i, y1);\n\t\tmSetPixel(pGraphics, i, y1, col);\n\t\tif (y != 0) {\n\t\t\tcol = mBrush_GetPixelCol((tBrush*)pData, pGraphics, i, y2);\n\t\t\tmSetPixel(pGraphics, i, y2, col);\n\t\t}\n\t}\n}\n\nstatic void FillEllipse_All(tGraphics *pGraphics, tBrush *pBrush, I32 x, I32 y, I32 width, I32 height) {\n\tCalcPoints(width, height, FillEllipse_All_CB, x + (width>>1), y + (height>>1), pGraphics, pBrush, 1);\n}\n\ntFillEllipse mFillEllipse_[FMT_NUM] = {\n\tFillEllipse_All,\n\tFillEllipse_All\n};\n"
  },
  {
    "path": "libIGraph/DrawEllipses.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __DRAWELLIPSES_H\n#define __DRAWELLIPSES_H\n\n#include \"libIGraph.h\"\n#include \"Graphics.h\"\n#include \"Pen.h\"\n#include \"Brush.h\"\n\ntypedef void (*tDrawEllipse)(tGraphics *pGraphics, tPen *pPen, I32 x, I32 y, I32 width, I32 height);\nextern tDrawEllipse mDrawEllipse_[FMT_NUM];\n#define mDrawEllipse(pGraphics, pPen, x, y, width, height) mDrawEllipse_[pGraphics->pixelFormatIndex](pGraphics, pPen, x, y, width, height)\n\ntypedef void (*tFillEllipse)(tGraphics *pGraphics, tBrush *pBrush, I32 x, I32 y, I32 width, I32 height);\nextern tFillEllipse mFillEllipse_[FMT_NUM];\n#define mFillEllipse(pGraphics, pBrush, x, y, width, height) mFillEllipse_[pGraphics->pixelFormatIndex](pGraphics, pBrush, x, y, width, height)\n\n#endif\n"
  },
  {
    "path": "libIGraph/DrawLines.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"DrawLines.h\"\n#include \"Pixels.h\"\n\nstatic void DrawLine_All(tGraphics *pGraphics, tPen *pPen, I32 x1, I32 y1, I32 x2, I32 y2) {\n\tI32 dx = x2-x1;\n\tI32 dy = y2-y1;\n\tI32 overflow, absDx = ABS(dx), absDy = ABS(dy);\n\tI32 x, y, inc;\n\tU32 col = pPen->col;\n\n\tif (pPen->width <= 1.0f) {\n\t\t// If pen size is 1 (or less) then use the fast algorithm for line drawing.\n\t\t// Note that this still supports colour transparency.\n\t\tif (absDx > absDy) {\n\t\t\t// Scan along x-axis\n\t\t\tif (dx < 0) {\n\t\t\t\tSWAP_I32(x1, x2);\n\t\t\t\tSWAP_I32(y1, y2);\n\t\t\t}\n\t\t\ty = y1;\n\t\t\tinc = (y2>y1)?1:-1;\n\t\t\toverflow = absDx >> 1;\n\t\t\tfor (x=x1; x<=x2; x++) {\n\t\t\t\tmSetPixel(pGraphics, x, y, col);\n\t\t\t\toverflow += absDy;\n\t\t\t\tif (overflow >= absDx) {\n\t\t\t\t\toverflow -= absDx;\n\t\t\t\t\ty += inc;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Scan along y-axis\n\t\t\tif (dy < 0) {\n\t\t\t\tSWAP_I32(x1, x2);\n\t\t\t\tSWAP_I32(y1, y2);\n\t\t\t}\n\t\t\tx = x1;\n\t\t\tinc = (x2>x1)?1:-1;\n\t\t\toverflow = absDy >> 1;\n\t\t\tfor (y=y1; y<=y2; y++) {\n\t\t\t\tmSetPixel(pGraphics, x, y, col);\n\t\t\t\toverflow += absDx;\n\t\t\t\tif (overflow >= absDy) {\n\t\t\t\t\toverflow -= absDy;\n\t\t\t\t\tx += inc;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// Use the 'fill-the-poly' algorithm for line drawing of thick lines.\n\n\t}\n}\n\ntDrawLine mDrawLine_[FMT_NUM] = {\n\tDrawLine_All,\n\tDrawLine_All\n};\n\n"
  },
  {
    "path": "libIGraph/DrawLines.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __DRAWLINES_H\n#define __DRAWLINES_H\n\n#include \"libIGraph.h\"\n#include \"Graphics.h\"\n#include \"Pen.h\"\n\ntypedef void (*tDrawLine)(tGraphics *pGraphics, tPen *pPen, I32 x1, I32 y1, I32 x2, I32 y2);\nextern tDrawLine mDrawLine_[FMT_NUM];\n#define mDrawLine(pGraphics, pPen, x1, y1, x2, y2) mDrawLine_[pGraphics->pixelFormatIndex](pGraphics, pPen, x1, y1, x2, y2)\n\n#endif\n"
  },
  {
    "path": "libIGraph/DrawRectangles.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"DrawRectangles.h\"\n#include \"Pixels.h\"\n\nstatic void FillRectangle_All(tGraphics *pGraphics, tBrush *pBrush, I32 x, I32 y, I32 width, I32 height) {\n\tI32 x2, y2;\n\tI32 xIt, yIt;\n\n\tx2 = x + width;\n\ty2 = y + height;\n\n\t// Make sure that x,y is always top left, and x2,y2 is always bottom right\n\tif (x > x2) {\n\t\tSWAP_I32(x, x2);\n\t}\n\tif (y > y2) {\n\t\tSWAP_I32(y, y2);\n\t}\n\n\tfor (yIt = y; yIt < y2; yIt++) {\n\t\tfor (xIt = x; xIt < x2; xIt++) {\n\t\t\tU32 col = mBrush_GetPixelCol(pBrush, pGraphics, xIt, yIt);\n\t\t\tmSetPixel(pGraphics, xIt, yIt, col);\n\t\t}\n\t}\n}\n\ntFillRectangle mFillRectangle_[FMT_NUM] = {\n\tFillRectangle_All,\n\tFillRectangle_All\n};\n"
  },
  {
    "path": "libIGraph/DrawRectangles.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __DRAWRECTANGLES_H\n#define __DRAWRECTANGLES_H\n\n#include \"libIGraph.h\"\n#include \"Graphics.h\"\n#include \"Pen.h\"\n#include \"Brush.h\"\n\ntypedef void (*tFillRectangle)(tGraphics *pGraphics, tBrush *pBrush, I32 x, I32 y, I32 width, I32 height);\nextern tFillRectangle mFillRectangle_[FMT_NUM];\n#define mFillRectangle(pGraphics, pBrush, x, y, width, height) mFillRectangle_[pGraphics->pixelFormatIndex](pGraphics, pBrush, x, y, width, height)\n\n#endif\n"
  },
  {
    "path": "libIGraph/Exports.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"GetScreen.h\"\n#include \"Graphics.h\"\n#include \"DrawLines.h\"\n#include \"DrawRectangles.h\"\n#include \"Pen.h\"\n#include \"Brush.h\"\n#include \"FontFamily.h\"\n#include \"Font.h\"\n#include \"StringFormat.h\"\n#include \"Text.h\"\n#include \"Image.h\"\n#include \"Bitmap.h\"\n#include \"Region.h\"\n#include \"DrawEllipses.h\"\n\nEXPORT(tGraphics*) GetScreen(I32 *pXSize, I32 *pYSize, U32 *pPixelFormat) {\n\treturn GetScreen_(pXSize, pYSize, pPixelFormat);\n}\n\nEXPORT(void) DisposeGraphics(tGraphics *pGraphics) {\n\tDisposeGraphics_(pGraphics);\n}\n\nEXPORT(void) Clear(tGraphics *pGraphics, U32 col) {\n\tmClear(pGraphics, col);\n}\n\nEXPORT(void) DrawLine_Ints(tGraphics *pGraphics, tPen *pPen, I32 x1, I32 y1, I32 x2, I32 y2) {\n\tmDrawLine(pGraphics, pPen, x1, y1, x2, y2);\n}\n\nEXPORT(void) FillRectangle_Ints(tGraphics *pGraphics, tBrush *pBrush, I32 x, I32 y, I32 width, I32 height) {\n\tmFillRectangle(pGraphics, pBrush, x, y, width, height);\n}\n\nEXPORT(void) DrawString(tGraphics *pGraphics, STRING2 s, tFont *pFont, tBrush *pBrush, I32 x1, I32 y1, I32 x2, I32 y2, tStringFormat *pFormat) {\n\tDrawString_(pGraphics, s, pFont, pBrush, x1, y1, x2, y2, pFormat);\n}\n\nEXPORT(tPen*) CreatePen_Color(float width, U32 col) {\n\treturn CreatePen_Color_(width, col);\n}\n\nEXPORT(void) DisposePen(tPen *pPen) {\n\tDisposePen_(pPen);\n}\n\nEXPORT(tBrush*) CreateBrush_Solid(U32 col) {\n\treturn CreateBrush_Solid_(col);\n}\n\nEXPORT(void) DisposeBrush(tBrush *pBrush) {\n\tDisposeBrush_(pBrush);\n}\n\nEXPORT(tFontFamily*) CreateFontFamily_Name(STRING name) {\n\treturn CreateFontFamily_Name_(name);\n}\n\nEXPORT(void) DisposeFontFamily(tFontFamily *pFontFamily) {\n\tDisposeFontFamily_(pFontFamily);\n}\n\nEXPORT(tFont*) _CreateFont(tFontFamily *pFontFamily, float emSize, U32 fontStyle) {\n\treturn CreateFont_(pFontFamily, emSize, fontStyle);\n}\n\nEXPORT(void) DisposeFont(tFont *pFont) {\n\tDisposeFont_(pFont);\n}\n\nEXPORT(tStringFormat*) CreateStringFormat(U32 alignment, U32 formatFlags, U32 lineAlignment, U32 stringTrimming) {\n\treturn CreateStringFormat_(alignment, formatFlags, lineAlignment, stringTrimming);\n}\n\nEXPORT(void) DisposeStringFormat(tStringFormat *pStringFormat) {\n\tDisposeStringFormat_(pStringFormat);\n}\n\nEXPORT(void) StringFormat_SetTrimming(tStringFormat *pStringFormat, U32 stringTrimming) {\n\tStringFormat_SetTrimming_(pStringFormat, stringTrimming);\n}\n\nEXPORT(void) TextRenderingHint_Set(tGraphics *pGraphics, U32 textRenderingHint) {\n\tTextRenderingHint_Set_(pGraphics, textRenderingHint);\n}\n\nEXPORT(tBitmap*) _CreateBitmap(I32 width, I32 height, U32 pixelFormat) {\n\treturn CreateBitmap_(width, height, pixelFormat);\n}\n\nEXPORT(tGraphics*) GetGraphicsFromImage(tImage *pImage) {\n\treturn GetGraphicsFromImage_(pImage);\n}\n\nEXPORT(void) DrawImageUnscaled(tGraphics *pGraphics, tImage *pImage, I32 x, I32 y) {\n\tDrawImageUnscaled_(pGraphics, pImage, x, y);\n}\n\nEXPORT(void) DisposeImage(tImage *pImage) {\n\tDisposeImage_(pImage);\n}\n\nEXPORT(tBitmap*) BitmapFromFile(STRING filename, I32 *pWidth, I32 *pHeight, U32 *pPixelFormat) {\n\treturn BitmapFromFile_(filename, pWidth, pHeight, pPixelFormat);\n}\n\nEXPORT(void) StringFormat_SetAlignment(tStringFormat *pStringFormat, U32 alignment) {\n\tStringFormat_SetAlignment_(pStringFormat, alignment);\n}\n\nEXPORT(void) StringFormat_SetLineAlignment(tStringFormat *pStringFormat, U32 lineAlignment) {\n\tStringFormat_SetLineAlignment_(pStringFormat, lineAlignment);\n}\n\nEXPORT(void) StringFormat_SetFormatFlags(tStringFormat *pStringFormat, U32 formatFlags) {\n\tStringFormat_SetFormatFlags_(pStringFormat, formatFlags);\n}\n\nEXPORT(tBrush*) CreateBrush_Hatch(U32 hatchStyle, U32 foreCol, U32 backCol) {\n\treturn CreateBrush_Hatch_(hatchStyle, foreCol, backCol);\n}\n\nEXPORT(U32) IsKeyDown_Internal(U32 key) {\n\treturn IsKeyDown_Internal_(key);\n}\n\nEXPORT(U32) LatestKeyUp_Internal() {\n\treturn LatestKeyUp_Internal_();\n}\n\nEXPORT(U32) LatestKeyDown_Internal() {\n\treturn LatestKeyDown_Internal_();\n}\n\nEXPORT(tBrush*) CreateBrush_LinearGradient(I32 x1, I32 y1, I32 x2, I32 y2, U32 col1, U32 col2) {\n\treturn CreateBrush_LinearGradient_(x1, y1, x2, y2, col1, col2);\n}\n\nEXPORT(tRegion*) CreateRegion_Rect(I32 x, I32 y, I32 width, I32 height) {\n\treturn CreateRegion_Rect_(x, y, width, height);\n}\n\nEXPORT(void) DisposeRegion(tRegion *pRegion) {\n\tDisposeRegion_(pRegion);\n}\n\nEXPORT(void) Graphics_SetClip(tGraphics *pGraphics, tRegion *pRegion) {\n\tGraphics_SetClip_(pGraphics, pRegion);\n}\n\nEXPORT(tRegion*) CreateRegion_Infinite() {\n\treturn CreateRegion_Infinite_();\n}\n\nEXPORT(void) MeasureString(tGraphics *pGraphics, STRING2 s, tFont *pFont, I32 width, tStringFormat *pFormat, U32 *pSzWidth, U32 *pSzHeight) {\n\tMeasureString_(pGraphics, s, pFont, width, pFormat, pSzWidth, pSzHeight);\n}\n\nEXPORT(void) DrawEllipse_Ints(tGraphics *pGraphics, tPen *pPen, I32 x, I32 y, I32 width, I32 height) {\n\tmDrawEllipse(pGraphics, pPen, x, y, width, height);\n}\n\nEXPORT(void) FillEllipse_Ints(tGraphics *pGraphics, tBrush *pBrush, I32 x, I32 y, I32 width, I32 height) {\n\tmFillEllipse(pGraphics, pBrush, x, y, width, height);\n}\n\nEXPORT(void) Graphics_CopyFromScreen(tGraphics *pGraphics, I32 srcX, I32 srcY, I32 destX, I32 destY, I32 sizeX, I32 sizeY) {\n\tGraphics_CopyFromScreen_(pGraphics, srcX, srcY, destX, destY, sizeX, sizeY);\n}\n"
  },
  {
    "path": "libIGraph/Font.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Font.h\"\n#include \"Text.h\"\n\ntFont* CreateFont_(tFontFamily *pFontFamily, float emSize, U32 fontStyle) {\n\ttFont *pFont = TMALLOC(tFont);\n\n\tpFont->pFontFamily = pFontFamily;\n\tpFont->emSize = emSize;\n\tpFont->fontStyle = fontStyle;\n\n\tText_EnsureFontMetrics(pFont);\n\n\treturn pFont;\n}\n\nvoid DisposeFont_(tFont *pFont) {\n\tText_RemoveFont(pFont);\n\tfree(pFont);\n}"
  },
  {
    "path": "libIGraph/Font.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __FONT_H\n#define __FONT_H\n\n#include \"FontFamily.h\"\n\ntypedef struct tFont_ tFont;\nstruct tFont_ {\n\ttFontFamily *pFontFamily;\n\tfloat emSize;\n\tU32 fontStyle;\n\n\t// Cache information about this font\n\tI32 unitsPerEm;\n\tI32 ascender, descender;\n\tI32 height;\n\tI32 maxAdvanceWidth, maxAdvanceHeight;\n\tI32 underlinePosition;\n\tI32 underlineThickness;\n\tU32 charMapIndex;\n\n\t// And pre-calculated pixel values\n\tI32 pixelSizeX, pixelSizeY;\n\tI32 pixelAscender, pixelDescender, pixelHeight;\n};\n\ntFont* CreateFont_(tFontFamily *pFontFamily, float emSize, U32 fontStyle);\nvoid DisposeFont_(tFont *pFont);\n\n#endif\n"
  },
  {
    "path": "libIGraph/FontFamily.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"FontFamily.h\"\n\ntFontFamily* CreateFontFamily_Name_(STRING name) {\n\ttFontFamily *pFontFamily = TMALLOC(tFontFamily);\n\n\tpFontFamily->familyName = malloc(strlen(name)+1);\n\tstrcpy(pFontFamily->familyName, name);\n\n\treturn pFontFamily;\n}\n\nvoid DisposeFontFamily_(tFontFamily *pFontFamily) {\n\tfree(pFontFamily);\n}"
  },
  {
    "path": "libIGraph/FontFamily.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __FONTFAMILY_H\n#define __FONTFAMILY_H\n\ntypedef struct tFontFamily_ tFontFamily;\nstruct tFontFamily_ {\n\tSTRING familyName;\n};\n\ntFontFamily* CreateFontFamily_Name_(STRING name);\nvoid DisposeFontFamily_(tFontFamily *pFontFamily);\n\n#endif\n"
  },
  {
    "path": "libIGraph/GetScreen.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Graphics.h\"\n\n#define XSIZE 320\n#define YSIZE 240\n\n#define KEYPAD_0 0\n#define KEYPAD_1 1\n#define KEYPAD_2 2\n#define KEYPAD_3 3\n#define KEYPAD_4 4\n#define KEYPAD_5 5\n#define KEYPAD_6 6\n#define KEYPAD_7 7\n#define KEYPAD_8 8\n#define KEYPAD_9 9\n#define KEYPAD_C 10\n#define KEYPAD_OK 11\n\nstatic tGraphics screen;\nstatic U32 windowCreated = 0;\n\nstatic U8 keyState[12];\nstatic U32 latestKeyDown = 0xffffffff, latestKeyUp = 0xffffffff;\n\nU32 GetScreenPixel(I32 x, I32 y) {\n\tif (windowCreated) {\n\t\tU8* pMem = (U8*)screen.pScan0 + screen.stride*y + (x >> 1);\n\t\tU8 b = *pMem;\n\t\tb = (x&1)?b&0xf:b>>4;\n#ifdef INVERT_4BPP_GRAY\n\t\tb = 15 - b;\n#endif\n\t\tb = (b << 4) | b;\n\t\treturn ARGB(0xff, b, b, b);\n\t} else {\n\t\treturn 0xff000000;\n\t}\n}\n\n#ifdef WIN32\n\nstatic HBITMAP hBackBuffer;\nstatic int doUpdates = 0; // Should be do periodic updates of the window\n\nstatic void UpdateScreenWindow() {\n\tPAINTSTRUCT ps;\n\tHDC memHdc;\n\tHGDIOBJ orgObj;\n\n\tBeginPaint((HWND)screen.screenPtr, &ps);\n\n\tmemHdc = CreateCompatibleDC(ps.hdc);\n\torgObj = SelectObject(memHdc, hBackBuffer);\n\tBitBlt(ps.hdc, 0, 0, screen.xSize, screen.ySize, memHdc, 0, 0, SRCCOPY);\n\tSelectObject(memHdc, orgObj);\n\tDeleteObject(memHdc);\n\tEndPaint((HWND)screen.screenPtr, &ps);\n}\n\nU32 IsKeyDown_Internal_(U32 key) {\n\treturn keyState[key];\n}\n\nU32 LatestKeyUp_Internal_() {\n\tU32 ret = latestKeyUp;\n\tlatestKeyUp = 0xffffffff;\n\treturn ret;\n}\n\nU32 LatestKeyDown_Internal_() {\n\tU32 ret = latestKeyDown;\n\tlatestKeyDown = 0xffffffff;\n\treturn ret;\n}\n\nstatic U32 MapKey(U32 keyCode) {\n\tswitch (keyCode) {\n\t\tcase 48:\n\t\tcase 96:\n\t\t\treturn KEYPAD_0;\n\t\tcase 49:\n\t\tcase 97:\n\t\t\treturn KEYPAD_1;\n\t\tcase 50:\n\t\tcase 98:\n\t\t\treturn KEYPAD_2;\n\t\tcase 51:\n\t\tcase 99:\n\t\t\treturn KEYPAD_3;\n\t\tcase 52:\n\t\tcase 100:\n\t\t\treturn KEYPAD_4;\n\t\tcase 53:\n\t\tcase 101:\n\t\t\treturn KEYPAD_5;\n\t\tcase 54:\n\t\tcase 102:\n\t\t\treturn KEYPAD_6;\n\t\tcase 55:\n\t\tcase 103:\n\t\t\treturn KEYPAD_7;\n\t\tcase 56:\n\t\tcase 104:\n\t\t\treturn KEYPAD_8;\n\t\tcase 57:\n\t\tcase 105:\n\t\t\treturn KEYPAD_9;\n\t\tcase 27:\n\t\t\treturn KEYPAD_C;\n\t\tcase 13:\n\t\t\treturn KEYPAD_OK;\n\t\tdefault:\n\t\t\treturn 0xffffffff;\n\t}\n}\n\nstatic LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {\n\tU32 key;\n\tswitch (uMsg) {\n\t\tcase WM_CLOSE:\n\t\t\t// Tell the program to end, and dispatch WM_DESTROY\n\t\t\tDestroyWindow(hWnd);\n\t\t\tbreak;\n\t\tcase WM_DESTROY:\n\t\t\t// End the program.\n\t\t\tPostQuitMessage(0);\n\t\t\texit(0);\n\t\t\tbreak;\n\t\tcase WM_TIMER:\n\t\t\t// Update window contents if doUpdates is 1\n\t\t\tif (doUpdates) {\n\t\t\t\tInvalidateRect((HWND)screen.screenPtr, NULL, 0);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase WM_PAINT:\n\t\t\tif (windowCreated) {\n\t\t\t\tUpdateScreenWindow();\n\t\t\t} else {\n\t\t\t\treturn DefWindowProc(hWnd, uMsg, wParam, lParam);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase WM_ERASEBKGND:\n\t\t\tbreak;\n\t\tcase WM_KEYDOWN:\n\t\t\tkey = MapKey((U32)wParam);\n\t\t\tif (key <= 12) {\n\t\t\t\tkeyState[key] = 1;\n\t\t\t}\n\t\t\tlatestKeyDown = key;\n\t\t\tbreak;\n\t\tcase WM_KEYUP:\n\t\t\tkey = MapKey((U32)wParam);\n\t\t\tif (key <= 12) {\n\t\t\t\tkeyState[key] = 0;\n\t\t\t}\n\t\t\tlatestKeyUp = key;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn DefWindowProc(hWnd, uMsg, wParam, lParam);\n\t}\n\treturn 0;\n}\n\nstatic const WCHAR className[] = L\"DotNetAnywhere\";\n\nstatic DWORD WINAPI WindowMessagePump(void *arg) {\n\n\tWNDCLASSEX wc;\n\tHWND hWnd;\n\tHINSTANCE hInstance;\n\tMSG msg;\n\tBITMAPINFO *pBmpInfo;\n\tU32 i;\n\tRECT r;\n\tDWORD winStyle, winExStyle;\n\n\thInstance = GetModuleHandle(NULL);\n\n\twc.cbSize = sizeof(WNDCLASSEX);\n\twc.cbClsExtra = 0;\n\twc.cbWndExtra = 0;\n\twc.hbrBackground = (HBRUSH)(COLOR_WINDOW);\n\twc.hCursor = LoadCursor(hInstance, IDC_ARROW);\n\twc.hIcon = LoadIcon(hInstance, IDI_APPLICATION);\n\twc.hIconSm = LoadIcon(hInstance, IDI_APPLICATION);\n\twc.hInstance = hInstance;\n\twc.lpfnWndProc = WndProc;\n\twc.lpszClassName = className;\n\twc.lpszMenuName = NULL;\n\twc.style = 0;\n\n\tif (!RegisterClassEx(&wc)) {\n\t\t// Error\n\t\tprintf(\"[libIGraph] ERROR: Cannot register window class. error=0x%08x\\n\", GetLastError());\n\t\twindowCreated = 2;\n\t\treturn 0;\n\t}\n\n\twinStyle = WS_OVERLAPPEDWINDOW;\n\twinExStyle = WS_EX_WINDOWEDGE;\n\n\tr.left = 100;\n\tr.top = 100;\n\tr.right = 100 + XSIZE;\n\tr.bottom = 100 + YSIZE;\n\tAdjustWindowRectEx(&r, winStyle, 0, winExStyle);\n\n\thWnd = CreateWindowEx(winExStyle, className, L\"Dot Net Anywhere\", winStyle,\n\t\tCW_USEDEFAULT, CW_USEDEFAULT, r.right - r.left, r.bottom - r.top, NULL, NULL, hInstance, NULL);\n\tif (hWnd == NULL) {\n\t\tprintf(\"[libIGraph] ERROR: Cannot create window. error=0x%08x\\n\", GetLastError());\n\t\twindowCreated = 2;\n\t\treturn 0;\n\t}\n\n\tShowWindow(hWnd, SW_SHOWNORMAL);\n\tUpdateWindow(hWnd);\n\n\tmemset(&screen, 0, sizeof(tGraphics));\n\tscreen.xSize = XSIZE;\n\tscreen.ySize = YSIZE;\n\tscreen.pixelFormat = PixelFormat_Gdi;\n\tscreen.pixelFormatIndex = FMT_4BPP_GRAY;\n\tscreen.stride = XSIZE / 2;\n\tscreen.textRenderingHint = TextRenderingHint_SystemDefault;\n\tscreen.pImage = NULL;\n\t// Create a memory back-buffer for the screen/window\n\n\tpBmpInfo = (BITMAPINFO*)malloc(sizeof(BITMAPINFOHEADER) + 16*4);\n\tpBmpInfo->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);\n\tpBmpInfo->bmiHeader.biWidth = XSIZE;\n\tpBmpInfo->bmiHeader.biHeight = -YSIZE;\n\tpBmpInfo->bmiHeader.biPlanes = 1;\n\tpBmpInfo->bmiHeader.biBitCount = 4;\n\tpBmpInfo->bmiHeader.biCompression = BI_RGB;\n\tpBmpInfo->bmiHeader.biSizeImage = 0;\n\tpBmpInfo->bmiHeader.biXPelsPerMeter = 0;\n\tpBmpInfo->bmiHeader.biYPelsPerMeter = 0;\n\tpBmpInfo->bmiHeader.biClrUsed = 0;\n\tpBmpInfo->bmiHeader.biClrImportant = 0;\n\tfor (i=0; i<16; i++) {\n\t\tU32 c = i | (i << 4);\n\t\tpBmpInfo->bmiColors[i].rgbRed = c;\n\t\tpBmpInfo->bmiColors[i].rgbGreen = c;\n\t\tpBmpInfo->bmiColors[i].rgbBlue = c;\n\t}\n\thBackBuffer = CreateDIBSection(NULL, pBmpInfo, DIB_RGB_COLORS, &screen.pScan0, NULL, 0);\n\n\tscreen.memSize = XSIZE * YSIZE / 2;\n\tscreen.screenPtr = hWnd;\n\n\twindowCreated = 1;\n\n\t// Create a timer to update the window from the back-buffer\n\tSetTimer(hWnd, 1, 40, NULL);\n\n\twhile (GetMessage(&msg, NULL, 0, 0)) {\n\t\tTranslateMessage(&msg);\n\t\tDispatchMessage(&msg);\n\t}\n\n\treturn 0;\n}\n\ntGraphics* GetScreen_(I32 *pXSize, I32 *pYSize, U32 *pPixelFormat) {\n\t\n\t// Create a new thread to handle all the window messages\n\tDWORD threadID;\n\tHANDLE hThread;\n\tint i;\n\n\tif (windowCreated == 0) {\n\t\t// Only need to create the window if it hasn't already been done.\n\n\t\t// Initialise the keyState\n\t\tmemset(keyState, 0, 12);\n\n\t\thThread = CreateThread(NULL, 0, WindowMessagePump, NULL, 0, &threadID); \n\t\tif (hThread == NULL) {\n\t\t\t// Failed to create thread\n\t\t\tprintf(\"[libIGraph] ERROR: Failed to create window thread. error=0x%08x\\n\", GetLastError());\n\t\t\treturn NULL;\n\t\t}\n\n\t\t// Wait for the window to be created\n\t\ti = 0;\n\t\twhile (windowCreated == 0) {\n\t\t\tSleep(1);\n\t\t\ti++;\n\t\t\tif (i>1000) {\n\t\t\t\tprintf(\"[libIGraph] ERROR: Window creation timed-out\\n\");\n\t\t\t\treturn NULL;\n\t\t\t}\n\t\t}\n\n\t\tif (windowCreated == 2) {\n\t\t\twindowCreated = 0;\n\t\t\t// Error\n\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tdoUpdates++;\n\n\t*pXSize = screen.xSize;\n\t*pYSize = screen.ySize;\n\t*pPixelFormat = screen.pixelFormat;\n\treturn &screen;\n}\n\nvoid ScreenDispose() {\n\tdoUpdates--;\n\tif (doUpdates == 0) {\n\t\t// If this is the last screen Graphics to be disposed of, then do one last window update\n\t\tInvalidateRect((HWND)screen.screenPtr, NULL, 0);\n\t}\n}\n\n#else\n\n#include <dev/wscons/wsconsio.h>\n\ntGraphics* GetScreen_(I32 *pXSize, I32 *pYSize, U32 *pPixelFormat) {\n\tif (windowCreated == 0) {\n\t\tint s;\n\t\t\n\t\t// Initialise the keyState\n\t\tmemset(keyState, 0, 12);\n\n\t\tmemset(&screen, 0, sizeof(tGraphics));\n\t\tscreen.xSize = XSIZE;\n\t\tscreen.ySize = YSIZE;\n\t\tscreen.pixelFormat = PixelFormat_Gdi;\n\t\tscreen.pixelFormatIndex = FMT_4BPP_GRAY;\n\t\tscreen.stride = XSIZE / 2;\n\t\tscreen.screenPtr = NULL;\n\t\tscreen.memSize = XSIZE * YSIZE / 2;\n\t\tscreen.textRenderingHint = TextRenderingHint_SystemDefault;\n\t\tscreen.pImage = NULL;\n\t\t\n\t\ts = open(\"/dev/wsdisplay0\", O_RDWR, 0);\n\t\tif (s <= 0) {\n\t\t\tprintf(\"[libIGraph] ERROR: Cannot open /dev/wsdisplay0\\n\");\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\tscreen.pScan0 = mmap(0, screen.memSize, PROT_READ|PROT_WRITE, MAP_SHARED, s, 0);\n\t\tif (screen.pScan0 == MAP_FAILED) {\n\t\t\tprintf(\"[libIGraph] ERROR: Failed to mmap() frame-buffer\\n\");\n\t\t\treturn NULL;\n\t\t}\n\t\t\n\t\twindowCreated = 1;\n\t}\n\t\n\t*pXSize = XSIZE;\n\t*pYSize = YSIZE;\n\t*pPixelFormat = screen.pixelFormat;\n\n\treturn &screen;\n}\n\nvoid ScreenDispose(){\n\t// Nothing needs to be done.\n}\n\nstatic int keyb = -1;\nstatic void ProcessKeyPad() {\n\n\tstruct wscons_event e;\n\tfd_set readfds;\n\tint res;\n\tstruct timeval tv_timeout;\n\n\tif (keyb == -1) {\n\t\t// Open keyboard device\n\t\tkeyb = open(\"/dev/wskbd0\",O_RDWR,0);\n\t\tif (keyb < 0) {\n\t\t\tprintf(\"[libIGraph] Error: Cannot open keyboard device: /dev/wskbd0\");\n\t\t\texit(2);\n\t\t}\n\t}\n\t\n\ttv_timeout.tv_sec = 0;\n\ttv_timeout.tv_usec = 0;\n\tFD_ZERO(&readfds);\n\tFD_SET(keyb,&readfds);\n\n\tfor (;;) {\n\t\tU32 key;\n\t\tres = select(FD_SETSIZE,&readfds,NULL,NULL,&tv_timeout);\n\t\tif (res <= 0) {\n\t\t\t// Timeout\n\t\t\tbreak;\n\t\t}\n\t\tres = read(keyb,&e,sizeof(e));\n\t\tif (res != sizeof(struct wscons_event)) {\n\t\t\tbreak;\n\t\t}\n\t\tswitch (e.value) {\n\t\tcase '0':\n\t\t\tkey = KEYPAD_0;\n\t\t\tbreak;\n\t\tcase '1':\n\t\t\tkey = KEYPAD_1;\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\tkey = KEYPAD_2;\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\tkey = KEYPAD_3;\n\t\t\tbreak;\n\t\tcase '4':\n\t\t\tkey = KEYPAD_4;\n\t\t\tbreak;\n\t\tcase '5':\n\t\t\tkey = KEYPAD_5;\n\t\t\tbreak;\n\t\tcase '6':\n\t\t\tkey = KEYPAD_6;\n\t\t\tbreak;\n\t\tcase '7':\n\t\t\tkey = KEYPAD_7;\n\t\t\tbreak;\n\t\tcase '8':\n\t\t\tkey = KEYPAD_8;\n\t\t\tbreak;\n\t\tcase '9':\n\t\t\tkey = KEYPAD_9;\n\t\t\tbreak;\n\t\tcase '.':\n\t\t\tkey = KEYPAD_OK;\n\t\t\tbreak;\n\t\tcase 'x':\n\t\t\tkey = KEYPAD_C;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tcontinue;\n\t\t}\n\t\tswitch (e.type) {\n\t\tcase WSCONS_EVENT_KEY_DOWN:\n\t\t\tkeyState[key] = 1;\n\t\t\tlatestKeyDown = key;\n\t\t\tbreak;\n\t\tcase WSCONS_EVENT_KEY_UP:\n\t\t\tkeyState[key] = 0;\n\t\t\tlatestKeyUp = key;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n}\n\nU32 IsKeyDown_Internal_(U32 key) {\n\tProcessKeyPad();\n\treturn keyState[key];\n}\n\nU32 LatestKeyUp_Internal_() {\n\tU32 ret;\n\tProcessKeyPad();\n\tret = latestKeyUp;\n\tlatestKeyUp = 0xffffffff;\n\treturn ret;\n}\n\nU32 LatestKeyDown_Internal_() {\n\tU32 ret;\n\tProcessKeyPad();\n\tret = latestKeyDown;\n\tlatestKeyDown = 0xffffffff;\n\treturn ret;\n}\n\n#endif\n"
  },
  {
    "path": "libIGraph/GetScreen.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __GETSCREEN_H\n#define __GETSCREEN_H\n\n#include \"libIGraph.h\"\n#include \"Graphics.h\"\n\ntGraphics* GetScreen_(I32 *pXSize, I32 *pYSize, U32 *pPixelFormat);\nvoid ScreenDispose();\nU32 GetScreenPixel(I32 x, I32 y);\n\nU32 IsKeyDown_Internal_(U32 key);\nU32 LatestKeyUp_Internal_();\nU32 LatestKeyDown_Internal_();\n\n#endif"
  },
  {
    "path": "libIGraph/Graphics.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Graphics.h\"\n#include \"GetScreen.h\"\n#include \"Pixels.h\"\n#include \"Image.h\"\n\ntGraphics* InitGraphics() {\n\ttGraphics *pGraphics = TMALLOC(tGraphics);\n\n\tmemset(pGraphics, 0, sizeof(tGraphics));\n\n\treturn pGraphics;\n}\n\nvoid DisposeGraphics_(tGraphics *pGraphics) {\n\tif (pGraphics->screenPtr != NULL) {\n\t\t// This is the screen window\n\t\tScreenDispose();\n\t} else {\n\t\t// This is an bitmap of some kind\n\t}\n}\n\nvoid TextRenderingHint_Set_(tGraphics *pGraphics, U32 textRenderingHint) {\n\tpGraphics->textRenderingHint = textRenderingHint;\n}\n\nstatic void Clear_WithClipping(tGraphics *pGraphics, U32 col) {\n\ttRegion *pClip = pGraphics->pClip;\n\tU32 x0 = (pClip->x1 > 0) ? pClip->x1 : 0;\n\tU32 x1 = (pClip->x2 < pGraphics->xSize) ? pClip->x2 : pGraphics->xSize;\n\tU32 y0 = (pClip->y1 > 0) ? pClip->y1 : 0;\n\tU32 y1 = (pClip->y2 < pGraphics->ySize) ? pClip->y2 : pGraphics->ySize;\n\tU32 x, y;\n\tfor (y = y0; y<y1; y++) {\n\t\tfor (x = x0; x<x1; x++) {\n\t\t\tmSetPixelNoBlend(pGraphics, x, y, col);\n\t\t}\n\t}\n}\n\nstatic void Clear_FMT_4BPP_GRAY(tGraphics *pGraphics, U32 col) {\n\tif (!pGraphics->pClip->isInfinite) {\n\t\tClear_WithClipping(pGraphics, col);\n\t} else {\n\t\tU8 col4 = COL2GRAY(col) >> 4;\n#ifdef INVERT_4BPP_GRAY\n\t\tcol4 = 15 - col4;\n#endif\n\t\tmemset(pGraphics->pScan0, col4 | (col4 << 4), pGraphics->memSize);\n\t}\n}\n\nstatic void Clear_FMT_32BPP_ARGB(tGraphics *pGraphics, U32 col) {\n\tif (!pGraphics->pClip->isInfinite) {\n\t\tClear_WithClipping(pGraphics, col);\n\t} else {\n\t\tvoid *pEnd = ((U8*)pGraphics->pScan0) + pGraphics->stride * pGraphics->ySize;\n\t\tU32 *pMem = (U32*)pGraphics->pScan0;\n\t\twhile ((void*)pMem < pEnd) {\n\t\t\t*pMem++ = col;\n\t\t}\n\t}\n}\n\ntClear mClear_[FMT_NUM] = {\n\tClear_FMT_4BPP_GRAY,\n\tClear_FMT_32BPP_ARGB\n};\n\nvoid DrawImageUnscaled_(tGraphics *pGraphics, tImage *pImage, I32 x, I32 y) {\n\tI32 xPos, yPos;\n\tU32 col;\n\n\t// TODO: Optimize!!!\n\tfor (yPos = 0; yPos < pImage->height; yPos++) {\n\t\tfor (xPos = 0; xPos < pImage->width; xPos++) {\n\t\t\tcol = mImage_GetPixel(pImage, xPos, yPos);\n\t\t\tmSetPixel(pGraphics, x + xPos, y + yPos, col);\n\t\t}\n\t}\n}\n\nvoid Graphics_SetClip_(tGraphics *pGraphics, tRegion *pRegion) {\n\tpGraphics->pClip = pRegion;\n}\n\nvoid Graphics_CopyFromScreen_(tGraphics *pGraphics, I32 srcX, I32 srcY, I32 destX, I32 destY, I32 sizeX, I32 sizeY) {\n\tI32 x, y, dx, dy;\n\tI32 xEnd = srcX + sizeX;\n\tI32 yEnd = srcY + sizeY;\n\n\t// TODO: Optimize!!!\n\tfor (y=srcY, dy=destY; y<yEnd; y++, dy++) {\n\t\tfor (x=srcX, dx=destX; x<xEnd; x++, dx++) {\n\t\t\tU32 col = GetScreenPixel(x, y);\n\t\t\tmSetPixel(pGraphics, dx, dy, col);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "libIGraph/Graphics.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __GRAPHICS_H\n#define __GRAPHICS_H\n\ntypedef struct tGraphics_ tGraphics;\n\n#include \"libIGraph.h\"\n\n#include \"Image.h\"\n#include \"Region.h\"\n\n#define TextRenderingHint_SystemDefault 0\n#define TextRenderingHint_SingleBitPerPixelGridFit 1\n#define TextRenderingHint_SingleBitPerPixel 2\n#define TextRenderingHint_AntiAliasGridFit 3\n#define TextRenderingHint_AntiAlias 4 \n#define TextRenderingHint_ClearTypeGridFit 5\n\n#define PixelFormat_Alpha 262144\n#define PixelFormat_Canonical 2097152\n#define PixelFormat_DontCare 0\n#define PixelFormat_Extended 1048576\n#define PixelFormat_Format16bppArgb1555 397319\n#define PixelFormat_Format16bppGrayScale 1052676\n#define PixelFormat_Format16bppRgb555 135173\n#define PixelFormat_Format16bppRgb565 135174\n#define PixelFormat_Format1bppIndexed 196865\n#define PixelFormat_Format24bppRgb 137224\n#define PixelFormat_Format32bppArgb 2498570\n#define PixelFormat_Format32bppPArgb 925707\n#define PixelFormat_Format32bppRgb 139273\n#define PixelFormat_Format48bppRgb 1060876\n#define PixelFormat_Format4bppIndexed 197634\n#define PixelFormat_Format64bppArgb 3424269\n#define PixelFormat_Format64bppPArgb 1851406\n#define PixelFormat_Format8bppIndexed 198659\n#define PixelFormat_Gdi 131072\n#define PixelFormat_Indexed 65536\n#define PixelFormat_Max 15\n#define PixelFormat_PAlpha 524288\n#define PixelFormat_Undefined 0\n\nstruct tGraphics_ {\n\tI32 xSize;\n\tI32 ySize;\n\tU32 pixelFormat;\n\tU32 pixelFormatIndex;\n\tvoid *pScan0;\n\tI32 stride;\n\tvoid* screenPtr; // Only set if this is a Graphics for the screen\n\ttImage *pImage; // Only set if this is a Graphics for an Image\n\tU32 memSize;\n\tU32 textRenderingHint;\n\ttRegion *pClip; // Null if no clipping region set\n};\n\ntGraphics* InitGraphics();\nvoid DisposeGraphics_(tGraphics *pGraphics);\n\nvoid TextRenderingHint_Set_(tGraphics *pGraphics, U32 textRenderingHint);\n\ntypedef void (*tClear)(tGraphics *pGraphics, U32 col);\nextern tClear mClear_[FMT_NUM];\n#define mClear(pGraphics, col) mClear_[pGraphics->pixelFormatIndex](pGraphics, col)\n\nvoid DrawImageUnscaled_(tGraphics *pGraphics, tImage *pImage, I32 x, I32 y);\nvoid Graphics_SetClip_(tGraphics *pGraphics, tRegion *pRegion);\nvoid Graphics_CopyFromScreen_(tGraphics *pGraphics, I32 srcX, I32 srcY, I32 destX, I32 destY, I32 sizeX, I32 sizeY);\n\n#endif\n"
  },
  {
    "path": "libIGraph/HatchBrushDefs.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nstatic U8 hatchDefs[53][8] = {\n\t{0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,},\n\t{0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01,},\n\t{0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80,},\n\t{0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01,},\n\t{0xff,0x01,0x01,0x01,0x01,0x01,0x01,0x01,},\n\t{0x81,0x42,0x24,0x18,0x18,0x24,0x42,0x81,},\n\t{0x01,0x00,0x00,0x00,0x10,0x00,0x00,0x00,},\n\t{0x01,0x00,0x10,0x00,0x01,0x00,0x10,0x00,},\n\t{0x11,0x00,0x44,0x00,0x11,0x00,0x44,0x00,},\n\t{0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,},\n\t{0x55,0x22,0x55,0x88,0x55,0x22,0x55,0x88,},\n\t{0x55,0xaa,0x55,0x8a,0x55,0xaa,0x55,0xa8,},\n\t{0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,},\n\t{0x77,0xaa,0xdd,0xaa,0x77,0xaa,0xdd,0xaa,},\n\t{0xee,0xbb,0xee,0xbb,0xee,0xbb,0xee,0xbb,},\n\t{0xee,0xff,0xbb,0xff,0xee,0xff,0xbb,0xff,},\n\t{0xf7,0xff,0x7f,0xff,0xf7,0xff,0x7f,0xff,},\n\t{0xff,0xff,0xff,0xef,0xff,0xff,0xff,0xfe,},\n\t{0x11,0x22,0x44,0x88,0x11,0x22,0x44,0x88,},\n\t{0x88,0x44,0x22,0x11,0x88,0x44,0x22,0x11,},\n\t{0x33,0x66,0xcc,0x99,0x33,0x66,0xcc,0x99,},\n\t{0xcc,0x66,0x33,0x99,0xcc,0x66,0x33,0x99,},\n\t{0x83,0x07,0x0e,0x1c,0x38,0x70,0xe0,0xc1,},\n\t{0xc1,0xe0,0x70,0x38,0x1c,0x0e,0x07,0x83,},\n\t{0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,},\n\t{0xff,0x00,0x00,0x00,0xff,0x00,0x00,0x00,},\n\t{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,},\n\t{0xff,0x00,0xff,0x00,0xff,0x00,0xff,0x00,},\n\t{0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x33,},\n\t{0xff,0xff,0x00,0x00,0xff,0xff,0x00,0x00,},\n\t{0x00,0x00,0x11,0x22,0x44,0x88,0x00,0x00,},\n\t{0x00,0x00,0x88,0x44,0x22,0x11,0x00,0x00,},\n\t{0x0f,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,},\n\t{0x01,0x01,0x01,0x01,0x10,0x10,0x10,0x10,},\n\t{0x01,0x10,0x02,0x40,0x08,0x80,0x04,0x20,},\n\t{0x8d,0x0c,0xc0,0xd8,0x1b,0x03,0x30,0xb1,},\n\t{0x81,0x42,0x24,0x18,0x81,0x42,0x24,0x18,},\n\t{0x00,0x18,0xa4,0x03,0x00,0x18,0xa4,0x03,},\n\t{0x80,0x40,0x20,0x10,0x18,0x24,0x42,0x81,},\n\t{0xff,0x01,0x01,0x01,0xff,0x10,0x10,0x10,},\n\t{0x11,0x2a,0x44,0xa2,0x11,0x28,0x44,0x8a,},\n\t{0x55,0xaa,0x55,0xaa,0x0f,0x0f,0x0f,0x0f,},\n\t{0x00,0x08,0x10,0x08,0x00,0x01,0x80,0x01,},\n\t{0x55,0x00,0x01,0x00,0x01,0x00,0x01,0x00,},\n\t{0x01,0x00,0x44,0x00,0x10,0x00,0x44,0x00,},\n\t{0xc0,0x21,0x12,0x0c,0x30,0x40,0x80,0x80,},\n\t{0xff,0x66,0xff,0x99,0xff,0x66,0xff,0x99,},\n\t{0xee,0x91,0xf1,0xf1,0xee,0x19,0x1f,0x1f,},\n\t{0xff,0x11,0x11,0x11,0xff,0x11,0x11,0x11,},\n\t{0x99,0x66,0x66,0x99,0x99,0x66,0x66,0x99,},\n\t{0x0f,0x0f,0x0f,0x0f,0xf0,0xf0,0xf0,0xf0,},\n\t{0x41,0x22,0x14,0x08,0x14,0x22,0x41,0x80,},\n\t{0x08,0x1c,0x3e,0x7f,0x3e,0x1c,0x08,0x00,},\n};\n"
  },
  {
    "path": "libIGraph/Image.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Image.h\"\n#include \"Bitmap.h\"\n\nU32 InitImage(tImage *pImage, U32 imageType, I32 width, I32 height, U32 pixelFormat) {\n\tpImage->imageType = imageType;\n\tpImage->width = width;\n\tpImage->height = height;\n\tpImage->pixelFormat = pixelFormat;\n\tpImage->graphicsRefCount = 0;\n\tpImage->pGraphics = NULL;\n\tswitch (pixelFormat) {\n\t\tcase PixelFormat_Gdi:\n\t\t\tpImage->pixelFormatIndex = FMT_4BPP_GRAY;\n\t\t\tbreak;\n\t\tcase PixelFormat_Format32bppArgb:\n\t\t\tpImage->pixelFormatIndex = FMT_32BPP_ARGB;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn 0;\n\t}\n\treturn 1;\n}\n\nvoid DisposeImage_(tImage *pImage) {\n\tfree(pImage);\n}\n\ntGraphics* GetGraphicsFromImage_(tImage *pImage) {\n\tif (pImage->pGraphics == NULL) {\n\t\t// Create brand new graphics for this image\n\t\tswitch (pImage->imageType) {\n\t\t\tcase IMAGE_TYPE_BITMAP:\n\t\t\t\tpImage->pGraphics = GetGraphicsFromBitmap_((tBitmap*)pImage);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn NULL;\n\t\t}\n\t}\n\n\tpImage->graphicsRefCount++;\n\treturn pImage->pGraphics;\n}\n\nstatic U32 Image_GetPixel_Bitmap(tImage *pImage, I32 x, I32 y) {\n\ttBitmap *pBitmap = (tBitmap*)pImage;\n\n\tswitch (pBitmap->image.pixelFormatIndex) {\n\t\tcase FMT_4BPP_GRAY:\n\t\t\t// NOT IMPLEMENTED YET\n\t\t\treturn 0xff000000;\n\t\tcase FMT_32BPP_ARGB:\n\t\t\treturn *(U32*)(((U8*)pBitmap->pBmp) + y * pBitmap->stride + (x << 2));\n\t\tdefault:\n\t\t\treturn 0;\n\t}\n}\n\ntImage_GetPixel mImage_GetPixel_[IMAGE_TYPE_NUM] = {\n\tImage_GetPixel_Bitmap\n};"
  },
  {
    "path": "libIGraph/Image.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __IMAGE_H\n#define __IMAGE_H\n\ntypedef struct tImage_ tImage;\n\n#include \"libIGraph.h\"\n\n#include \"Graphics.h\"\n\n#define IMAGE_TYPE_NUM 1\n#define IMAGE_TYPE_BITMAP 0\n\nstruct tImage_ {\n\tU32 imageType;\n\tI32 width, height;\n\tU32 pixelFormat;\n\tU32 pixelFormatIndex;\n\ttGraphics *pGraphics;\n\tU32 graphicsRefCount;\n};\n\nU32 InitImage(tImage *pImage, U32 imageType, I32 width, I32 height, U32 pixelFormat);\nvoid DisposeImage_(tImage *pImage);\ntGraphics* GetGraphicsFromImage_(tImage *pImage);\n\ntypedef U32 (*tImage_GetPixel)(tImage *pImage, I32 x, I32 y);\nextern tImage_GetPixel mImage_GetPixel_[IMAGE_TYPE_NUM];\n#define mImage_GetPixel(pImage, x, y) mImage_GetPixel_[pImage->imageType](pImage, x, y)\n\n#endif\n"
  },
  {
    "path": "libIGraph/Makefile",
    "content": ".include <N750.prog.mk>\n\nPROG=\tlibIGraph.so.0.1\n#PROG=\tTest\n\nSRCS=\tlibIGraph.c\nSRCS+=\ttinyjpeg.c\nSRCS+=\tjidctflt.c\nSRCS+=\tBitmap.c\nSRCS+=\tBitmapLoader.c\nSRCS+=\tBrush.c\nSRCS+=\tDrawEllipses.c\nSRCS+=\tDrawLines.c\nSRCS+=\tDrawRectangles.c\nSRCS+=\tExports.c\nSRCS+=\tFont.c\nSRCS+=\tFontFamily.c\nSRCS+=\tGetScreen.c\nSRCS+=\tGraphics.c\nSRCS+=\tImage.c\nSRCS+=\tPen.c\nSRCS+=\tPixels.c\nSRCS+=\tRegion.c\nSRCS+=\tStringFormat.c\nSRCS+=\tText.c\n\nCFLAGS= -Os -I. -I./include -I./include/freetype -Wall -Werror\n#-mips2 -mcpu=r3900\n#CFLAGS= -O0 -g -I. -I./include -I./include/freetype -Wall -Werror\n\nLDFLAGS+=--no-undefined -shared\nLDADD+=./lib/libfreetype.so.9\nLDADD+=-s\n\n.include <bsd.prog.mk>\n\n"
  },
  {
    "path": "libIGraph/Pen.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Pen.h\"\n\ntPen* CreatePen_Color_(float width, U32 col) {\n\ttPen *pPen = TMALLOC(tPen);\n\n\tpPen->width = width;\n\tpPen->col = col;\n\n\treturn pPen;\n}\n\nvoid DisposePen_(tPen *pPen) {\n\tfree(pPen);\n}"
  },
  {
    "path": "libIGraph/Pen.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __PEN_H\n#define __PEN_H\n\ntypedef struct tPen_ tPen;\nstruct tPen_ {\n\tfloat width;\n\tU32 col;\n};\n\ntPen* CreatePen_Color_(float width, U32 col);\nvoid DisposePen_(tPen *pPen);\n\n#endif\n"
  },
  {
    "path": "libIGraph/Pixels.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Pixels.h\"\n\nstatic void SetPixelNoBlend_FMT_4BPP_GRAY(tGraphics *pGraphics, I32 x, I32 y, U32 col) {\n\tif (x<0 || y<0 || x>=pGraphics->xSize || y>=pGraphics->ySize) {\n\t\treturn;\n\t}\n\tif (!pGraphics->pClip->isInfinite){\n\t\ttRegion *pClip = pGraphics->pClip;\n\t\tif (x<pClip->x1 || y<pClip->y1 || x>=pClip->x2 || y>=pClip->y2) {\n\t\t\treturn;\n\t\t}\n\t}\n\t{\n\t\tU8 *pMem = ((U8*)pGraphics->pScan0) + (y * pGraphics->stride) + (x >> 1);\n\t\tU32 gray = COL2GRAY(col);\n#ifdef INVERT_4BPP_GRAY\n\t\tgray = 255 - gray;\n#endif\n\t\tif (x&1) {\n\t\t\t// 'Odd' pixels\n\t\t\t*pMem = (*pMem & 0xf0) | (gray >> 4);\n\t\t} else {\n\t\t\t// 'Even' pixels\n\t\t\t*pMem = (*pMem & 0x0f) | (gray & 0xf0);\n\t\t}\n\t}\n}\n\nstatic void SetPixelNoBlend_FMT_32BPP_ARGB(tGraphics *pGraphics, I32 x, I32 y, U32 col) {\n\tif (x<0 || y<0 || x>=pGraphics->xSize || y>=pGraphics->ySize) {\n\t\treturn;\n\t}\n\tif (!pGraphics->pClip->isInfinite){\n\t\ttRegion *pClip = pGraphics->pClip;\n\t\tif (x<pClip->x1 || y<pClip->y1 || x>=pClip->x2 || y>=pClip->y2) {\n\t\t\treturn;\n\t\t}\n\t}\n\t{\n\t\tU32 *pMem;\n\t\tpMem = (U32*)(((U8*)pGraphics->pScan0) + y * pGraphics->stride + (x << 2));\n\t\t*pMem = col;\n\t}\n}\n\ntSetPixel mSetPixelNoBlend_[FMT_NUM] = {\n\tSetPixelNoBlend_FMT_4BPP_GRAY,\n\tSetPixelNoBlend_FMT_32BPP_ARGB\n};\n\nstatic void SetPixel_FMT_4BPP_GRAY(tGraphics *pGraphics, I32 x, I32 y, U32 col) {\n\tif (x<0 || y<0 || x>=pGraphics->xSize || y>=pGraphics->ySize) {\n\t\treturn;\n\t}\n\tif (!pGraphics->pClip->isInfinite){\n\t\ttRegion *pClip = pGraphics->pClip;\n\t\tif (x<pClip->x1 || y<pClip->y1 || x>=pClip->x2 || y>=pClip->y2) {\n\t\t\treturn;\n\t\t}\n\t}\n\t{\n\t\tU8 *pMem = ((U8*)pGraphics->pScan0) + (y * pGraphics->stride) + (x >> 1);\n\t\tU32 opacity = A(col);\n\t\tU32 gray = COL2GRAY(col);\n#ifdef INVERT_4BPP_GRAY\n\t\tgray = 255 - gray;\n#endif\n\t\tif (x&1) {\n\t\t\t// 'Odd' pixels\n\t\t\tU32 curPix = *pMem;\n\t\t\tU32 newPix = curPix & 0x0f;\n\t\t\tnewPix |= newPix << 4; // Bring into range 0 - 255\n\t\t\tnewPix = ((newPix * (255 - opacity)) + (gray * opacity)) >> 8;\n\t\t\t*pMem = (curPix & 0xf0) | (newPix >> 4);\n\t\t} else {\n\t\t\t// 'Even' pixels\n\t\t\tU32 curPix = *pMem;\n\t\t\tU32 newPix = curPix & 0xf0;\n\t\t\tnewPix |= newPix >> 4; // Bring into range 0 - 255\n\t\t\tnewPix = ((newPix * (255 - opacity)) + (gray * opacity)) >> 8;\n\t\t\t*pMem = (curPix & 0x0f) | (newPix & 0xf0);\n\t\t}\n\t}\n}\n\nstatic void SetPixel_FMT_32BPP_ARGB(tGraphics *pGraphics, I32 x, I32 y, U32 col) {\n\tif (x<0 || y<0 || x>=pGraphics->xSize || y>=pGraphics->ySize) {\n\t\treturn;\n\t}\n\tif (!pGraphics->pClip->isInfinite){\n\t\ttRegion *pClip = pGraphics->pClip;\n\t\tif (x<pClip->x1 || y<pClip->y1 || x>=pClip->x2 || y>=pClip->y2) {\n\t\t\treturn;\n\t\t}\n\t}\n\t{\n\t\tU32 *pMem;\n\t\tU32 cur;\n\t\tU32 rCur, gCur, bCur, aCur;\n\t\tU32 rCol, gCol, bCol, aCol;\n\n\t\tpMem = (U32*)(((U8*)pGraphics->pScan0) + y * pGraphics->stride + (x << 2));\n\t\tcur = *pMem;\n\n\t\taCur = A(cur);\n\t\trCur = R(cur);\n\t\tgCur = G(cur);\n\t\tbCur = B(cur);\n\n\t\taCol = A(col);\n\t\trCol = R(col);\n\t\tgCol = G(col);\n\t\tbCol = B(col);\n\n\t\trCur = (rCol * aCol + rCur * (255 - aCol)) / 255;\n\t\tgCur = (gCol * aCol + gCur * (255 - aCol)) / 255;\n\t\tbCur = (bCol * aCol + bCur * (255 - aCol)) / 255;\n\t\taCur = (aCol * aCol + aCur * (255 - aCol)) / 255;\n\n\t\tcur = ARGB(aCur,rCur,bCur,gCur);\n\n\t\t*pMem = cur;\n\t}\n}\n\ntSetPixel mSetPixel_[FMT_NUM] = {\n\tSetPixel_FMT_4BPP_GRAY,\n\tSetPixel_FMT_32BPP_ARGB\n};\n"
  },
  {
    "path": "libIGraph/Pixels.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __PIXELS_H\n#define __PIXELS_H\n\n#include \"libIGraph.h\"\n#include \"Graphics.h\"\n\ntypedef void (*tSetPixel)(tGraphics *pGraphics, I32 x, I32 y, U32 col);\nextern tSetPixel mSetPixel_[FMT_NUM];\n#define mSetPixel(pGraphics, x, y, col) mSetPixel_[pGraphics->pixelFormatIndex](pGraphics, x, y, col)\nextern tSetPixel mSetPixelNoBlend_[FMT_NUM];\n#define mSetPixelNoBlend(pGraphics, x, y, col) mSetPixelNoBlend_[pGraphics->pixelFormatIndex](pGraphics, x, y, col)\n\n#endif\n"
  },
  {
    "path": "libIGraph/Region.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"Region.h\"\n\ntRegion* CreateRegion_Infinite_() {\n\ttRegion *pRegion = TMALLOC(tRegion);\n\n\tpRegion->x1 = 0;\n\tpRegion->y1 = 0;\n\tpRegion->x2 = 0;\n\tpRegion->y2 = 0;\n\tpRegion->isInfinite = 1;\n\n\treturn pRegion;\n}\n\ntRegion* CreateRegion_Rect_(I32 x, I32 y, I32 width, I32 height) {\n\ttRegion *pRegion = TMALLOC(tRegion);\n\n\tpRegion->x1 = x;\n\tpRegion->y1 = y;\n\tpRegion->x2 = x + width;\n\tpRegion->y2 = y + height;\n\tpRegion->isInfinite = 0;\n\n\treturn pRegion;\n}\n\nvoid DisposeRegion_(tRegion *pRegion) {\n\tfree(pRegion);\n}\n\n"
  },
  {
    "path": "libIGraph/Region.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __REGION_H\n#define __REGION_H\n\ntypedef struct tRegion_ tRegion;\nstruct tRegion_ {\n\tI32 x1, y1, x2, y2;\n\tU32 isInfinite;\n};\n\ntRegion* CreateRegion_Infinite_();\ntRegion* CreateRegion_Rect_(I32 x, I32 y, I32 width, I32 height);\nvoid DisposeRegion_(tRegion *pRegion);\n\n#endif\n"
  },
  {
    "path": "libIGraph/StringFormat.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n#include \"StringFormat.h\"\n\ntStringFormat* CreateStringFormat_(U32 alignment, U32 formatFlags, U32 lineAlignment, U32 stringTrimming) {\n\ttStringFormat *pFormat = TMALLOC(tStringFormat);\n\n\tpFormat->alignment = alignment;\n\tpFormat->formatFlags = formatFlags;\n\tpFormat->lineAlignment = lineAlignment;\n\tpFormat->stringTrimming = stringTrimming;\n\n\treturn pFormat;\n}\n\nvoid DisposeStringFormat_(tStringFormat *pStringFormat) {\n\tfree(pStringFormat);\n}\n\nvoid StringFormat_SetTrimming_(tStringFormat *pStringFormat, U32 stringTrimming) {\n\tpStringFormat->stringTrimming = stringTrimming;\n}\n\nvoid StringFormat_SetAlignment_(tStringFormat *pStringFormat, U32 alignment) {\n\tpStringFormat->alignment = alignment;\n}\n\nvoid StringFormat_SetLineAlignment_(tStringFormat *pStringFormat, U32 lineAlignment) {\n\tpStringFormat->lineAlignment = lineAlignment;\n}\n\nvoid StringFormat_SetFormatFlags_(tStringFormat *pStringFormat, U32 formatFlags) {\n\tpStringFormat->formatFlags = formatFlags;\n}\n"
  },
  {
    "path": "libIGraph/StringFormat.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __STRINGFORMAT_H\n#define __STRINGFORMAT_H\n\n#include \"libIGraph.h\"\n\n#define StringFormatFlags_DirectionRightToLeft 0x1\n#define StringFormatFlags_DirectionVertical 0x2\n#define StringFormatFlags_FitBlackBox 0x4\n#define StringFormatFlags_DisplayFormatControl 0x20\n#define StringFormatFlags_NoFontFallback 0x400\n#define StringFormatFlags_MeasureTrailingSpaces 0x800\n#define StringFormatFlags_NoWrap 0x1000\n#define StringFormatFlags_LineLimit 0x2000\n#define StringFormatFlags_NoClip 0x4000\n\n#define StringAlignment_Near 0\n#define StringAlignment_Center 1\n#define StringAlignment_Far 2\n\ntypedef struct tStringFormat_ tStringFormat;\nstruct tStringFormat_ {\n\tU32 alignment;\n\tU32 formatFlags;\n\tU32 lineAlignment;\n\tU32 stringTrimming;\n};\n\ntStringFormat* CreateStringFormat_(U32 alignment, U32 formatFlags, U32 lineAlignment, U32 stringTrimming);\nvoid DisposeStringFormat_(tStringFormat *pStringFormat);\nvoid StringFormat_SetTrimming_(tStringFormat *pStringFormat, U32 stringTrimming);\nvoid StringFormat_SetAlignment_(tStringFormat *pStringFormat, U32 alignment);\nvoid StringFormat_SetLineAlignment_(tStringFormat *pStringFormat, U32 lineAlignment);\nvoid StringFormat_SetFormatFlags_(tStringFormat *pStringFormat, U32 formatFlags);\n\n#endif"
  },
  {
    "path": "libIGraph/Text.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n\n// Only needed to make VS2005 editor work properly!\n#include \"Config.h\"\n\n#include \"Text.h\"\n#include \"Pixels.h\"\n#include \"Font.h\"\n#include \"StringFormat.h\"\n#include \"Brush.h\"\n\n#ifdef INCLUDE_FREETYPE\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n#include FT_CACHE_H\n#include FT_SFNT_NAMES_H\n\n#define FT_CHECKERROR(msg) \\\n\tif (ftErr != 0) { \\\n\t\tprintf(msg \" Error: %d\\n\", (int)ftErr); \\\n\t\texit(2); \\\n\t}\n\nstatic FT_Library ftLib = NULL;\nstatic FTC_Manager ftCache = NULL;\nstatic FTC_CMapCache ftCMapCache = NULL;\nstatic FTC_ImageCache ftImageCache = NULL;\n\nstatic void ShowFTBitmap_All(tGraphics *pGraphics, tBrush *pBrush, I32 x, I32 y, FT_BitmapGlyph pGlyph) {\n\tFT_Bitmap *pBmp = &pGlyph->bitmap;\n\tI32 i, j;\n\tI32 xOrg = x + pGlyph->left;\n\tI32 xPix, yPix = y - pGlyph->top;\n\tunsigned char *pMem = pBmp->buffer;\n\tunsigned char *pMemCol0 = pMem;\n\tU32 bmpStride = pBmp->pitch;\n\n\tif (pBmp->pixel_mode == FT_PIXEL_MODE_MONO) {\n\t\tfor (j=0; j<pBmp->rows; j++) {\n\t\t\tU8 curByte;\n\t\t\txPix = xOrg;\n\t\t\tfor (i=0; i<pBmp->width; i++) {\n\t\t\t\tU32 col;\n\t\t\t\tU32 bitPos = i & 0x7;\n\t\t\t\tif (bitPos == 0) {\n\t\t\t\t\tcurByte = *pMem++;\n\t\t\t\t}\n\t\t\t\tcol = (curByte & (0x80 >> bitPos))?mBrush_GetPixelCol(pBrush, pGraphics, xPix, yPix):0;\n\t\t\t\tmSetPixel(pGraphics, xPix, yPix, col);\n\t\t\t\txPix++;\n\t\t\t}\n\t\t\tyPix++;\n\t\t\tpMem = pMemCol0 + bmpStride;\n\t\t\tpMemCol0 = pMem;\n\t\t}\n\t} else if (pBmp->pixel_mode == FT_PIXEL_MODE_GRAY) {\n\t\tfor (j = 0; j<pBmp->rows; j++) {\n\t\t\txPix = xOrg;\n\t\t\tfor (i = 0; i<pBmp->width; i++) {\n\t\t\t\t// Calculate the transparency value needed to display this pixel\n\t\t\t\tU32 col;\n\t\t\t\tU32 trans = *pMem++;\n\t\t\t\tcol = mBrush_GetPixelCol(pBrush, pGraphics, xPix, yPix);\n\t\t\t\ttrans *= col >> 24;\n\t\t\t\ttrans /= 255;\n\t\t\t\tcol = (col & 0x00ffffff) | (trans << 24);\n\t\t\t\tmSetPixel(pGraphics, xPix, yPix, col);\n\t\t\t\txPix++;\n\t\t\t}\n\t\t\tyPix++;\n\t\t\tpMem = pMemCol0 + bmpStride;\n\t\t\tpMemCol0 = pMem;\n\t\t}\n\t}\n}\n\ntypedef void (*tShowFTBitmap)(tGraphics *pGraphics, tBrush *pBrush, I32 x, I32 y, FT_BitmapGlyph pGlyph);\ntShowFTBitmap mShowFTBitmap_[FMT_NUM] = {\n\tShowFTBitmap_All,\n\tShowFTBitmap_All\n};\n#define mShowFTBitmap(pGraphics, pBrush, x, y, pGlyph) mShowFTBitmap_[pGraphics->pixelFormatIndex](pGraphics, pBrush, x, y, pGlyph)\n\nstatic FT_Error FaceReq(FTC_FaceID faceID, FT_Library ftLib, FT_Pointer state, FT_Face *pFace) {\n\tchar str[256];\n\ttFont *pFont = (tFont*)faceID;\n\n\tsprintf(str, \"%s%s.ttf\", FONT_DIR, pFont->pFontFamily->familyName);\n\n\treturn FT_New_Face(ftLib, str, 0, pFace);\n}\n\n// Make sure that the freetype library is ready for use\nstatic void EnsureFT() {\n\tFT_Error ftErr;\n\n\tif (ftLib != NULL) {\n\t\t// Don't init anything if it's already been done.\n\t\treturn;\n\t}\n\n\t// Init the font library\n\tftErr = FT_Init_FreeType(&ftLib);\n\tFT_CHECKERROR(\"FT_Init_FreeType()\");\n\n\t// Init the cache system\n\tftErr = FTC_Manager_New(ftLib, 0, 0, 0, FaceReq, NULL, &ftCache);\n\tFT_CHECKERROR(\"FTC_Manager_New()\");\n\tftErr = FTC_CMapCache_New(ftCache, &ftCMapCache);\n\tFT_CHECKERROR(\"FTC_CMapCache_New()\");\n\tftErr = FTC_ImageCache_New(ftCache, &ftImageCache);\n\tFT_CHECKERROR(\"FTC_ImageCache_New()\");\n}\n\nvoid Text_EnsureFontMetrics(tFont *pFont) {\n\tFT_Error ftErr;\n\tchar str[256];\n\tFT_Face face;\n\n\tEnsureFT();\n\n\tsprintf(str, \"%s%s.ttf\", FONT_DIR, pFont->pFontFamily->familyName);\n\tftErr = FT_New_Face(ftLib, str, 0, &face);\n\tFT_CHECKERROR(\"FT_New_Face()\");\n\tpFont->ascender = ABS(face->ascender);\n\tpFont->descender = ABS(face->descender);\n\tpFont->unitsPerEm = face->units_per_EM;\n\tpFont->height = face->height;\n\tpFont->maxAdvanceWidth = face->max_advance_width;\n\tpFont->maxAdvanceHeight = face->max_advance_height;\n\tpFont->underlineThickness = face->underline_thickness;\n\tpFont->underlinePosition = face->underline_position;\n\t// Get the index of the unicode char-map.\n\t// This works because the unicode char-map is always selected by default when the font is loaded\n\tpFont->charMapIndex = FT_Get_Charmap_Index(face->charmap);\n\tFT_Done_Face(face);\n\n\tpFont->pixelSizeX = PT_TO_PIXEL_X(pFont->emSize);\n\tpFont->pixelSizeY = PT_TO_PIXEL_Y(pFont->emSize);\n\tpFont->pixelAscender = pFont->ascender * pFont->pixelSizeY / pFont->unitsPerEm;\n\tpFont->pixelDescender = pFont->descender * pFont->pixelSizeY / pFont->unitsPerEm;\n\tpFont->pixelHeight = pFont->height * pFont->pixelSizeY / pFont->unitsPerEm;\n}\n\nvoid Text_RemoveFont(tFont *pFont) {\n\t// A font has been disposed of, so tell the cache system.\n\tFTC_Manager_RemoveFaceID(ftCache, (FTC_FaceID)pFont);\n}\n\ntypedef struct tTextLine_ tTextLine;\nstruct tTextLine_ {\n\tSTRING2 startChar;\n\tI32 numChars;\n\tI32 pixelWidth;\n\ttTextLine *pNext;\n};\n\n#define INIT_LINE(pLine, firstChar) pLine = TMALLOC(tTextLine); pLine->startChar = firstChar; pLine->numChars = 0; pLine->pixelWidth = 0; pLine->pNext = NULL\n\nvoid DrawMeasureString(tGraphics *pGraphics, STRING2 s, tFont *pFont, tBrush *pBrush, I32 x1, I32 y1, I32 x2, I32 y2, tStringFormat *pFormat, U32 *pSzWidth, U32 *pSzHeight) {\n\tFT_Error ftErr;\n\tI32 x, y;\n\tI32 width, height;\n\tFTC_ImageTypeRec imageTypeRender, imageTypeOutline;\n\tU8 wrap, lineLimit, rightToLeft, clip;\n\tU32 alignment, lineAlignment;\n\ttTextLine *pFirstLine = NULL, *pCurLine;\n\tSTRING2 pText, pPrevWhiteSpace;\n\tU16 c;\n\tU32 glyphIndex;\n\tU32 wasPrevWhiteSpace;\n\tI32 extraPixelWidth, extraNumChars;\n\tI32 numLines;\n\n\tEnsureFT();\n\n\twidth = (U32)x2-x1;\n\theight = (U32)y2-y1;\n\n\timageTypeOutline.face_id = imageTypeRender.face_id = (FTC_FaceID)pFont;\n\timageTypeOutline.width = imageTypeRender.width = pFont->pixelSizeX;\n\timageTypeOutline.height = imageTypeRender.height = pFont->pixelSizeY;\n\tswitch (pGraphics->textRenderingHint) {\n\t\tcase TextRenderingHint_SingleBitPerPixelGridFit:\n\t\tcase TextRenderingHint_SingleBitPerPixel:\n\t\t\timageTypeRender.flags = FT_LOAD_RENDER | FT_LOAD_MONOCHROME | FT_LOAD_TARGET_MONO;\n\t\t\timageTypeOutline.flags = FT_LOAD_MONOCHROME | FT_LOAD_TARGET_MONO;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\timageTypeRender.flags = FT_LOAD_RENDER | FT_LOAD_TARGET_NORMAL;\n\t\t\timageTypeOutline.flags = FT_LOAD_TARGET_NORMAL;\n\t\t\tbreak;\n\t}\n\n\t// wrap - should the text wrap at the end of lines\n\twrap = (pFormat->formatFlags & StringFormatFlags_NoWrap)?0:1;\n\t// lineLimit - true to not show partial lines of text\n\tlineLimit = (pFormat->formatFlags & StringFormatFlags_LineLimit)?1:0;\n\t// rightToLeft - text must be printed right-to-left\n\trightToLeft = (pFormat->formatFlags & StringFormatFlags_DirectionRightToLeft)?1:0;\n\t// clip - Clip text\n\tclip = (pFormat->formatFlags & StringFormatFlags_NoClip)?0:1;\n\t// alignment - left/right alignment\n\talignment = pFormat->alignment;\n\t// lineAlignment - up/down alignment\n\tlineAlignment = pFormat->lineAlignment;\n\n\ty = y1 + pFont->pixelAscender;\n\n\tpText = s;\n\tpPrevWhiteSpace = NULL;\n\n\tINIT_LINE(pFirstLine, pText);\n\tpCurLine = pFirstLine;\n\twasPrevWhiteSpace = 0;\n\textraPixelWidth = 0;\n\textraNumChars = 0;\n\tnumLines = 1;\n\n\t// Calulate the line layout and line pixel widths\n\twhile ((c = *pText) != 0) {\n\t\tFT_Glyph glyph;\n\t\tU8 isWhiteSpace, isNewLine, isIgnore;\n\n\t\tif (lineLimit) {\n\t\t\tif (y + pFont->pixelDescender > y2) {\n\t\t\t\tnumLines--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif (y  - pFont->pixelAscender > y2) {\n\t\t\t\tnumLines--;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tisWhiteSpace =\n\t\t\t(c == ' ');\n\t\tisNewLine = \n\t\t\t(c == '\\n');\n\t\tisIgnore =\n\t\t\t(c == '\\r');\n\n\t\tif (isIgnore) {\n\t\t\t*pText = 0;\n\t\t\tpText++;\n\t\t\textraNumChars++;\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\tglyphIndex = FTC_CMapCache_Lookup(ftCMapCache, (FTC_FaceID)pFont, pFont->charMapIndex, c);\n\t\tftErr = FTC_ImageCache_Lookup(ftImageCache, &imageTypeOutline, glyphIndex, &glyph, NULL);\n\t\tFT_CHECKERROR(\"FTC_ImageCache_Lookup() layout calculation\");\n\n\t\tif (isWhiteSpace) {\n\t\t\tpPrevWhiteSpace = pText;\n\t\t\tif (!wasPrevWhiteSpace) {\n\t\t\t\tpCurLine->numChars += extraNumChars;\n\t\t\t\tpCurLine->pixelWidth += extraPixelWidth;\n\t\t\t\textraNumChars = 0;\n\t\t\t\textraPixelWidth = 0;\n\t\t\t}\n\t\t} else {\n\t\t\tif (isNewLine) {\n\t\t\t\tpText++;\n\t\t\t\tpCurLine->numChars += extraNumChars;\n\t\t\t\tpCurLine->pixelWidth += extraPixelWidth;\n\t\t\t\tINIT_LINE(pCurLine->pNext, pText);\n\t\t\t} else if (pCurLine->pixelWidth + extraPixelWidth + (glyph->advance.x >> 16) > width &&\n\t\t\t\tpCurLine->numChars > 0) {\n\t\t\t\t// Create new line (but only if there's already at least 1 character in this line)\n\t\t\t\tif (pPrevWhiteSpace == NULL) {\n\t\t\t\t\t// No white-space yet, so just split here\n\t\t\t\t\tpCurLine->numChars += extraNumChars;\n\t\t\t\t\tpCurLine->pixelWidth += extraPixelWidth;\n\t\t\t\t\tINIT_LINE(pCurLine->pNext, pText);\n\t\t\t\t} else {\n\t\t\t\t\t// Split after previous white-space\n\t\t\t\t\tINIT_LINE(pCurLine->pNext, pPrevWhiteSpace+1);\n\t\t\t\t\tpText = pPrevWhiteSpace + 1;\n\t\t\t\t\tpPrevWhiteSpace = NULL;\n\t\t\t\t}\n\t\t\t\tisNewLine = 1;\n\t\t\t}\n\t\t\tif (isNewLine) {\n\t\t\t\tpCurLine = pCurLine->pNext;\n\t\t\t\textraNumChars = 0;\n\t\t\t\textraPixelWidth = 0;\n\t\t\t\ty += pFont->pixelHeight;\n\t\t\t\tnumLines++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\textraNumChars++;\n\t\textraPixelWidth += glyph->advance.x >> 16;\n\n\t\tpText++;\n\t\twasPrevWhiteSpace = isWhiteSpace;\n\t}\n\tpCurLine->numChars += extraNumChars;\n\tpCurLine->pixelWidth += extraPixelWidth;\n\n\t// If only measuring string, then calculate results, otherwise render string\n\tif (pBrush == NULL) {\n\n\t\tU32 maxWidth = 0;\n\t\tU32 height = 0;\n\n\t\tpCurLine = pFirstLine;\n\t\twhile (pCurLine != NULL) {\n\t\t\tif (pCurLine->pixelWidth > (I32)maxWidth) {\n\t\t\t\tmaxWidth = pCurLine->pixelWidth;\n\t\t\t}\n\t\t\theight += pFont->pixelHeight;\n\t\t\tpCurLine = pCurLine->pNext;\n\t\t}\n\n\t\t*pSzWidth = maxWidth;\n\t\t*pSzHeight = height;\n\n\t} else {\n\n\t\t// Render all the lines of text\n\t\tswitch (lineAlignment) {\n\t\tcase StringAlignment_Far:\n\t\t\ty = y2 - numLines * pFont->pixelHeight;\n\t\t\tbreak;\n\t\tcase StringAlignment_Center:\n\t\t\ty = y1 + ((height - numLines * pFont->pixelHeight) >> 1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\ty = y1;\n\t\t\tbreak;\n\t\t}\n\t\ty += pFont->pixelAscender;\n\t\tpCurLine = pFirstLine;\n\t\twhile (pCurLine != NULL) {\n\t\t\tU32 i;\n\t\t\tpText = pCurLine->startChar;\n\t\t\tswitch (alignment) {\n\t\t\tcase StringAlignment_Far:\n\t\t\t\tx = (rightToLeft)?(x1+pCurLine->pixelWidth):(x2-pCurLine->pixelWidth);\n\t\t\t\tbreak;\n\t\t\tcase StringAlignment_Center:\n\t\t\t\tx = (rightToLeft)?(x2 - ((width - pCurLine->pixelWidth) >> 1)):(x1 + ((width - pCurLine->pixelWidth) >> 1));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = (rightToLeft)?x2:x1;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tfor (i=pCurLine->numChars; i>0; i--, pText++) {\n\t\t\t\tFT_BitmapGlyph glyph;\n\t\t\t\tif (*pText == 0) {\n\t\t\t\t\t// All 'ignore' characters are set to 0\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tglyphIndex = FTC_CMapCache_Lookup(ftCMapCache, (FTC_FaceID)pFont, pFont->charMapIndex, *pText);\n\t\t\t\tftErr = FTC_ImageCache_Lookup(ftImageCache, &imageTypeRender, glyphIndex, (FT_Glyph*)&glyph, NULL);\n\t\t\t\tFT_CHECKERROR(\"FTC_ImageCache_Lookup() rendering\");\n\t\t\t\tif (rightToLeft) {\n\t\t\t\t\tx -= glyph->root.advance.x >> 16;\n\t\t\t\t}\n\t\t\t\tmShowFTBitmap(pGraphics, pBrush, x, y, glyph);\n\t\t\t\tif (!rightToLeft) {\n\t\t\t\t\tx += glyph->root.advance.x >> 16;\n\t\t\t\t}\n\t\t\t}\n\t\t\ty += pFont->pixelHeight;\n\t\t\tpCurLine = pCurLine->pNext;\n\t\t}\n\t}\n\n\t// Free line structures\n\twhile (pFirstLine != NULL) {\n\t\tpCurLine = pFirstLine->pNext;\n\t\tfree(pFirstLine);\n\t\tpFirstLine = pCurLine;\n\t}\n}\n\nvoid MeasureString_(tGraphics *pGraphics, STRING2 s, tFont *pFont, I32 width, tStringFormat *pFormat, U32 *pSzWidth, U32 *pSzHeight) {\n\tDrawMeasureString(pGraphics, s, pFont, NULL, 0, 0, width, 0x7fffffff, pFormat, pSzWidth, pSzHeight);\n}\n\nvoid DrawString_(tGraphics *pGraphics, STRING2 s, tFont *pFont, tBrush *pBrush, I32 x1, I32 y1, I32 x2, I32 y2, tStringFormat *pFormat) {\n\tDrawMeasureString(pGraphics, s, pFont, pBrush, x1, y1, x2, y2, pFormat, NULL, NULL);\n}\n\n#else\n\nvoid Text_EnsureFontMetrics(tFont *pFont) {\n\t// Do nothing\n}\n\nvoid Text_RemoveFont(tFont *pFont) {\n\t// Do nothing\n}\n\nvoid DrawString_(tGraphics *pGraphics, STRING2 s, tFont *pFont, tBrush *pBrush, I32 x1, I32 y1, I32 x2, I32 y2, tStringFormat *pFormat) {\n\t// Do nothing\n}\n\nvoid MeasureString_(tGraphics *pGraphics, STRING2 s, tFont *pFont, I32 width, tStringFormat *pFormat, U32 *pSzWidth, U32 *pSzHeight) {\n\t*pSzWidth = 0;\n\t*pSzHeight = 0;\n\t// Do nothing\n}\n\n#endif\n"
  },
  {
    "path": "libIGraph/Text.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __TEXT_H\n#define __TEXT_H\n\n#include \"libIGraph.h\"\n\n#include \"Graphics.h\"\n#include \"Brush.h\"\n#include \"Font.h\"\n#include \"StringFormat.h\"\n\n#define FontStyle_Regular 0\n#define FontStyle_Bold 1\n#define FontStyle_Italic 2\n#define FontStyle_Underline 4\n#define FontStyle_Strikeout 5\n\nvoid Text_EnsureFontMetrics(tFont *pFont);\nvoid Text_RemoveFont(tFont *pFont);\n\nvoid MeasureString_(tGraphics *pGraphics, STRING2 s, tFont *pFont, I32 width, tStringFormat *pFormat, U32 *pSzWidth, U32 *pSzHeight);\nvoid DrawString_(tGraphics *pGraphics, STRING2 s, tFont *pFont, tBrush *pBrush, I32 x1, I32 y1, I32 x2, I32 y2, tStringFormat *pFormat);\n\n#endif\n"
  },
  {
    "path": "libIGraph/freetype.txt",
    "content": "Currently using freetype version 2.3.5"
  },
  {
    "path": "libIGraph/include/freetype/config/ftconfig.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftconfig.h                                                             */\n/*                                                                         */\n/*    ANSI-specific configuration file (specification only).               */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This header file contains a number of macro definitions that are used */\n  /* by the rest of the engine.  Most of the macros here are automatically */\n  /* determined at compile time, and you should not need to change it to   */\n  /* port FreeType, except to compile the library with a non-ANSI          */\n  /* compiler.                                                             */\n  /*                                                                       */\n  /* Note however that if some specific modifications are needed, we       */\n  /* advise you to place a modified copy in your build directory.          */\n  /*                                                                       */\n  /* The build directory is usually `freetype/builds/<system>', and        */\n  /* contains system-specific files that are always included first when    */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* This ANSI version should stay in `include/freetype/config'.           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTCONFIG_H__\n#define __FTCONFIG_H__\n\n#include <ft2build.h>\n#include FT_CONFIG_OPTIONS_H\n#include FT_CONFIG_STANDARD_LIBRARY_H\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*               PLATFORM-SPECIFIC CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* These macros can be toggled to suit a specific system.  The current   */\n  /* ones are defaults used to compile FreeType in an ANSI C environment   */\n  /* (16bit compilers are also supported).  Copy this file to your own     */\n  /* `freetype/builds/<system>' directory, and edit it to port the engine. */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* There are systems (like the Texas Instruments 'C54x) where a `char' */\n  /* has 16 bits.  ANSI C says that sizeof(char) is always 1.  Since an  */\n  /* `int' has 16 bits also for this system, sizeof(int) gives 1 which   */\n  /* is probably unexpected.                                             */\n  /*                                                                     */\n  /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a      */\n  /* `char' type.                                                        */\n\n#ifndef FT_CHAR_BIT\n#define FT_CHAR_BIT  CHAR_BIT\n#endif\n\n\n  /* The size of an `int' type.  */\n#if                                 FT_UINT_MAX == 0xFFFFUL\n#define FT_SIZEOF_INT  (16 / FT_CHAR_BIT)\n#elif                               FT_UINT_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_INT  (32 / FT_CHAR_BIT)\n#elif FT_UINT_MAX > 0xFFFFFFFFUL && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_INT  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `int' type!\"\n#endif\n\n  /* The size of a `long' type.  A five-byte `long' (as used e.g. on the */\n  /* DM642) is recognized but avoided.                                   */\n#if                                  FT_ULONG_MAX == 0xFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (32 / FT_CHAR_BIT)\n#elif FT_ULONG_MAX > 0xFFFFFFFFUL && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFUL\n#define FT_SIZEOF_LONG  (64 / FT_CHAR_BIT)\n#else\n#error \"Unsupported size of `long' type!\"\n#endif\n\n\n  /* Preferred alignment of data */\n#define FT_ALIGNMENT  8\n\n\n  /* FT_UNUSED is a macro used to indicate that a given parameter is not  */\n  /* used -- this is only used to get rid of unpleasant compiler warnings */\n#ifndef FT_UNUSED\n#define FT_UNUSED( arg )  ( (arg) = (arg) )\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     AUTOMATIC CONFIGURATION MACROS                    */\n  /*                                                                       */\n  /* These macros are computed from the ones defined above.  Don't touch   */\n  /* their definition, unless you know precisely what you are doing.  No   */\n  /* porter should need to mess with them.                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Mac support                                                           */\n  /*                                                                       */\n  /*   This is the only necessary change, so it is defined here instead    */\n  /*   providing a new configuration file.                                 */\n  /*                                                                       */\n#if ( defined( __APPLE__ ) && !defined( DARWIN_NO_CARBON ) ) || \\\n    ( defined( __MWERKS__ ) && defined( macintosh )        )\n  /* no Carbon frameworks for 64bit 10.4.x */\n#include \"AvailabilityMacros.h\"\n#if defined( __LP64__ ) && \\\n    ( MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4 )\n#define DARWIN_NO_CARBON 1\n#else\n#define FT_MACINTOSH 1\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* IntN types                                                            */\n  /*                                                                       */\n  /*   Used to guarantee the size of some specific integers.               */\n  /*                                                                       */\n  typedef signed short    FT_Int16;\n  typedef unsigned short  FT_UInt16;\n\n#if FT_SIZEOF_INT == (32 / FT_CHAR_BIT)\n\n  typedef signed int      FT_Int32;\n  typedef unsigned int    FT_UInt32;\n\n#elif FT_SIZEOF_LONG == (32 / FT_CHAR_BIT)\n\n  typedef signed long     FT_Int32;\n  typedef unsigned long   FT_UInt32;\n\n#else\n#error \"no 32bit type found -- please check your configuration files\"\n#endif\n\n  /* look up an integer type that is at least 32 bits */\n#if FT_SIZEOF_INT >= (32 / FT_CHAR_BIT)\n\n  typedef int            FT_Fast;\n  typedef unsigned int   FT_UFast;\n\n#elif FT_SIZEOF_LONG >= (32 / FT_CHAR_BIT)\n\n  typedef long           FT_Fast;\n  typedef unsigned long  FT_UFast;\n\n#endif\n\n\n  /* determine whether we have a 64-bit int type for platforms without */\n  /* Autoconf                                                          */\n#if FT_SIZEOF_LONG == (64 / FT_CHAR_BIT)\n\n  /* FT_LONG64 must be defined if a 64-bit type is available */\n#define FT_LONG64\n#define FT_INT64  long\n\n#elif defined( _MSC_VER ) && _MSC_VER >= 900  /* Visual C++ (and Intel C++) */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64  __int64\n\n#elif defined( __BORLANDC__ )  /* Borland C++ */\n\n  /* XXXX: We should probably check the value of __BORLANDC__ in order */\n  /*       to test the compiler version.                               */\n\n  /* this compiler provides the __int64 type */\n#define FT_LONG64\n#define FT_INT64  __int64\n\n#elif defined( __WATCOMC__ )   /* Watcom C++ */\n\n  /* Watcom doesn't provide 64-bit data types */\n\n#elif defined( __MWERKS__ )    /* Metrowerks CodeWarrior */\n\n#define FT_LONG64\n#define FT_INT64  long long int\n\n#elif defined( __GNUC__ )\n\n  /* GCC provides the `long long' type */\n#define FT_LONG64\n#define FT_INT64  long long int\n\n#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */\n\n\n#define FT_BEGIN_STMNT  do {\n#define FT_END_STMNT    } while ( 0 )\n#define FT_DUMMY_STMNT  FT_BEGIN_STMNT FT_END_STMNT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A 64-bit data type will create compilation problems if you compile    */\n  /* in strict ANSI mode.  To avoid them, we disable their use if          */\n  /* __STDC__ is defined.  You can however ignore this rule by             */\n  /* defining the FT_CONFIG_OPTION_FORCE_INT64 configuration macro.        */\n  /*                                                                       */\n#if defined( FT_LONG64 ) && !defined( FT_CONFIG_OPTION_FORCE_INT64 )\n\n#ifdef __STDC__\n\n  /* undefine the 64-bit macros in strict ANSI compilation mode */\n#undef FT_LONG64\n#undef FT_INT64\n\n#endif /* __STDC__ */\n\n#endif /* FT_LONG64 && !FT_CONFIG_OPTION_FORCE_INT64 */\n\n\n#ifdef FT_MAKE_OPTION_SINGLE_OBJECT\n\n#define FT_LOCAL( x )      static  x\n#define FT_LOCAL_DEF( x )  static  x\n\n#else\n\n#ifdef __cplusplus\n#define FT_LOCAL( x )      extern \"C\"  x\n#define FT_LOCAL_DEF( x )  extern \"C\"  x\n#else\n#define FT_LOCAL( x )      extern  x\n#define FT_LOCAL_DEF( x )  x\n#endif\n\n#endif /* FT_MAKE_OPTION_SINGLE_OBJECT */\n\n\n#ifndef FT_BASE\n\n#ifdef __cplusplus\n#define FT_BASE( x )  extern \"C\"  x\n#else\n#define FT_BASE( x )  extern  x\n#endif\n\n#endif /* !FT_BASE */\n\n\n#ifndef FT_BASE_DEF\n\n#ifdef __cplusplus\n#define FT_BASE_DEF( x )  x\n#else\n#define FT_BASE_DEF( x )  x\n#endif\n\n#endif /* !FT_BASE_DEF */\n\n\n#ifndef FT_EXPORT\n\n#ifdef __cplusplus\n#define FT_EXPORT( x )  extern \"C\"  x\n#else\n#define FT_EXPORT( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT */\n\n\n#ifndef FT_EXPORT_DEF\n\n#ifdef __cplusplus\n#define FT_EXPORT_DEF( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_DEF( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_DEF */\n\n\n#ifndef FT_EXPORT_VAR\n\n#ifdef __cplusplus\n#define FT_EXPORT_VAR( x )  extern \"C\"  x\n#else\n#define FT_EXPORT_VAR( x )  extern  x\n#endif\n\n#endif /* !FT_EXPORT_VAR */\n\n  /* The following macros are needed to compile the library with a   */\n  /* C++ compiler and with 16bit compilers.                          */\n  /*                                                                 */\n\n  /* This is special.  Within C++, you must specify `extern \"C\"' for */\n  /* functions which are used via function pointers, and you also    */\n  /* must do that for structures which contain function pointers to  */\n  /* assure C linkage -- it's not possible to have (local) anonymous */\n  /* functions which are accessed by (global) function pointers.     */\n  /*                                                                 */\n  /*                                                                 */\n  /* FT_CALLBACK_DEF is used to _define_ a callback function.        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */\n  /* contains pointers to callback functions.                        */\n  /*                                                                 */\n  /* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable   */\n  /* that contains pointers to callback functions.                   */\n  /*                                                                 */\n  /*                                                                 */\n  /* Some 16bit compilers have to redefine these macros to insert    */\n  /* the infamous `_cdecl' or `__fastcall' declarations.             */\n  /*                                                                 */\n#ifndef FT_CALLBACK_DEF\n#ifdef __cplusplus\n#define FT_CALLBACK_DEF( x )  extern \"C\"  x\n#else\n#define FT_CALLBACK_DEF( x )  static  x\n#endif\n#endif /* FT_CALLBACK_DEF */\n\n#ifndef FT_CALLBACK_TABLE\n#ifdef __cplusplus\n#define FT_CALLBACK_TABLE      extern \"C\"\n#define FT_CALLBACK_TABLE_DEF  extern \"C\"\n#else\n#define FT_CALLBACK_TABLE      extern\n#define FT_CALLBACK_TABLE_DEF  /* nothing */\n#endif\n#endif /* FT_CALLBACK_TABLE */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTCONFIG_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/config/ftheader.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftheader.h                                                             */\n/*                                                                         */\n/*    Build macros of the FreeType 2 library.                              */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n#ifndef __FT_HEADER_H__\n#define __FT_HEADER_H__\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_BEGIN_HEADER                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_END_HEADER in header    */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_BEGIN_HEADER  extern \"C\" {\n#else\n#define FT_BEGIN_HEADER  /* nothing */\n#endif\n\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_END_HEADER                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro is used in association with @FT_BEGIN_HEADER in header  */\n  /*    files to ensure that the declarations within are properly          */\n  /*    encapsulated in an `extern \"C\" { .. }' block when included from a  */\n  /*    C++ compiler.                                                      */\n  /*                                                                       */\n#ifdef __cplusplus\n#define FT_END_HEADER  }\n#else\n#define FT_END_HEADER  /* nothing */\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Aliases for the FreeType 2 public and configuration files.            */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    header_file_macros                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Header File Macros                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Macro definitions used to #include specific header files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following macros are defined to the name of specific           */\n  /*    FreeType 2 header files.  They can be used directly in #include    */\n  /*    statements as in:                                                  */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #include FT_FREETYPE_H                                           */\n  /*      #include FT_MULTIPLE_MASTERS_H                                   */\n  /*      #include FT_GLYPH_H                                              */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    There are several reasons why we are now using macros to name      */\n  /*    public header files.  The first one is that such macros are not    */\n  /*    limited to the infamous 8.3 naming rule required by DOS (and       */\n  /*    `FT_MULTIPLE_MASTERS_H' is a lot more meaningful than `ftmm.h').   */\n  /*                                                                       */\n  /*    The second reason is that it allows for more flexibility in the    */\n  /*    way FreeType 2 is installed on a given system.                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* configuration files */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_CONFIG_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType 2 configuration data.\n   *\n   */\n#ifndef FT_CONFIG_CONFIG_H\n#define FT_CONFIG_CONFIG_H  <freetype/config/ftconfig.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_STANDARD_LIBRARY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType 2 interface to the standard C library functions.\n   *\n   */\n#ifndef FT_CONFIG_STANDARD_LIBRARY_H\n#define FT_CONFIG_STANDARD_LIBRARY_H  <freetype/config/ftstdlib.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_OPTIONS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing\n   *   FreeType 2 project-specific configuration options.\n   *\n   */\n#ifndef FT_CONFIG_OPTIONS_H\n#define FT_CONFIG_OPTIONS_H  <freetype/config/ftoption.h>\n#endif\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CONFIG_MODULES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType 2 modules that are statically linked to new library\n   *   instances in @FT_Init_FreeType.\n   *\n   */\n#ifndef FT_CONFIG_MODULES_H\n#define FT_CONFIG_MODULES_H  <freetype/config/ftmodule.h>\n#endif\n\n\n  /* public headers */\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_FREETYPE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   base FreeType 2 API.\n   *\n   */\n#define FT_FREETYPE_H  <freetype/freetype.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType 2 error codes (and messages).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_ERRORS_H  <freetype/fterrors.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_ERRORS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list of FreeType 2 module error offsets (and messages).\n   *\n   */\n#define FT_MODULE_ERRORS_H  <freetype/ftmoderr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYSTEM_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType 2 interface to low-level operations (i.e., memory management\n   *   and stream i/o).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_SYSTEM_H  <freetype/ftsystem.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing type\n   *   definitions related to glyph images (i.e., bitmaps, outlines,\n   *   scan-converter parameters).\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_IMAGE_H  <freetype/ftimage.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   basic data types defined by FreeType 2.\n   *\n   *   It is included by @FT_FREETYPE_H.\n   *\n   */\n#define FT_TYPES_H  <freetype/fttypes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LIST_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   list management API of FreeType 2.\n   *\n   *   (Most applications will never need to include this file.)\n   *\n   */\n#define FT_LIST_H  <freetype/ftlist.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OUTLINE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   scalable outline management API of FreeType 2.\n   *\n   */\n#define FT_OUTLINE_H  <freetype/ftoutln.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SIZES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API which manages multiple @FT_Size objects per face.\n   *\n   */\n#define FT_SIZES_H  <freetype/ftsizes.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MODULE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   module management API of FreeType 2.\n   *\n   */\n#define FT_MODULE_H  <freetype/ftmodapi.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_RENDER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   renderer module management API of FreeType 2.\n   *\n   */\n#define FT_RENDER_H  <freetype/ftrender.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TYPE1_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the Type 1 format.\n   *\n   */\n#define FT_TYPE1_TABLES_H  <freetype/t1tables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_IDS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   enumeration values which identify name strings, languages, encodings,\n   *   etc.  This file really contains a _large_ set of constant macro\n   *   definitions, taken from the TrueType and OpenType specifications.\n   *\n   */\n#define FT_TRUETYPE_IDS_H  <freetype/ttnameid.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TABLES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   types and API specific to the TrueType (as well as OpenType) format.\n   *\n   */\n#define FT_TRUETYPE_TABLES_H  <freetype/tttables.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRUETYPE_TAGS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of TrueType four-byte `tags' which identify blocks in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_TRUETYPE_TAGS_H  <freetype/tttags.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BDF_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which accesses BDF-specific strings from a\n   *   face.\n   *\n   */\n#define FT_BDF_H  <freetype/ftbdf.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GZIP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports gzip-compressed files.\n   *\n   */\n#define FT_GZIP_H  <freetype/ftgzip.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LZW_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports LZW-compressed files.\n   *\n   */\n#define FT_LZW_H  <freetype/ftlzw.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_WINFONTS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   definitions of an API which supports Windows FNT files.\n   *\n   */\n#define FT_WINFONTS_H   <freetype/ftwinfnt.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GLYPH_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional glyph management component.\n   *\n   */\n#define FT_GLYPH_H  <freetype/ftglyph.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BITMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional bitmap conversion component.\n   *\n   */\n#define FT_BITMAP_H  <freetype/ftbitmap.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_BBOX_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional exact bounding box computation routines.\n   *\n   */\n#define FT_BBOX_H  <freetype/ftbbox.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   API of the optional FreeType 2 cache sub-system.\n   *\n   */\n#define FT_CACHE_H  <freetype/ftcache.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_IMAGE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `glyph image' API of the FreeType 2 cache sub-system.\n   *\n   *   It is used to define a cache for @FT_Glyph elements.  You can also\n   *   use the API defined in @FT_CACHE_SMALL_BITMAPS_H if you only need to\n   *   store small glyph bitmaps, as it will use less memory.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   glyph image-related cache declarations.\n   *\n   */\n#define FT_CACHE_IMAGE_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_SMALL_BITMAPS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `small bitmaps' API of the FreeType 2 cache sub-system.\n   *\n   *   It is used to define a cache for small glyph bitmaps in a relatively\n   *   memory-efficient way.  You can also use the API defined in\n   *   @FT_CACHE_IMAGE_H if you want to cache arbitrary glyph images,\n   *   including scalable outlines.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   small bitmaps-related cache declarations.\n   *\n   */\n#define FT_CACHE_SMALL_BITMAPS_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_CACHE_CHARMAP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   `charmap' API of the FreeType 2 cache sub-system.\n   *\n   *   This macro is deprecated.  Simply include @FT_CACHE_H to have all\n   *   charmap-based cache declarations.\n   *\n   */\n#define FT_CACHE_CHARMAP_H  FT_CACHE_H\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MAC_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   Macintosh-specific FreeType 2 API.  The latter is used to access\n   *   fonts embedded in resource forks.\n   *\n   *   This header file must be explicitly included by client applications\n   *   compiled on the Mac (note that the base API still works though).\n   *\n   */\n#define FT_MAC_H  <freetype/ftmac.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_MULTIPLE_MASTERS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional multiple-masters management API of FreeType 2.\n   *\n   */\n#define FT_MULTIPLE_MASTERS_H  <freetype/ftmm.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SFNT_NAMES_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType 2 API which accesses embedded `name' strings in\n   *   SFNT-based font formats (i.e., TrueType and OpenType).\n   *\n   */\n#define FT_SFNT_NAMES_H  <freetype/ftsnames.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_OPENTYPE_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType 2 API which validates OpenType tables (BASE, GDEF,\n   *   GPOS, GSUB, JSTF).\n   *\n   */\n#define FT_OPENTYPE_VALIDATE_H  <freetype/ftotval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GX_VALIDATE_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   optional FreeType 2 API which validates TrueTypeGX/AAT tables (feat,\n   *   mort, morx, bsln, just, kern, opbd, trak, prop).\n   *\n   */\n#define FT_GX_VALIDATE_H  <freetype/ftgxval.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_PFR_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType 2 API which accesses PFR-specific data.\n   *\n   */\n#define FT_PFR_H  <freetype/ftpfr.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_STROKER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType 2 API which provides functions to stroke outline paths.\n   */\n#define FT_STROKER_H  <freetype/ftstroke.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SYNTHESIS_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType 2 API which performs artificial obliquing and emboldening.\n   */\n#define FT_SYNTHESIS_H  <freetype/ftsynth.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_XFREE86_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType 2 API which provides functions specific to the XFree86 and\n   *   X.Org X11 servers.\n   */\n#define FT_XFREE86_H  <freetype/ftxf86.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_TRIGONOMETRY_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType 2 API which performs trigonometric computations (e.g.,\n   *   cosines and arc tangents).\n   */\n#define FT_TRIGONOMETRY_H  <freetype/fttrigon.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_LCD_FILTER_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType 2 API which performs color filtering for subpixel rendering.\n   */\n#define FT_LCD_FILTER_H  <freetype/ftlcdfil.h>\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_GASP_H\n   *\n   * @description:\n   *   A macro used in #include statements to name the file containing the\n   *   FreeType 2 API which returns entries from the TrueType GASP table.\n   */\n#define FT_GASP_H  <freetype/ftgasp.h>\n\n\n  /* */\n\n#define FT_ERROR_DEFINITIONS_H  <freetype/fterrdef.h>\n\n\n  /* The internals of the cache sub-system are no longer exposed.  We */\n  /* default to FT_CACHE_H at the moment just in case, but we know of */\n  /* no rogue client that uses them.                                  */\n  /*                                                                  */\n#define FT_CACHE_MANAGER_H           <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MRU_H      <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_MANAGER_H  <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_CACHE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_GLYPH_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_IMAGE_H    <freetype/ftcache.h>\n#define FT_CACHE_INTERNAL_SBITS_H    <freetype/ftcache.h>\n\n\n#define FT_INCREMENTAL_H          <freetype/ftincrem.h>\n\n#define FT_TRUETYPE_UNPATENTED_H  <freetype/ttunpat.h>\n\n\n  /*\n   * Include internal headers definitions from <freetype/internal/...>\n   * only when building the library.\n   */\n#ifdef FT2_BUILD_LIBRARY\n#define  FT_INTERNAL_INTERNAL_H  <freetype/internal/internal.h>\n#include FT_INTERNAL_INTERNAL_H\n#endif /* FT2_BUILD_LIBRARY */\n\n\n#endif /* __FT2_BUILD_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/config/ftmodule.h",
    "content": "/*\n *  This file registers the FreeType modules compiled into the library.\n *\n *  If you use GNU make, this file IS NOT USED!  Instead, it is created in\n *  the objects directory (normally `<topdir>/objs/') based on information\n *  from `<topdir>/modules.cfg'.\n *\n *  Please read `docs/INSTALL.ANY' and `docs/CUSTOMIZE' how to compile\n *  FreeType without GNU make.\n *\n */\n\nFT_USE_MODULE(autofit_module_class)\nFT_USE_MODULE(tt_driver_class)\nFT_USE_MODULE(t1_driver_class)\nFT_USE_MODULE(cff_driver_class)\nFT_USE_MODULE(t1cid_driver_class)\nFT_USE_MODULE(pfr_driver_class)\nFT_USE_MODULE(t42_driver_class)\nFT_USE_MODULE(winfnt_driver_class)\nFT_USE_MODULE(pcf_driver_class)\nFT_USE_MODULE(psaux_module_class)\nFT_USE_MODULE(psnames_module_class)\nFT_USE_MODULE(pshinter_module_class)\nFT_USE_MODULE(ft_raster1_renderer_class)\nFT_USE_MODULE(sfnt_module_class)\nFT_USE_MODULE(ft_smooth_renderer_class)\nFT_USE_MODULE(ft_smooth_lcd_renderer_class)\nFT_USE_MODULE(ft_smooth_lcdv_renderer_class)\nFT_USE_MODULE(bdf_driver_class)\n\n/* EOF */\n"
  },
  {
    "path": "libIGraph/include/freetype/config/ftoption.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoption.h                                                             */\n/*                                                                         */\n/*    User-selectable configuration macros (specification only).           */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOPTION_H__\n#define __FTOPTION_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 USER-SELECTABLE CONFIGURATION MACROS                  */\n  /*                                                                       */\n  /* This file contains the default configuration macro definitions for    */\n  /* a standard build of the FreeType library.  There are three ways to    */\n  /* use this file to build project-specific versions of the library:      */\n  /*                                                                       */\n  /*  - You can modify this file by hand, but this is not recommended in   */\n  /*    cases where you would like to build several versions of the        */\n  /*    library from a single source directory.                            */\n  /*                                                                       */\n  /*  - You can put a copy of this file in your build directory, more      */\n  /*    precisely in `$BUILD/freetype/config/ftoption.h', where `$BUILD'   */\n  /*    is the name of a directory that is included _before_ the FreeType  */\n  /*    include path during compilation.                                   */\n  /*                                                                       */\n  /*    The default FreeType Makefiles and Jamfiles use the build          */\n  /*    directory `builds/<system>' by default, but you can easily change  */\n  /*    that for your own projects.                                        */\n  /*                                                                       */\n  /*  - Copy the file <ft2build.h> to `$BUILD/ft2build.h' and modify it    */\n  /*    slightly to pre-define the macro FT_CONFIG_OPTIONS_H used to       */\n  /*    locate this file during the build.  For example,                   */\n  /*                                                                       */\n  /*      #define FT_CONFIG_OPTIONS_H  <myftoptions.h>                     */\n  /*      #include <freetype/config/ftheader.h>                            */\n  /*                                                                       */\n  /*    will use `$BUILD/myftoptions.h' instead of this file for macro     */\n  /*    definitions.                                                       */\n  /*                                                                       */\n  /*    Note also that you can similarly pre-define the macro              */\n  /*    FT_CONFIG_MODULES_H used to locate the file listing of the modules */\n  /*    that are statically linked to the library at compile time.  By     */\n  /*    default, this file is <freetype/config/ftmodule.h>.                */\n  /*                                                                       */\n  /*  We highly recommend using the third method whenever possible.        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /**** G E N E R A L   F R E E T Y P E   2   C O N F I G U R A T I O N ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Uncomment the line below if you want to activate sub-pixel rendering  */\n  /* (a.k.a. LCD rendering, or ClearType) in this build of the library.    */\n  /*                                                                       */\n  /* Note that this feature is covered by several Microsoft patents        */\n  /* and should not be activated in any default build of the library.      */\n  /*                                                                       */\n  /* This macro has no impact on the FreeType API, only on its             */\n  /* _implementation_.  For example, using FT_RENDER_MODE_LCD when calling */\n  /* FT_Render_Glyph still generates a bitmap that is 3 times larger than  */\n  /* the original size; the difference will be that each triplet of        */\n  /* subpixels has R=G=B.                                                  */\n  /*                                                                       */\n  /* This is done to allow FreeType clients to run unmodified, forcing     */\n  /* them to display normal gray-level anti-aliased glyphs.                */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Many compilers provide a non-ANSI 64-bit data type that can be used   */\n  /* by FreeType to speed up some computations.  However, this will create */\n  /* some problems when compiling the library in strict ANSI mode.         */\n  /*                                                                       */\n  /* For this reason, the use of 64-bit integers is normally disabled when */\n  /* the __STDC__ macro is defined.  You can however disable this by       */\n  /* defining the macro FT_CONFIG_OPTION_FORCE_INT64 here.                 */\n  /*                                                                       */\n  /* For most compilers, this will only create compilation warnings when   */\n  /* building the library.                                                 */\n  /*                                                                       */\n  /* ObNote: The compiler-specific 64-bit integers are detected in the     */\n  /*         file `ftconfig.h' either statically or through the            */\n  /*         `configure' script on supported platforms.                    */\n  /*                                                                       */\n#undef  FT_CONFIG_OPTION_FORCE_INT64\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* LZW-compressed file support.                                          */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `compress' program.  This is mostly used to parse many of the PCF   */\n  /*   files that come with various X11 distributions.  The implementation */\n  /*   uses NetBSD's `zopen' to partially uncompress the file on the fly   */\n  /*   (see src/lzw/ftgzip.c).                                             */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.             */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_LZW\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Gzip-compressed file support.                                         */\n  /*                                                                       */\n  /*   FreeType now handles font files that have been compressed with the  */\n  /*   `gzip' program.  This is mostly used to parse many of the PCF files */\n  /*   that come with XFree86.  The implementation uses `zlib' to          */\n  /*   partially uncompress the file on the fly (see src/gzip/ftgzip.c).   */\n  /*                                                                       */\n  /*   Define this macro if you want to enable this `feature'.  See also   */\n  /*   the macro FT_CONFIG_OPTION_SYSTEM_ZLIB below.                       */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_USE_ZLIB\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* ZLib library selection                                                */\n  /*                                                                       */\n  /*   This macro is only used when FT_CONFIG_OPTION_USE_ZLIB is defined.  */\n  /*   It allows FreeType's `ftgzip' component to link to the system's     */\n  /*   installation of the ZLib library.  This is useful on systems like   */\n  /*   Unix or VMS where it generally is already available.                */\n  /*                                                                       */\n  /*   If you let it undefined, the component will use its own copy        */\n  /*   of the zlib sources instead.  These have been modified to be        */\n  /*   included directly within the component and *not* export external    */\n  /*   function names.  This allows you to link any program with FreeType  */\n  /*   _and_ ZLib without linking conflicts.                               */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define  FT_CONFIG_OPTION_SYSTEM_ZLIB */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* DLL export compilation                                                */\n  /*                                                                       */\n  /*   When compiling FreeType as a DLL, some systems/compilers need a     */\n  /*   special keyword in front OR after the return type of function       */\n  /*   declarations.                                                       */\n  /*                                                                       */\n  /*   Two macros are used within the FreeType source code to define       */\n  /*   exported library functions: FT_EXPORT and FT_EXPORT_DEF.            */\n  /*                                                                       */\n  /*     FT_EXPORT( return_type )                                          */\n  /*                                                                       */\n  /*       is used in a function declaration, as in                        */\n  /*                                                                       */\n  /*         FT_EXPORT( FT_Error )                                         */\n  /*         FT_Init_FreeType( FT_Library*  alibrary );                    */\n  /*                                                                       */\n  /*                                                                       */\n  /*     FT_EXPORT_DEF( return_type )                                      */\n  /*                                                                       */\n  /*       is used in a function definition, as in                         */\n  /*                                                                       */\n  /*         FT_EXPORT_DEF( FT_Error )                                     */\n  /*         FT_Init_FreeType( FT_Library*  alibrary )                     */\n  /*         {                                                             */\n  /*           ... some code ...                                           */\n  /*           return FT_Err_Ok;                                           */\n  /*         }                                                             */\n  /*                                                                       */\n  /*   You can provide your own implementation of FT_EXPORT and            */\n  /*   FT_EXPORT_DEF here if you want.  If you leave them undefined, they  */\n  /*   will be later automatically defined as `extern return_type' to      */\n  /*   allow normal compilation.                                           */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define  FT_EXPORT(x)       extern x */\n/* #define  FT_EXPORT_DEF(x)   x */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Glyph Postscript Names handling                                       */\n  /*                                                                       */\n  /*   By default, FreeType 2 is compiled with the `PSNames' module.  This */\n  /*   module is in charge of converting a glyph name string into a        */\n  /*   Unicode value, or return a Macintosh standard glyph name for the    */\n  /*   use with the TrueType `post' table.                                 */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want `PSNames' compiled in your   */\n  /*   build of FreeType.  This has the following effects:                 */\n  /*                                                                       */\n  /*   - The TrueType driver will provide its own set of glyph names,      */\n  /*     if you build it to support postscript names in the TrueType       */\n  /*     `post' table.                                                     */\n  /*                                                                       */\n  /*   - The Type 1 driver will not be able to synthetize a Unicode        */\n  /*     charmap out of the glyphs found in the fonts.                     */\n  /*                                                                       */\n  /*   You would normally undefine this configuration macro when building  */\n  /*   a version of FreeType that doesn't contain a Type 1 or CFF driver.  */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Postscript Names to Unicode Values support                            */\n  /*                                                                       */\n  /*   By default, FreeType 2 is built with the `PSNames' module compiled  */\n  /*   in.  Among other things, the module is used to convert a glyph name */\n  /*   into a Unicode value.  This is especially useful in order to        */\n  /*   synthetize on the fly a Unicode charmap from the CFF/Type 1 driver  */\n  /*   through a big table named the `Adobe Glyph List' (AGL).             */\n  /*                                                                       */\n  /*   Undefine this macro if you do not want the Adobe Glyph List         */\n  /*   compiled in your `PSNames' module.  The Type 1 driver will not be   */\n  /*   able to synthetize a Unicode charmap out of the glyphs found in the */\n  /*   fonts.                                                              */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_ADOBE_GLYPH_LIST\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Support for Mac fonts                                                 */\n  /*                                                                       */\n  /*   Define this macro if you want support for outline fonts in Mac      */\n  /*   format (mac dfont, mac resource, macbinary containing a mac         */\n  /*   resource) on non-Mac platforms.                                     */\n  /*                                                                       */\n  /*   Note that the `FOND' resource isn't checked.                        */\n  /*                                                                       */\n#define FT_CONFIG_OPTION_MAC_FONTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Guessing methods to access embedded resource forks                    */\n  /*                                                                       */\n  /*   Enable extra Mac fonts support on non-Mac platforms (e.g.           */\n  /*   GNU/Linux).                                                         */\n  /*                                                                       */\n  /*   Resource forks which include fonts data are stored sometimes in     */\n  /*   locations which users or developers don't expected.  In some cases, */\n  /*   resource forks start with some offset from the head of a file.  In  */\n  /*   other cases, the actual resource fork is stored in file different   */\n  /*   from what the user specifies.  If this option is activated,         */\n  /*   FreeType tries to guess whether such offsets or different file      */\n  /*   names must be used.                                                 */\n  /*                                                                       */\n  /*   Note that normal, direct access of resource forks is controlled via */\n  /*   the FT_CONFIG_OPTION_MAC_FONTS option.                              */\n  /*                                                                       */\n#ifdef FT_CONFIG_OPTION_MAC_FONTS\n#define FT_CONFIG_OPTION_GUESSING_EMBEDDED_RFORK\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Allow the use of FT_Incremental_Interface to load typefaces that      */\n  /* contain no glyph data, but supply it via a callback function.         */\n  /* This allows FreeType to be used with the PostScript language, using   */\n  /* the GhostScript interpreter.                                          */\n  /*                                                                       */\n/* #define FT_CONFIG_OPTION_INCREMENTAL */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The size in bytes of the render pool used by the scan-line converter  */\n  /* to do all of its work.                                                */\n  /*                                                                       */\n  /* This must be greater than 4KByte if you use FreeType to rasterize     */\n  /* glyphs; otherwise, you may set it to zero to avoid unnecessary        */\n  /* allocation of the render pool.                                        */\n  /*                                                                       */\n#define FT_RENDER_POOL_SIZE  16384L\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* FT_MAX_MODULES                                                        */\n  /*                                                                       */\n  /*   The maximum number of modules that can be registered in a single    */\n  /*   FreeType library object.  32 is the default.                        */\n  /*                                                                       */\n#define FT_MAX_MODULES  32\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Debug level                                                           */\n  /*                                                                       */\n  /*   FreeType can be compiled in debug or trace mode.  In debug mode,    */\n  /*   errors are reported through the `ftdebug' component.  In trace      */\n  /*   mode, additional messages are sent to the standard output during    */\n  /*   execution.                                                          */\n  /*                                                                       */\n  /*   Define FT_DEBUG_LEVEL_ERROR to build the library in debug mode.     */\n  /*   Define FT_DEBUG_LEVEL_TRACE to build it in trace mode.              */\n  /*                                                                       */\n  /*   Don't define any of these macros to compile in `release' mode!      */\n  /*                                                                       */\n  /*   Do not #undef these macros here since the build system might define */\n  /*   them for certain configurations only.                               */\n  /*                                                                       */\n/* #define FT_DEBUG_LEVEL_ERROR */\n/* #define FT_DEBUG_LEVEL_TRACE */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Memory Debugging                                                      */\n  /*                                                                       */\n  /*   FreeType now comes with an integrated memory debugger that is       */\n  /*   capable of detecting simple errors like memory leaks or double      */\n  /*   deletes.  To compile it within your build of the library, you       */\n  /*   should define FT_DEBUG_MEMORY here.                                 */\n  /*                                                                       */\n  /*   Note that the memory debugger is only activated at runtime when     */\n  /*   when the _environment_ variable `FT2_DEBUG_MEMORY' is defined also! */\n  /*                                                                       */\n  /*   Do not #undef this macro here since the build system might define   */\n  /*   it for certain configurations only.                                 */\n  /*                                                                       */\n/* #define FT_DEBUG_MEMORY */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Module errors                                                         */\n  /*                                                                       */\n  /*   If this macro is set (which is _not_ the default), the higher byte  */\n  /*   of an error code gives the module in which the error has occurred,  */\n  /*   while the lower byte is the real error code.                        */\n  /*                                                                       */\n  /*   Setting this macro makes sense for debugging purposes only, since   */\n  /*   it would break source compatibility of certain programs that use    */\n  /*   FreeType 2.                                                         */\n  /*                                                                       */\n  /*   More details can be found in the files ftmoderr.h and fterrors.h.   */\n  /*                                                                       */\n#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****        S F N T   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_EMBEDDED_BITMAPS if you want to support       */\n  /* embedded bitmaps in all formats using the SFNT module (namely         */\n  /* TrueType & OpenType).                                                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_EMBEDDED_BITMAPS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_POSTSCRIPT_NAMES if you want to be able to    */\n  /* load and enumerate the glyph Postscript names in a TrueType or        */\n  /* OpenType file.                                                        */\n  /*                                                                       */\n  /* Note that when you do not compile the `PSNames' module by undefining  */\n  /* the above FT_CONFIG_OPTION_POSTSCRIPT_NAMES, the `sfnt' module will   */\n  /* contain additional code used to read the PS Names table from a font.  */\n  /*                                                                       */\n  /* (By default, the module uses `PSNames' to extract glyph names.)       */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_POSTSCRIPT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_SFNT_NAMES if your applications need to       */\n  /* access the internal name table in a SFNT-based format like TrueType   */\n  /* or OpenType.  The name table contains various strings used to         */\n  /* describe the font, like family name, copyright, version, etc.  It     */\n  /* does not contain any glyph name though.                               */\n  /*                                                                       */\n  /* Accessing SFNT names is done through the functions declared in        */\n  /* `freetype/ftnames.h'.                                                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_SFNT_NAMES\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* TrueType CMap support                                                 */\n  /*                                                                       */\n  /*   Here you can fine-tune which TrueType CMap table format shall be    */\n  /*   supported.                                                          */\n#define TT_CONFIG_CMAP_FORMAT_0\n#define TT_CONFIG_CMAP_FORMAT_2\n#define TT_CONFIG_CMAP_FORMAT_4\n#define TT_CONFIG_CMAP_FORMAT_6\n#define TT_CONFIG_CMAP_FORMAT_8\n#define TT_CONFIG_CMAP_FORMAT_10\n#define TT_CONFIG_CMAP_FORMAT_12\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    T R U E T Y P E   D R I V E R    C O N F I G U R A T I O N   ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BYTECODE_INTERPRETER if you want to compile   */\n  /* a bytecode interpreter in the TrueType driver.  Note that there are   */\n  /* important patent issues related to the use of the interpreter.        */\n  /*                                                                       */\n  /* By undefining this, you will only compile the code necessary to load  */\n  /* TrueType glyphs without hinting.                                      */\n  /*                                                                       */\n  /*   Do not #undef this macro here, since the build system might         */\n  /*   define it for certain configurations only.                          */\n  /*                                                                       */\n/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version  */\n  /* of the TrueType bytecode interpreter is used that doesn't implement   */\n  /* any of the patented opcodes and algorithms.  Note that the            */\n  /* the TT_CONFIG_OPTION_UNPATENTED_HINTING macro is *ignored* if you     */\n  /* define TT_CONFIG_OPTION_BYTECODE_INTERPRETER; with other words,       */\n  /* either define TT_CONFIG_OPTION_BYTECODE_INTERPRETER or                */\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING but not both at the same time.    */\n  /*                                                                       */\n  /* This macro is only useful for a small number of font files (mostly    */\n  /* for Asian scripts) that require bytecode interpretation to properly   */\n  /* load glyphs.  For all other fonts, this produces unpleasant results,  */\n  /* thus the unpatented interpreter is never used to load glyphs from     */\n  /* TrueType fonts unless one of the following two options is used.       */\n  /*                                                                       */\n  /*   - The unpatented interpreter is explicitly activated by the user    */\n  /*     through the FT_PARAM_TAG_UNPATENTED_HINTING parameter tag         */\n  /*     when opening the FT_Face.                                         */\n  /*                                                                       */\n  /*   - FreeType detects that the FT_Face corresponds to one of the       */\n  /*     `trick' fonts (e.g., `Mingliu') it knows about.  The font engine  */\n  /*     contains a hard-coded list of font names and other matching       */\n  /*     parameters (see function `tt_face_init' in file                   */\n  /*     `src/truetype/ttobjs.c').                                         */\n  /*                                                                       */\n  /* Here a sample code snippet for using FT_PARAM_TAG_UNPATENTED_HINTING. */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     FT_Parameter  parameter;                                          */\n  /*     FT_Open_Args  open_args;                                          */\n  /*                                                                       */\n  /*                                                                       */\n  /*     parameter.tag = FT_PARAM_TAG_UNPATENTED_HINTING;                  */\n  /*                                                                       */\n  /*     open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;         */\n  /*     open_args.pathname   = my_font_pathname;                          */\n  /*     open_args.num_params = 1;                                         */\n  /*     open_args.params     = &parameter;                                */\n  /*                                                                       */\n  /*     error = FT_Open_Face( library, &open_args, index, &face );        */\n  /*     ...                                                               */\n  /*   }                                                                   */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_UNPATENTED_HINTING\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_INTERPRETER_SWITCH to compile the TrueType    */\n  /* bytecode interpreter with a huge switch statement, rather than a call */\n  /* table.  This results in smaller and faster code for a number of       */\n  /* architectures.                                                        */\n  /*                                                                       */\n  /* Note however that on some compiler/processor combinations, undefining */\n  /* this macro will generate faster, though larger, code.                 */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_INTERPRETER_SWITCH\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED to compile the        */\n  /* TrueType glyph loader to use Apple's definition of how to handle      */\n  /* component offsets in composite glyphs.                                */\n  /*                                                                       */\n  /* Apple and MS disagree on the default behavior of component offsets    */\n  /* in composites.  Apple says that they should be scaled by the scaling  */\n  /* factors in the transformation matrix (roughly, it's more complex)     */\n  /* while MS says they should not.  OpenType defines two bits in the      */\n  /* composite flags array which can be used to disambiguate, but old      */\n  /* fonts will not have them.                                             */\n  /*                                                                       */\n  /*   http://partners.adobe.com/asn/developer/opentype/glyf.html          */\n  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6glyf.html                 */\n  /*                                                                       */\n#undef TT_CONFIG_OPTION_COMPONENT_OFFSET_SCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_GX_VAR_SUPPORT if you want to include         */\n  /* support for Apple's distortable font technology (fvar, gvar, cvar,    */\n  /* and avar tables).  This has many similarities to Type 1 Multiple      */\n  /* Masters support.                                                      */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_GX_VAR_SUPPORT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define TT_CONFIG_OPTION_BDF if you want to include support for        */\n  /* an embedded `BDF ' table within SFNT-based bitmap formats.            */\n  /*                                                                       */\n#define TT_CONFIG_OPTION_BDF\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****      T Y P E 1   D R I V E R    C O N F I G U R A T I O N       ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_DICT_DEPTH is the maximal depth of nest dictionaries and       */\n  /* arrays in the Type 1 stream (see t1load.c).  A minimum of 4 is        */\n  /* required.                                                             */\n  /*                                                                       */\n#define T1_MAX_DICT_DEPTH  5\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\n  /* calls during glyph loading.                                           */\n  /*                                                                       */\n#define T1_MAX_SUBRS_CALLS  16\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\n  /* minimum of 16 is required.                                            */\n  /*                                                                       */\n  /* The Chinese font MingTiEG-Medium (CNS 11643 character set) needs 256. */\n  /*                                                                       */\n#define T1_MAX_CHARSTRINGS_OPERANDS  256\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of `t1afm', which is in charge of reading Type 1 AFM      */\n  /* files into an existing face.  Note that if set, the T1 driver will be */\n  /* unable to produce kerning distances.                                  */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_AFM\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Define this configuration macro if you want to prevent the            */\n  /* compilation of the Multiple Masters font support in the Type 1        */\n  /* driver.                                                               */\n  /*                                                                       */\n#undef T1_CONFIG_OPTION_NO_MM_SUPPORT\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /****                                                                 ****/\n  /****    A U T O F I T   M O D U L E    C O N F I G U R A T I O N     ****/\n  /****                                                                 ****/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with CJK script support.                       */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_CJK\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Compile autofit module with Indic script support.                     */\n  /*                                                                       */\n#define AF_CONFIG_OPTION_INDIC\n\n  /* */\n\n\n  /*\n   * Define this variable if you want to keep the layout of internal\n   * structures that was used prior to FreeType 2.2.  This also compiles in\n   * a few obsolete functions to avoid linking problems on typical Unix\n   * distributions.\n   *\n   * For embedded systems or building a new distribution from scratch, it\n   * is recommended to disable the macro since it reduces the library's code\n   * size and activates a few memory-saving optimizations as well.\n   */\n#define FT_CONFIG_OPTION_OLD_INTERNALS\n\n\n  /*\n   * This variable is defined if either unpatented or native TrueType\n   * hinting is requested by the definitions above.\n   */\n#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER\n#define  TT_USE_BYTECODE_INTERPRETER\n#elif defined TT_CONFIG_OPTION_UNPATENTED_HINTING\n#define  TT_USE_BYTECODE_INTERPRETER\n#endif\n\nFT_END_HEADER\n\n\n#endif /* __FTOPTION_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/config/ftstdlib.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstdlib.h                                                             */\n/*                                                                         */\n/*    ANSI-specific library and header configuration file (specification   */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2005, 2006, 2007 by                        */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to group all #includes to the ANSI C library that   */\n  /* FreeType normally requires.  It also defines macros to rename the     */\n  /* standard functions within the FreeType source code.                   */\n  /*                                                                       */\n  /* Load a file which defines __FTSTDLIB_H__ before this one to override  */\n  /* it.                                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSTDLIB_H__\n#define __FTSTDLIB_H__\n\n\n#include <stddef.h>\n\n#define ft_ptrdiff_t  ptrdiff_t\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           integer limits                           */\n  /*                                                                    */\n  /* UINT_MAX and ULONG_MAX are used to automatically compute the size  */\n  /* of `int' and `long' in bytes at compile-time.  So far, this works  */\n  /* for all platforms the library has been tested on.                  */\n  /*                                                                    */\n  /* Note that on the extremely rare platforms that do not provide      */\n  /* integer types that are _exactly_ 16 and 32 bits wide (e.g. some    */\n  /* old Crays where `int' is 36 bits), we do not make any guarantee    */\n  /* about the correct behaviour of FT2 with all fonts.                 */\n  /*                                                                    */\n  /* In these case, `ftconfig.h' will refuse to compile anyway with a   */\n  /* message like `couldn't find 32-bit type' or something similar.     */\n  /*                                                                    */\n  /* IMPORTANT NOTE: We do not define aliases for heap management and   */\n  /*                 i/o routines (i.e. malloc/free/fopen/fread/...)    */\n  /*                 since these functions should all be encapsulated   */\n  /*                 by platform-specific implementations of            */\n  /*                 `ftsystem.c'.                                      */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <limits.h>\n\n#define FT_CHAR_BIT   CHAR_BIT\n#define FT_INT_MAX    INT_MAX\n#define FT_UINT_MAX   UINT_MAX\n#define FT_ULONG_MAX  ULONG_MAX\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                 character and string processing                    */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <string.h>\n\n#define ft_memchr   memchr\n#define ft_memcmp   memcmp\n#define ft_memcpy   memcpy\n#define ft_memmove  memmove\n#define ft_memset   memset\n#define ft_strcat   strcat\n#define ft_strcmp   strcmp\n#define ft_strcpy   strcpy\n#define ft_strlen   strlen\n#define ft_strncmp  strncmp\n#define ft_strncpy  strncpy\n#define ft_strrchr  strrchr\n#define ft_strstr   strstr\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                           file handling                            */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdio.h>\n\n#define FT_FILE     FILE\n#define ft_fclose   fclose\n#define ft_fopen    fopen\n#define ft_fread    fread\n#define ft_fseek    fseek\n#define ft_ftell    ftell\n#define ft_sprintf  sprintf\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                             sorting                                */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <stdlib.h>\n\n#define ft_qsort  qsort\n\n#define ft_exit   exit    /* only used to exit from unhandled exceptions */\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                        memory allocation                           */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_scalloc   calloc\n#define ft_sfree     free\n#define ft_smalloc   malloc\n#define ft_srealloc  realloc\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                          miscellaneous                             */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#define ft_atol   atol\n#define ft_labs   labs\n\n\n  /**********************************************************************/\n  /*                                                                    */\n  /*                         execution control                          */\n  /*                                                                    */\n  /**********************************************************************/\n\n\n#include <setjmp.h>\n\n#define ft_jmp_buf     jmp_buf  /* note: this cannot be a typedef since */\n                                /*       jmp_buf is defined as a macro  */\n                                /*       on certain platforms           */\n\n#define ft_longjmp     longjmp\n#define ft_setjmp( b ) setjmp( *(jmp_buf*) &(b) )    /* same thing here */\n\n\n  /* the following is only used for debugging purposes, i.e., if */\n  /* FT_DEBUG_LEVEL_ERROR or FT_DEBUG_LEVEL_TRACE are defined    */\n\n#include <stdarg.h>\n\n\n#endif /* __FTSTDLIB_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/freetype.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  freetype.h                                                             */\n/*                                                                         */\n/*    FreeType high-level API and common types (specification only).       */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef FT_FREETYPE_H\n#error \"`ft2build.h' hasn't been included yet!\"\n#error \"Please always use macros to include FreeType header files.\"\n#error \"Example:\"\n#error \"  #include <ft2build.h>\"\n#error \"  #include FT_FREETYPE_H\"\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* The `raster' component duplicates some of the declarations in         */\n  /* freetype.h for stand-alone use if _FREETYPE_ isn't defined.           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FREETYPE_H__\n#define __FREETYPE_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_ERRORS_H\n#include FT_TYPES_H\n\n\nFT_BEGIN_HEADER\n\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    user_allocation                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    User allocation                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How client applications should allocate FreeType data structures.  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType assumes that structures allocated by the user and passed  */\n  /*    as arguments are zeroed out except for the actual data.  With      */\n  /*    other words, it is recommended to use `calloc' (or variants of it) */\n  /*    instead of `malloc' for allocation.                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                        B A S I C   T Y P E S                          */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    base_interface                                                     */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Base Interface                                                     */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The FreeType 2 base font interface.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section describes the public high-level API of FreeType 2.    */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Library                                                         */\n  /*    FT_Face                                                            */\n  /*    FT_Size                                                            */\n  /*    FT_GlyphSlot                                                       */\n  /*    FT_CharMap                                                         */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SCALABLE                                              */\n  /*    FT_FACE_FLAG_FIXED_SIZES                                           */\n  /*    FT_FACE_FLAG_FIXED_WIDTH                                           */\n  /*    FT_FACE_FLAG_HORIZONTAL                                            */\n  /*    FT_FACE_FLAG_VERTICAL                                              */\n  /*    FT_FACE_FLAG_SFNT                                                  */\n  /*    FT_FACE_FLAG_KERNING                                               */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS                                      */\n  /*    FT_FACE_FLAG_GLYPH_NAMES                                           */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS                                           */\n  /*    FT_FACE_FLAG_HINTER                                                */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD                                                 */\n  /*    FT_STYLE_FLAG_ITALIC                                               */\n  /*                                                                       */\n  /*    FT_SizeRec                                                         */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /*    FT_GlyphSlotRec                                                    */\n  /*    FT_Glyph_Metrics                                                   */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /*    FT_Init_FreeType                                                   */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /*    FT_New_Face                                                        */\n  /*    FT_Done_Face                                                       */\n  /*    FT_New_Memory_Face                                                 */\n  /*    FT_Open_Face                                                       */\n  /*    FT_Open_Args                                                       */\n  /*    FT_Parameter                                                       */\n  /*    FT_Attach_File                                                     */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /*    FT_Set_Char_Size                                                   */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*    FT_Request_Size                                                    */\n  /*    FT_Select_Size                                                     */\n  /*    FT_Size_Request_Type                                               */\n  /*    FT_Size_Request                                                    */\n  /*    FT_Set_Transform                                                   */\n  /*    FT_Load_Glyph                                                      */\n  /*    FT_Get_Char_Index                                                  */\n  /*    FT_Get_Name_Index                                                  */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /*    FT_OPEN_MEMORY                                                     */\n  /*    FT_OPEN_STREAM                                                     */\n  /*    FT_OPEN_PATHNAME                                                   */\n  /*    FT_OPEN_DRIVER                                                     */\n  /*    FT_OPEN_PARAMS                                                     */\n  /*                                                                       */\n  /*    FT_LOAD_DEFAULT                                                    */\n  /*    FT_LOAD_RENDER                                                     */\n  /*    FT_LOAD_MONOCHROME                                                 */\n  /*    FT_LOAD_LINEAR_DESIGN                                              */\n  /*    FT_LOAD_NO_SCALE                                                   */\n  /*    FT_LOAD_NO_HINTING                                                 */\n  /*    FT_LOAD_NO_BITMAP                                                  */\n  /*    FT_LOAD_CROP_BITMAP                                                */\n  /*                                                                       */\n  /*    FT_LOAD_VERTICAL_LAYOUT                                            */\n  /*    FT_LOAD_IGNORE_TRANSFORM                                           */\n  /*    FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH                                */\n  /*    FT_LOAD_FORCE_AUTOHINT                                             */\n  /*    FT_LOAD_NO_RECURSE                                                 */\n  /*    FT_LOAD_PEDANTIC                                                   */\n  /*                                                                       */\n  /*    FT_LOAD_TARGET_NORMAL                                              */\n  /*    FT_LOAD_TARGET_LIGHT                                               */\n  /*    FT_LOAD_TARGET_MONO                                                */\n  /*    FT_LOAD_TARGET_LCD                                                 */\n  /*    FT_LOAD_TARGET_LCD_V                                               */\n  /*                                                                       */\n  /*    FT_Render_Glyph                                                    */\n  /*    FT_Render_Mode                                                     */\n  /*    FT_Get_Kerning                                                     */\n  /*    FT_Kerning_Mode                                                    */\n  /*    FT_Get_Track_Kerning                                               */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /*    FT_CharMapRec                                                      */\n  /*    FT_Select_Charmap                                                  */\n  /*    FT_Set_Charmap                                                     */\n  /*    FT_Get_Charmap_Index                                               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Glyph_Metrics                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the metrics of a single glyph.  The      */\n  /*    values are expressed in 26.6 fractional pixel format; if the flag  */\n  /*    @FT_LOAD_NO_SCALE has been used while loading the glyph, values    */\n  /*    are expressed in font units instead.                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width ::                                                           */\n  /*      The glyph's width.                                               */\n  /*                                                                       */\n  /*    height ::                                                          */\n  /*      The glyph's height.                                              */\n  /*                                                                       */\n  /*    horiBearingX ::                                                    */\n  /*      Left side bearing for horizontal layout.                         */\n  /*                                                                       */\n  /*    horiBearingY ::                                                    */\n  /*      Top side bearing for horizontal layout.                          */\n  /*                                                                       */\n  /*    horiAdvance ::                                                     */\n  /*      Advance width for horizontal layout.                             */\n  /*                                                                       */\n  /*    vertBearingX ::                                                    */\n  /*      Left side bearing for vertical layout.                           */\n  /*                                                                       */\n  /*    vertBearingY ::                                                    */\n  /*      Top side bearing for vertical layout.                            */\n  /*                                                                       */\n  /*    vertAdvance ::                                                     */\n  /*      Advance height for vertical layout.                              */\n  /*                                                                       */\n  typedef struct  FT_Glyph_Metrics_\n  {\n    FT_Pos  width;\n    FT_Pos  height;\n\n    FT_Pos  horiBearingX;\n    FT_Pos  horiBearingY;\n    FT_Pos  horiAdvance;\n\n    FT_Pos  vertBearingX;\n    FT_Pos  vertBearingY;\n    FT_Pos  vertAdvance;\n\n  } FT_Glyph_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure models the metrics of a bitmap strike (i.e., a set  */\n  /*    of glyphs for a given point size and resolution) in a bitmap font. */\n  /*    It is used for the `available_sizes' field of @FT_Face.            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    height :: The vertical distance, in pixels, between two            */\n  /*              consecutive baselines.  It is always positive.           */\n  /*                                                                       */\n  /*    width  :: The average width, in pixels, of all glyphs in the       */\n  /*              strike.                                                  */\n  /*                                                                       */\n  /*    size   :: The nominal size of the strike in 26.6 fractional        */\n  /*              points.  This field is not very useful.                  */\n  /*                                                                       */\n  /*    x_ppem :: The horizontal ppem (nominal width) in 26.6 fractional   */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /*    y_ppem :: The vertical ppem (nominal height) in 26.6 fractional    */\n  /*              pixels.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Windows FNT:                                                       */\n  /*      The nominal size given in a FNT font is not reliable.  Thus when */\n  /*      the driver finds it incorrect, it sets `size' to some calculated */\n  /*      values and sets `x_ppem' and `y_ppem' to the pixel width and     */\n  /*      height given in the font, respectively.                          */\n  /*                                                                       */\n  /*    TrueType embedded bitmaps:                                         */\n  /*      `size', `width', and `height' values are not contained in the    */\n  /*      bitmap strike itself.  They are computed from the global font    */\n  /*      parameters.                                                      */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_Size_\n  {\n    FT_Short  height;\n    FT_Short  width;\n\n    FT_Pos    size;\n\n    FT_Pos    x_ppem;\n    FT_Pos    y_ppem;\n\n  } FT_Bitmap_Size;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                     O B J E C T   C L A S S E S                       */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Library                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a FreeType library instance.  Each `library' is        */\n  /*    completely independent from the others; it is the `root' of a set  */\n  /*    of objects like fonts, faces, sizes, etc.                          */\n  /*                                                                       */\n  /*    It also embeds a memory manager (see @FT_Memory), as well as a     */\n  /*    scan-line converter object (see @FT_Raster).                       */\n  /*                                                                       */\n  /*    For multi-threading applications each thread should have its own   */\n  /*    FT_Library object.                                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Library objects are normally created by @FT_Init_FreeType, and     */\n  /*    destroyed with @FT_Done_FreeType.                                  */\n  /*                                                                       */\n  typedef struct FT_LibraryRec_  *FT_Library;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Module                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType module object.  Each module can be a  */\n  /*    font driver, a renderer, or anything else that provides services   */\n  /*    to the formers.                                                    */\n  /*                                                                       */\n  typedef struct FT_ModuleRec_*  FT_Module;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Driver                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType font driver object.  Each font driver */\n  /*    is a special module capable of creating faces from font files.     */\n  /*                                                                       */\n  typedef struct FT_DriverRec_*  FT_Driver;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Renderer                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given FreeType renderer.  A renderer is a special    */\n  /*    module in charge of converting a glyph image to a bitmap, when     */\n  /*    necessary.  Each renderer supports a given glyph image format, and */\n  /*    one or more target surface depths.                                 */\n  /*                                                                       */\n  typedef struct FT_RendererRec_*  FT_Renderer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given typographic face object.  A face object models */\n  /*    a given typeface, in a given style.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each face object also owns a single @FT_GlyphSlot object, as well  */\n  /*    as one or more @FT_Size objects.                                   */\n  /*                                                                       */\n  /*    Use @FT_New_Face or @FT_Open_Face to create a new face object from */\n  /*    a given filepathname or a custom input stream.                     */\n  /*                                                                       */\n  /*    Use @FT_Done_Face to destroy it (along with its slot and sizes).   */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    The @FT_FaceRec details the publicly accessible fields of a given  */\n  /*    face object.                                                       */\n  /*                                                                       */\n  typedef struct FT_FaceRec_*  FT_Face;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a face scaled to a given       */\n  /*    character size.                                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Each @FT_Face has an _active_ @FT_Size object that is used by      */\n  /*    functions like @FT_Load_Glyph to determine the scaling             */\n  /*    transformation which is used to load and hint glyphs and metrics.  */\n  /*                                                                       */\n  /*    You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes,                */\n  /*    @FT_Request_Size or even @FT_Select_Size to change the content     */\n  /*    (i.e., the scaling values) of the active @FT_Size.                 */\n  /*                                                                       */\n  /*    You can use @FT_New_Size to create additional size objects for a   */\n  /*    given @FT_Face, but they won't be used by other functions until    */\n  /*    you activate it through @FT_Activate_Size.  Only one size can be   */\n  /*    activated at any given time per face.                              */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    The @FT_SizeRec structure details the publicly accessible fields   */\n  /*    of a given size object.                                            */\n  /*                                                                       */\n  typedef struct FT_SizeRec_*  FT_Size;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_GlyphSlot                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given `glyph slot'.  A slot is a container where it  */\n  /*    is possible to load any one of the glyphs contained in its parent  */\n  /*    face.                                                              */\n  /*                                                                       */\n  /*    In other words, each time you call @FT_Load_Glyph or               */\n  /*    @FT_Load_Char, the slot's content is erased by the new glyph data, */\n  /*    i.e., the glyph's metrics, its image (bitmap or outline), and      */\n  /*    other control information.                                         */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    @FT_GlyphSlotRec details the publicly accessible glyph fields.     */\n  /*                                                                       */\n  typedef struct FT_GlyphSlotRec_*  FT_GlyphSlot;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_CharMap                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a given character map.  A charmap is used to translate */\n  /*    character codes in a given encoding into glyph indexes for its     */\n  /*    parent's face.  Some font formats may provide several charmaps per */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    Each face object owns zero or more charmaps, but only one of them  */\n  /*    can be `active' and used by @FT_Get_Char_Index or @FT_Load_Char.   */\n  /*                                                                       */\n  /*    The list of available charmaps in a face is available through the  */\n  /*    `face->num_charmaps' and `face->charmaps' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    The currently active charmap is available as `face->charmap'.      */\n  /*    You should call @FT_Set_Charmap to change it.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When a new face is created (either through @FT_New_Face or         */\n  /*    @FT_Open_Face), the library looks for a Unicode charmap within     */\n  /*    the list and automatically activates it.                           */\n  /*                                                                       */\n  /* <Also>                                                                */\n  /*    The @FT_CharMapRec details the publicly accessible fields of a     */\n  /*    given character map.                                               */\n  /*                                                                       */\n  typedef struct FT_CharMapRec_*  FT_CharMap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_ENC_TAG                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags into an unsigned long.  It is */\n  /*    used to define `encoding' identifiers (see @FT_Encoding).          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16bit compilers don't like 32bit enumerations, you      */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_ENC_TAG( value, a, b, c, d )  value                   */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n\n#ifndef FT_ENC_TAG\n#define FT_ENC_TAG( value, a, b, c, d )         \\\n          value = ( ( (FT_UInt32)(a) << 24 ) |  \\\n                    ( (FT_UInt32)(b) << 16 ) |  \\\n                    ( (FT_UInt32)(c) <<  8 ) |  \\\n                      (FT_UInt32)(d)         )\n\n#endif /* FT_ENC_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Encoding                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify character sets supported by         */\n  /*    charmaps.  Used in the @FT_Select_Charmap API function.            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Despite the name, this enumeration lists specific character        */\n  /*    repertories (i.e., charsets), and not text encoding methods (e.g., */\n  /*    UTF-8, UTF-16, GB2312_EUC, etc.).                                  */\n  /*                                                                       */\n  /*    Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */\n  /*    all character codes must be expressed as FT_Longs.                 */\n  /*                                                                       */\n  /*    Other encodings might be defined in the future.                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*   FT_ENCODING_NONE ::                                                 */\n  /*     The encoding value 0 is reserved.                                 */\n  /*                                                                       */\n  /*   FT_ENCODING_UNICODE ::                                              */\n  /*     Corresponds to the Unicode character set.  This value covers      */\n  /*     all versions of the Unicode repertoire, including ASCII and       */\n  /*     Latin-1.  Most fonts include a Unicode charmap, but not all       */\n  /*     of them.                                                          */\n  /*                                                                       */\n  /*   FT_ENCODING_MS_SYMBOL ::                                            */\n  /*     Corresponds to the Microsoft Symbol encoding, used to encode      */\n  /*     mathematical symbols in the 32..255 character code range.  For    */\n  /*     more information, see `http://www.ceviz.net/symbol.htm'.          */\n  /*                                                                       */\n  /*   FT_ENCODING_SJIS ::                                                 */\n  /*     Corresponds to Japanese SJIS encoding.  More info at              */\n  /*     at `http://langsupport.japanreference.com/encoding.shtml'.        */\n  /*     See note on multi-byte encodings below.                           */\n  /*                                                                       */\n  /*   FT_ENCODING_GB2312 ::                                               */\n  /*     Corresponds to an encoding system for Simplified Chinese as used  */\n  /*     used in mainland China.                                           */\n  /*                                                                       */\n  /*   FT_ENCODING_BIG5 ::                                                 */\n  /*     Corresponds to an encoding system for Traditional Chinese as used */\n  /*     in Taiwan and Hong Kong.                                          */\n  /*                                                                       */\n  /*   FT_ENCODING_WANSUNG ::                                              */\n  /*     Corresponds to the Korean encoding system known as Wansung.       */\n  /*     For more information see                                          */\n  /*     `http://www.microsoft.com/typography/unicode/949.txt'.            */\n  /*                                                                       */\n  /*   FT_ENCODING_JOHAB ::                                                */\n  /*     The Korean standard character set (KS C-5601-1992), which         */\n  /*     corresponds to MS Windows code page 1361.  This character set     */\n  /*     includes all possible Hangeul character combinations.             */\n  /*                                                                       */\n  /*   FT_ENCODING_ADOBE_LATIN_1 ::                                        */\n  /*     Corresponds to a Latin-1 encoding as defined in a Type 1          */\n  /*     Postscript font.  It is limited to 256 character codes.           */\n  /*                                                                       */\n  /*   FT_ENCODING_ADOBE_STANDARD ::                                       */\n  /*     Corresponds to the Adobe Standard encoding, as found in Type 1,   */\n  /*     CFF, and OpenType/CFF fonts.  It is limited to 256 character      */\n  /*     codes.                                                            */\n  /*                                                                       */\n  /*   FT_ENCODING_ADOBE_EXPERT ::                                         */\n  /*     Corresponds to the Adobe Expert encoding, as found in Type 1,     */\n  /*     CFF, and OpenType/CFF fonts.  It is limited to 256 character      */\n  /*     codes.                                                            */\n  /*                                                                       */\n  /*   FT_ENCODING_ADOBE_CUSTOM ::                                         */\n  /*     Corresponds to a custom encoding, as found in Type 1, CFF, and    */\n  /*     OpenType/CFF fonts.  It is limited to 256 character codes.        */\n  /*                                                                       */\n  /*   FT_ENCODING_APPLE_ROMAN ::                                          */\n  /*     Corresponds to the 8-bit Apple roman encoding.  Many TrueType and */\n  /*     OpenType fonts contain a charmap for this encoding, since older   */\n  /*     versions of Mac OS are able to use it.                            */\n  /*                                                                       */\n  /*   FT_ENCODING_OLD_LATIN_2 ::                                          */\n  /*     This value is deprecated and was never used nor reported by       */\n  /*     FreeType.  Don't use or test for it.                              */\n  /*                                                                       */\n  /*   FT_ENCODING_MS_SJIS ::                                              */\n  /*     Same as FT_ENCODING_SJIS.  Deprecated.                            */\n  /*                                                                       */\n  /*   FT_ENCODING_MS_GB2312 ::                                            */\n  /*     Same as FT_ENCODING_GB2312.  Deprecated.                          */\n  /*                                                                       */\n  /*   FT_ENCODING_MS_BIG5 ::                                              */\n  /*     Same as FT_ENCODING_BIG5.  Deprecated.                            */\n  /*                                                                       */\n  /*   FT_ENCODING_MS_WANSUNG ::                                           */\n  /*     Same as FT_ENCODING_WANSUNG.  Deprecated.                         */\n  /*                                                                       */\n  /*   FT_ENCODING_MS_JOHAB ::                                             */\n  /*     Same as FT_ENCODING_JOHAB.  Deprecated.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   By default, FreeType automatically synthetizes a Unicode charmap    */\n  /*   for Postscript fonts, using their glyph names dictionaries.         */\n  /*   However, it also reports the encodings defined explicitly in the    */\n  /*   font file, for the cases when they are needed, with the Adobe       */\n  /*   values as well.                                                     */\n  /*                                                                       */\n  /*   FT_ENCODING_NONE is set by the BDF and PCF drivers if the charmap   */\n  /*   is neither Unicode nor ISO-8859-1 (otherwise it is set to           */\n  /*   FT_ENCODING_UNICODE).  Use @FT_Get_BDF_Charset_ID to find out which */\n  /*   encoding is really present.  If, for example, the `cs_registry'     */\n  /*   field is `KOI8' and the `cs_encoding' field is `R', the font is     */\n  /*   encoded in KOI8-R.                                                  */\n  /*                                                                       */\n  /*   FT_ENCODING_NONE is always set (with a single exception) by the     */\n  /*   winfonts driver.  Use @FT_Get_WinFNT_Header and examine the         */\n  /*   `charset' field of the @FT_WinFNT_HeaderRec structure to find out   */\n  /*   which encoding is really present.  For example,                     */\n  /*   @FT_WinFNT_ID_CP1251 (204) means Windows code page 1251 (for        */\n  /*   Russian).                                                           */\n  /*                                                                       */\n  /*   FT_ENCODING_NONE is set if `platform_id' is @TT_PLATFORM_MACINTOSH  */\n  /*   and `encoding_id' is not @TT_MAC_ID_ROMAN (otherwise it is set to   */\n  /*   FT_ENCODING_APPLE_ROMAN).                                           */\n  /*                                                                       */\n  /*   If `platform_id' is @TT_PLATFORM_MACINTOSH, use the function  c     */\n  /*   @FT_Get_CMap_Language_ID  to query the Mac language ID which may be */\n  /*   needed to be able to distinguish Apple encoding variants.  See      */\n  /*                                                                       */\n  /*     http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/README.TXT   */\n  /*                                                                       */\n  /*   to get an idea how to do that.  Basically, if the language ID is 0, */\n  /*   don't use it, otherwise subtract 1 from the language ID.  Then      */\n  /*   examine `encoding_id'.  If, for example, `encoding_id' is           */\n  /*   @TT_MAC_ID_ROMAN and the language ID (minus 1) is                   */\n  /*   `TT_MAC_LANGID_GREEK', it is the Greek encoding, not Roman.         */\n  /*   @TT_MAC_ID_ARABIC with `TT_MAC_LANGID_FARSI' means the Farsi        */\n  /*   variant the Arabic encoding.                                        */\n  /*                                                                       */\n  typedef enum  FT_Encoding_\n  {\n    FT_ENC_TAG( FT_ENCODING_NONE, 0, 0, 0, 0 ),\n\n    FT_ENC_TAG( FT_ENCODING_MS_SYMBOL, 's', 'y', 'm', 'b' ),\n    FT_ENC_TAG( FT_ENCODING_UNICODE,   'u', 'n', 'i', 'c' ),\n\n    FT_ENC_TAG( FT_ENCODING_SJIS,    's', 'j', 'i', 's' ),\n    FT_ENC_TAG( FT_ENCODING_GB2312,  'g', 'b', ' ', ' ' ),\n    FT_ENC_TAG( FT_ENCODING_BIG5,    'b', 'i', 'g', '5' ),\n    FT_ENC_TAG( FT_ENCODING_WANSUNG, 'w', 'a', 'n', 's' ),\n    FT_ENC_TAG( FT_ENCODING_JOHAB,   'j', 'o', 'h', 'a' ),\n\n    /* for backwards compatibility */\n    FT_ENCODING_MS_SJIS    = FT_ENCODING_SJIS,\n    FT_ENCODING_MS_GB2312  = FT_ENCODING_GB2312,\n    FT_ENCODING_MS_BIG5    = FT_ENCODING_BIG5,\n    FT_ENCODING_MS_WANSUNG = FT_ENCODING_WANSUNG,\n    FT_ENCODING_MS_JOHAB   = FT_ENCODING_JOHAB,\n\n    FT_ENC_TAG( FT_ENCODING_ADOBE_STANDARD, 'A', 'D', 'O', 'B' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_EXPERT,   'A', 'D', 'B', 'E' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_CUSTOM,   'A', 'D', 'B', 'C' ),\n    FT_ENC_TAG( FT_ENCODING_ADOBE_LATIN_1,  'l', 'a', 't', '1' ),\n\n    FT_ENC_TAG( FT_ENCODING_OLD_LATIN_2, 'l', 'a', 't', '2' ),\n\n    FT_ENC_TAG( FT_ENCODING_APPLE_ROMAN, 'a', 'r', 'm', 'n' )\n\n  } FT_Encoding;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_encoding_xxx                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated; use the corresponding @FT_Encoding */\n  /*    values instead.                                                    */\n  /*                                                                       */\n#define ft_encoding_none            FT_ENCODING_NONE\n#define ft_encoding_unicode         FT_ENCODING_UNICODE\n#define ft_encoding_symbol          FT_ENCODING_MS_SYMBOL\n#define ft_encoding_latin_1         FT_ENCODING_ADOBE_LATIN_1\n#define ft_encoding_latin_2         FT_ENCODING_OLD_LATIN_2\n#define ft_encoding_sjis            FT_ENCODING_SJIS\n#define ft_encoding_gb2312          FT_ENCODING_GB2312\n#define ft_encoding_big5            FT_ENCODING_BIG5\n#define ft_encoding_wansung         FT_ENCODING_WANSUNG\n#define ft_encoding_johab           FT_ENCODING_JOHAB\n\n#define ft_encoding_adobe_standard  FT_ENCODING_ADOBE_STANDARD\n#define ft_encoding_adobe_expert    FT_ENCODING_ADOBE_EXPERT\n#define ft_encoding_adobe_custom    FT_ENCODING_ADOBE_CUSTOM\n#define ft_encoding_apple_roman     FT_ENCODING_APPLE_ROMAN\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_CharMapRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The base charmap structure.                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face        :: A handle to the parent face object.                 */\n  /*                                                                       */\n  /*    encoding    :: An @FT_Encoding tag identifying the charmap.  Use   */\n  /*                   this with @FT_Select_Charmap.                       */\n  /*                                                                       */\n  /*    platform_id :: An ID number describing the platform for the        */\n  /*                   following encoding ID.  This comes directly from    */\n  /*                   the TrueType specification and should be emulated   */\n  /*                   for other formats.                                  */\n  /*                                                                       */\n  /*    encoding_id :: A platform specific encoding number.  This also     */\n  /*                   comes from the TrueType specification and should be */\n  /*                   emulated similarly.                                 */\n  /*                                                                       */\n  typedef struct  FT_CharMapRec_\n  {\n    FT_Face      face;\n    FT_Encoding  encoding;\n    FT_UShort    platform_id;\n    FT_UShort    encoding_id;\n\n  } FT_CharMapRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                 B A S E   O B J E C T   C L A S S E S                 */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Face_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Face_InternalRec' structure, used to    */\n  /*    model private data of a given @FT_Face object.                     */\n  /*                                                                       */\n  /*    This structure might change between releases of FreeType 2 and is  */\n  /*    not generally available to client applications.                    */\n  /*                                                                       */\n  typedef struct FT_Face_InternalRec_*  FT_Face_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_FaceRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root face class structure.  A face object models a        */\n  /*    typeface in a font file.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_faces           :: The number of faces in the font file.  Some */\n  /*                           font formats can have multiple faces in     */\n  /*                           a font file.                                */\n  /*                                                                       */\n  /*    face_index          :: The index of the face in the font file.  It */\n  /*                           is set to 0 if there is only one face in    */\n  /*                           the font file.                              */\n  /*                                                                       */\n  /*    face_flags          :: A set of bit flags that give important      */\n  /*                           information about the face; see             */\n  /*                           @FT_FACE_FLAG_XXX for the details.          */\n  /*                                                                       */\n  /*    style_flags         :: A set of bit flags indicating the style of  */\n  /*                           the face; see @FT_STYLE_FLAG_XXX for the    */\n  /*                           details.                                    */\n  /*                                                                       */\n  /*    num_glyphs          :: The number of glyphs in the face.  If the   */\n  /*                           face is scalable and has sbits (see         */\n  /*                           `num_fixed_sizes'), it is set to the number */\n  /*                           of outline glyphs.                          */\n  /*                                                                       */\n  /*    family_name         :: The face's family name.  This is an ASCII   */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's family (like `Times New      */\n  /*                           Roman', `Bodoni', `Garamond', etc).  This   */\n  /*                           is a least common denominator used to list  */\n  /*                           fonts.  Some formats (TrueType & OpenType)  */\n  /*                           provide localized and Unicode versions of   */\n  /*                           this string.  Applications should use the   */\n  /*                           format specific interface to access them.   */\n  /*                                                                       */\n  /*    style_name          :: The face's style name.  This is an ASCII    */\n  /*                           string, usually in English, which describes */\n  /*                           the typeface's style (like `Italic',        */\n  /*                           `Bold', `Condensed', etc).  Not all font    */\n  /*                           formats provide a style name, so this field */\n  /*                           is optional, and can be set to NULL.  As    */\n  /*                           for `family_name', some formats provide     */\n  /*                           localized and Unicode versions of this      */\n  /*                           string.  Applications should use the format */\n  /*                           specific interface to access them.          */\n  /*                                                                       */\n  /*    num_fixed_sizes     :: The number of bitmap strikes in the face.   */\n  /*                           Even if the face is scalable, there might   */\n  /*                           still be bitmap strikes, which are called   */\n  /*                           `sbits' in that case.                       */\n  /*                                                                       */\n  /*    available_sizes     :: An array of @FT_Bitmap_Size for all bitmap  */\n  /*                           strikes in the face.  It is set to NULL if  */\n  /*                           there is no bitmap strike.                  */\n  /*                                                                       */\n  /*    num_charmaps        :: The number of charmaps in the face.         */\n  /*                                                                       */\n  /*    charmaps            :: An array of the charmaps of the face.       */\n  /*                                                                       */\n  /*    generic             :: A field reserved for client uses.  See the  */\n  /*                           @FT_Generic type description.               */\n  /*                                                                       */\n  /*    bbox                :: The font bounding box.  Coordinates are     */\n  /*                           expressed in font units (see                */\n  /*                           `units_per_EM').  The box is large enough   */\n  /*                           to contain any glyph from the font.  Thus,  */\n  /*                           `bbox.yMax' can be seen as the `maximal     */\n  /*                           ascender', and `bbox.yMin' as the `minimal  */\n  /*                           descender'.  Only relevant for scalable     */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    units_per_EM        :: The number of font units per EM square for  */\n  /*                           this face.  This is typically 2048 for      */\n  /*                           TrueType fonts, and 1000 for Type 1 fonts.  */\n  /*                           Only relevant for scalable formats.         */\n  /*                                                                       */\n  /*    ascender            :: The typographic ascender of the face,       */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMax'.  Only relevant for scalable    */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    descender           :: The typographic descender of the face,      */\n  /*                           expressed in font units.  For font formats  */\n  /*                           not having this information, it is set to   */\n  /*                           `bbox.yMin'.  Note that this field is       */\n  /*                           usually negative.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    height              :: The height is the vertical distance         */\n  /*                           between two consecutive baselines,          */\n  /*                           expressed in font units.  It is always      */\n  /*                           positive.  Only relevant for scalable       */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    max_advance_width   :: The maximal advance width, in font units,   */\n  /*                           for all glyphs in this face.  This can be   */\n  /*                           used to make word wrapping computations     */\n  /*                           faster.  Only relevant for scalable         */\n  /*                           formats.                                    */\n  /*                                                                       */\n  /*    max_advance_height  :: The maximal advance height, in font units,  */\n  /*                           for all glyphs in this face.  This is only  */\n  /*                           relevant for vertical layouts, and is set   */\n  /*                           to `height' for fonts that do not provide   */\n  /*                           vertical metrics.  Only relevant for        */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    underline_position  :: The position, in font units, of the         */\n  /*                           underline line for this face.  It's the     */\n  /*                           center of the underlining stem.  Only       */\n  /*                           relevant for scalable formats.              */\n  /*                                                                       */\n  /*    underline_thickness :: The thickness, in font units, of the        */\n  /*                           underline for this face.  Only relevant for */\n  /*                           scalable formats.                           */\n  /*                                                                       */\n  /*    glyph               :: The face's associated glyph slot(s).        */\n  /*                                                                       */\n  /*    size                :: The current active size for this face.      */\n  /*                                                                       */\n  /*    charmap             :: The current active charmap for this face.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   Fields may be changed after a call to @FT_Attach_File or            */\n  /*   @FT_Attach_Stream.                                                  */\n  /*                                                                       */\n  typedef struct  FT_FaceRec_\n  {\n    FT_Long           num_faces;\n    FT_Long           face_index;\n\n    FT_Long           face_flags;\n    FT_Long           style_flags;\n\n    FT_Long           num_glyphs;\n\n    FT_String*        family_name;\n    FT_String*        style_name;\n\n    FT_Int            num_fixed_sizes;\n    FT_Bitmap_Size*   available_sizes;\n\n    FT_Int            num_charmaps;\n    FT_CharMap*       charmaps;\n\n    FT_Generic        generic;\n\n    /*# The following member variables (down to `underline_thickness') */\n    /*# are only relevant to scalable outlines; cf. @FT_Bitmap_Size    */\n    /*# for bitmap fonts.                                              */\n    FT_BBox           bbox;\n\n    FT_UShort         units_per_EM;\n    FT_Short          ascender;\n    FT_Short          descender;\n    FT_Short          height;\n\n    FT_Short          max_advance_width;\n    FT_Short          max_advance_height;\n\n    FT_Short          underline_position;\n    FT_Short          underline_thickness;\n\n    FT_GlyphSlot      glyph;\n    FT_Size           size;\n    FT_CharMap        charmap;\n\n    /*@private begin */\n\n    FT_Driver         driver;\n    FT_Memory         memory;\n    FT_Stream         stream;\n\n    FT_ListRec        sizes_list;\n\n    FT_Generic        autohint;\n    void*             extensions;\n\n    FT_Face_Internal  internal;\n\n    /*@private end */\n\n  } FT_FaceRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_FACE_FLAG_XXX                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flags used in the `face_flags' field of the          */\n  /*    @FT_FaceRec structure.  They inform client applications of         */\n  /*    properties of the corresponding face.                              */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_FACE_FLAG_SCALABLE ::                                           */\n  /*      Indicates that the face contains outline glyphs.  This doesn't   */\n  /*      prevent bitmap strikes, i.e., a face can have both this and      */\n  /*      and @FT_FACE_FLAG_FIXED_SIZES set.                               */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_SIZES ::                                        */\n  /*      Indicates that the face contains bitmap strikes.  See also the   */\n  /*      `num_fixed_sizes' and `available_sizes' fields of @FT_FaceRec.   */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FIXED_WIDTH ::                                        */\n  /*      Indicates that the face contains fixed-width characters (like    */\n  /*      Courier, Lucido, MonoType, etc.).                                */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_SFNT ::                                               */\n  /*      Indicates that the face uses the `sfnt' storage scheme.  For     */\n  /*      now, this means TrueType and OpenType.                           */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HORIZONTAL ::                                         */\n  /*      Indicates that the face contains horizontal glyph metrics.  This */\n  /*      should be set for all common formats.                            */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_VERTICAL ::                                           */\n  /*      Indicates that the face contains vertical glyph metrics.  This   */\n  /*      is only available in some formats, not all of them.              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_KERNING ::                                            */\n  /*      Indicates that the face contains kerning information.  If set,   */\n  /*      the kerning distance can be retrieved through the function       */\n  /*      @FT_Get_Kerning.  Otherwise the function always return the       */\n  /*      vector (0,0).  Note that FreeType doesn't handle kerning data    */\n  /*      from the `GPOS' table (as present in some OpenType fonts).       */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_FAST_GLYPHS ::                                        */\n  /*      THIS FLAG IS DEPRECATED.  DO NOT USE OR TEST IT.                 */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_MULTIPLE_MASTERS ::                                   */\n  /*      Indicates that the font contains multiple masters and is capable */\n  /*      of interpolating between them.  See the multiple-masters         */\n  /*      specific API for details.                                        */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_GLYPH_NAMES ::                                        */\n  /*      Indicates that the font contains glyph names that can be         */\n  /*      retrieved through @FT_Get_Glyph_Name.  Note that some TrueType   */\n  /*      fonts contain broken glyph name tables.  Use the function        */\n  /*      @FT_Has_PS_Glyph_Names when needed.                              */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_EXTERNAL_STREAM ::                                    */\n  /*      Used internally by FreeType to indicate that a face's stream was */\n  /*      provided by the client application and should not be destroyed   */\n  /*      when @FT_Done_Face is called.  Don't read or test this flag.     */\n  /*                                                                       */\n  /*    FT_FACE_FLAG_HINTER ::                                             */\n  /*      Set if the font driver has a hinting machine of its own.  For    */\n  /*      example, with TrueType fonts, it makes sense to use data from    */\n  /*      the SFNT `gasp' table only if the native TrueType hinting engine */\n  /*      (with the bytecode interpreter) is available and active.         */\n  /*                                                                       */\n#define FT_FACE_FLAG_SCALABLE          ( 1L <<  0 )\n#define FT_FACE_FLAG_FIXED_SIZES       ( 1L <<  1 )\n#define FT_FACE_FLAG_FIXED_WIDTH       ( 1L <<  2 )\n#define FT_FACE_FLAG_SFNT              ( 1L <<  3 )\n#define FT_FACE_FLAG_HORIZONTAL        ( 1L <<  4 )\n#define FT_FACE_FLAG_VERTICAL          ( 1L <<  5 )\n#define FT_FACE_FLAG_KERNING           ( 1L <<  6 )\n#define FT_FACE_FLAG_FAST_GLYPHS       ( 1L <<  7 )\n#define FT_FACE_FLAG_MULTIPLE_MASTERS  ( 1L <<  8 )\n#define FT_FACE_FLAG_GLYPH_NAMES       ( 1L <<  9 )\n#define FT_FACE_FLAG_EXTERNAL_STREAM   ( 1L << 10 )\n#define FT_FACE_FLAG_HINTER            ( 1L << 11 )\n\n  /* */\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_HORIZONTAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains\n   *   horizontal metrics (this is true for all font formats though).\n   *\n   * @also:\n   *   @FT_HAS_VERTICAL can be used to check for vertical metrics.\n   *\n   */\n#define FT_HAS_HORIZONTAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_HORIZONTAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_VERTICAL( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains vertical\n   *   metrics.\n   *\n   */\n#define FT_HAS_VERTICAL( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_VERTICAL )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_KERNING( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains kerning\n   *   data that can be accessed with @FT_Get_Kerning.\n   *\n   */\n#define FT_HAS_KERNING( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_KERNING )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SCALABLE( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a scalable\n   *   font face (true for TrueType, Type 1, Type 42, CID, OpenType/CFF,\n   *   and PFR font formats.\n   *\n   */\n#define FT_IS_SCALABLE( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SCALABLE )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_SFNT( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font\n   *   whose format is based on the SFNT storage scheme.  This usually\n   *   means: TrueType fonts, OpenType fonts, as well as SFNT-based embedded\n   *   bitmap fonts.\n   *\n   *   If this macro is true, all functions defined in @FT_SFNT_NAMES_H and\n   *   @FT_TRUETYPE_TABLES_H are available.\n   *\n   */\n#define FT_IS_SFNT( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_SFNT )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_IS_FIXED_WIDTH( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains a font face\n   *   that contains fixed-width (or `monospace', `fixed-pitch', etc.)\n   *   glyphs.\n   *\n   */\n#define FT_IS_FIXED_WIDTH( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_WIDTH )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FIXED_SIZES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   embedded bitmaps.  See the `available_sizes' field of the\n   *   @FT_FaceRec structure.\n   *\n   */\n#define FT_HAS_FIXED_SIZES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES )\n\n  /* */\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_FAST_GLYPHS( face )\n   *\n   * @description:\n   *   Deprecated.\n   *\n   */\n#define FT_HAS_FAST_GLYPHS( face )  0\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_GLYPH_NAMES( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some glyph\n   *   names that can be accessed through @FT_Get_Glyph_Name.\n   *\n   */\n#define FT_HAS_GLYPH_NAMES( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_GLYPH_NAMES )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_HAS_MULTIPLE_MASTERS( face )\n   *\n   * @description:\n   *   A macro that returns true whenever a face object contains some\n   *   multiple masters.  The functions provided by @FT_MULTIPLE_MASTERS_H\n   *   are then available to choose the exact design you want.\n   *\n   */\n#define FT_HAS_MULTIPLE_MASTERS( face ) \\\n          ( face->face_flags & FT_FACE_FLAG_MULTIPLE_MASTERS )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Constant>                                                            */\n  /*    FT_STYLE_FLAG_XXX                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-flags used to indicate the style of a given face.    */\n  /*    These are used in the `style_flags' field of @FT_FaceRec.          */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_STYLE_FLAG_ITALIC ::                                            */\n  /*      Indicates that a given face is italicized.                       */\n  /*                                                                       */\n  /*    FT_STYLE_FLAG_BOLD ::                                              */\n  /*      Indicates that a given face is bold.                             */\n  /*                                                                       */\n#define FT_STYLE_FLAG_ITALIC  ( 1 << 0 )\n#define FT_STYLE_FLAG_BOLD    ( 1 << 1 )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Size_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Size_InternalRec' structure, used to    */\n  /*    model private data of a given FT_Size object.                      */\n  /*                                                                       */\n  typedef struct FT_Size_InternalRec_*  FT_Size_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_Metrics                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The size metrics structure gives the metrics of a size object.     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x_ppem       :: The width of the scaled EM square in pixels, hence */\n  /*                    the term `ppem' (pixels per EM).  It is also       */\n  /*                    referred to as `nominal width'.                    */\n  /*                                                                       */\n  /*    y_ppem       :: The height of the scaled EM square in pixels,      */\n  /*                    hence the term `ppem' (pixels per EM).  It is also */\n  /*                    referred to as `nominal height'.                   */\n  /*                                                                       */\n  /*    x_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    horizontal metrics from font units to 26.6         */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    y_scale      :: A 16.16 fractional scaling value used to convert   */\n  /*                    vertical metrics from font units to 26.6           */\n  /*                    fractional pixels.  Only relevant for scalable     */\n  /*                    font formats.                                      */\n  /*                                                                       */\n  /*    ascender     :: The ascender in 26.6 fractional pixels.  See       */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    descender    :: The descender in 26.6 fractional pixels.  See      */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    height       :: The height in 26.6 fractional pixels.  See         */\n  /*                    @FT_FaceRec for the details.                       */\n  /*                                                                       */\n  /*    max_advance  :: The maximal advance width in 26.6 fractional       */\n  /*                    pixels.  See @FT_FaceRec for the details.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The scaling values, if relevant, are determined first during a     */\n  /*    size changing operation.  The remaining fields are then set by the */\n  /*    driver.  For scalable formats, they are usually set to scaled      */\n  /*    values of the corresponding fields in @FT_FaceRec.                 */\n  /*                                                                       */\n  /*    Note that due to glyph hinting, these values might not be exact    */\n  /*    for certain fonts.  Thus they must be treated as unreliable        */\n  /*    with an error margin of at least one pixel!                        */\n  /*                                                                       */\n  /*    Indeed, the only way to get the exact metrics is to render _all_   */\n  /*    glyphs.  As this would be a definite performance hit, it is up to  */\n  /*    client applications to perform such computations.                  */\n  /*                                                                       */\n  /*    The FT_Size_Metrics structure is valid for bitmap fonts also.      */\n  /*                                                                       */\n  typedef struct  FT_Size_Metrics_\n  {\n    FT_UShort  x_ppem;      /* horizontal pixels per EM               */\n    FT_UShort  y_ppem;      /* vertical pixels per EM                 */\n\n    FT_Fixed   x_scale;     /* scaling values used to convert font    */\n    FT_Fixed   y_scale;     /* units to 26.6 fractional pixels        */\n\n    FT_Pos     ascender;    /* ascender in 26.6 frac. pixels          */\n    FT_Pos     descender;   /* descender in 26.6 frac. pixels         */\n    FT_Pos     height;      /* text height in 26.6 frac. pixels       */\n    FT_Pos     max_advance; /* max horizontal advance, in 26.6 pixels */\n\n  } FT_Size_Metrics;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SizeRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root size class structure.  A size object models a face   */\n  /*    object at a given size.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face    :: Handle to the parent face object.                       */\n  /*                                                                       */\n  /*    generic :: A typeless pointer, which is unused by the FreeType     */\n  /*               library or any of its drivers.  It can be used by       */\n  /*               client applications to link their own data to each size */\n  /*               object.                                                 */\n  /*                                                                       */\n  /*    metrics :: Metrics for this size object.  This field is read-only. */\n  /*                                                                       */\n  typedef struct  FT_SizeRec_\n  {\n    FT_Face           face;      /* parent face object              */\n    FT_Generic        generic;   /* generic pointer for client uses */\n    FT_Size_Metrics   metrics;   /* size metrics                    */\n    FT_Size_Internal  internal;\n\n  } FT_SizeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SubGlyph                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The subglyph structure is an internal object used to describe      */\n  /*    subglyphs (for example, in the case of composites).                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The subglyph implementation is not part of the high-level API,     */\n  /*    hence the forward structure declaration.                           */\n  /*                                                                       */\n  /*    You can however retrieve subglyph information with                 */\n  /*    @FT_Get_SubGlyph_Info.                                             */\n  /*                                                                       */\n  typedef struct FT_SubGlyphRec_*  FT_SubGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Slot_Internal                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to an `FT_Slot_InternalRec' structure, used to    */\n  /*    model private data of a given FT_GlyphSlot object.                 */\n  /*                                                                       */\n  typedef struct FT_Slot_InternalRec_*  FT_Slot_Internal;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphSlotRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType root glyph slot class structure.  A glyph slot is a       */\n  /*    container where individual glyphs can be loaded, be they in        */\n  /*    outline or bitmap format.                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library           :: A handle to the FreeType library instance     */\n  /*                         this slot belongs to.                         */\n  /*                                                                       */\n  /*    face              :: A handle to the parent face object.           */\n  /*                                                                       */\n  /*    next              :: In some cases (like some font tools), several */\n  /*                         glyph slots per face object can be a good     */\n  /*                         thing.  As this is rare, the glyph slots are  */\n  /*                         listed through a direct, single-linked list   */\n  /*                         using its `next' field.                       */\n  /*                                                                       */\n  /*    generic           :: A typeless pointer which is unused by the     */\n  /*                         FreeType library or any of its drivers.  It   */\n  /*                         can be used by client applications to link    */\n  /*                         their own data to each glyph slot object.     */\n  /*                                                                       */\n  /*    metrics           :: The metrics of the last loaded glyph in the   */\n  /*                         slot.  The returned values depend on the last */\n  /*                         load flags (see the @FT_Load_Glyph API        */\n  /*                         function) and can be expressed either in 26.6 */\n  /*                         fractional pixels or font units.              */\n  /*                                                                       */\n  /*                         Note that even when the glyph image is        */\n  /*                         transformed, the metrics are not.             */\n  /*                                                                       */\n  /*    linearHoriAdvance :: The advance width of the unhinted glyph.      */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    linearVertAdvance :: The advance height of the unhinted glyph.     */\n  /*                         Its value is expressed in 16.16 fractional    */\n  /*                         pixels, unless @FT_LOAD_LINEAR_DESIGN is set  */\n  /*                         when loading the glyph.  This field can be    */\n  /*                         important to perform correct WYSIWYG layout.  */\n  /*                         Only relevant for outline glyphs.             */\n  /*                                                                       */\n  /*    advance           :: This is the transformed advance width for the */\n  /*                         glyph.                                        */\n  /*                                                                       */\n  /*    format            :: This field indicates the format of the image  */\n  /*                         contained in the glyph slot.  Typically       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP,                      */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE, or                  */\n  /*                         @FT_GLYPH_FORMAT_COMPOSITE, but others are    */\n  /*                         possible.                                     */\n  /*                                                                       */\n  /*    bitmap            :: This field is used as a bitmap descriptor     */\n  /*                         when the slot format is                       */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.  Note that the       */\n  /*                         address and content of the bitmap buffer can  */\n  /*                         change between calls of @FT_Load_Glyph and a  */\n  /*                         few other functions.                          */\n  /*                                                                       */\n  /*    bitmap_left       :: This is the bitmap's left bearing expressed   */\n  /*                         in integer pixels.  Of course, this is only   */\n  /*                         valid if the format is                        */\n  /*                         @FT_GLYPH_FORMAT_BITMAP.                      */\n  /*                                                                       */\n  /*    bitmap_top        :: This is the bitmap's top bearing expressed in */\n  /*                         integer pixels.  Remember that this is the    */\n  /*                         distance from the baseline to the top-most    */\n  /*                         glyph scanline, upwards y-coordinates being   */\n  /*                         *positive*.                                   */\n  /*                                                                       */\n  /*    outline           :: The outline descriptor for the current glyph  */\n  /*                         image if its format is                        */\n  /*                         @FT_GLYPH_FORMAT_OUTLINE.  Once a glyph is    */\n  /*                         loaded, `outline' can be transformed,         */\n  /*                         distorted, embolded, etc.  However, it must   */\n  /*                         not be freed.                                 */\n  /*                                                                       */\n  /*    num_subglyphs     :: The number of subglyphs in a composite glyph. */\n  /*                         This field is only valid for the composite    */\n  /*                         glyph format that should normally only be     */\n  /*                         loaded with the @FT_LOAD_NO_RECURSE flag.     */\n  /*                         For now this is internal to FreeType.         */\n  /*                                                                       */\n  /*    subglyphs         :: An array of subglyph descriptors for          */\n  /*                         composite glyphs.  There are `num_subglyphs'  */\n  /*                         elements in there.  Currently internal to     */\n  /*                         FreeType.                                     */\n  /*                                                                       */\n  /*    control_data      :: Certain font drivers can also return the      */\n  /*                         control data for a given glyph image (e.g.    */\n  /*                         TrueType bytecode, Type 1 charstrings, etc.). */\n  /*                         This field is a pointer to such data.         */\n  /*                                                                       */\n  /*    control_len       :: This is the length in bytes of the control    */\n  /*                         data.                                         */\n  /*                                                                       */\n  /*    other             :: Really wicked formats can use this pointer to */\n  /*                         present their own glyph image to client       */\n  /*                         applications.  Note that the application      */\n  /*                         needs to know about the image format.         */\n  /*                                                                       */\n  /*    lsb_delta         :: The difference between hinted and unhinted    */\n  /*                         left side bearing while autohinting is        */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /*    rsb_delta         :: The difference between hinted and unhinted    */\n  /*                         right side bearing while autohinting is       */\n  /*                         active.  Zero otherwise.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If @FT_Load_Glyph is called with default flags (see                */\n  /*    @FT_LOAD_DEFAULT) the glyph image is loaded in the glyph slot in   */\n  /*    its native format (e.g., an outline glyph for TrueType and Type 1  */\n  /*    formats).                                                          */\n  /*                                                                       */\n  /*    This image can later be converted into a bitmap by calling         */\n  /*    @FT_Render_Glyph.  This function finds the current renderer for    */\n  /*    the native image's format then invokes it.                         */\n  /*                                                                       */\n  /*    The renderer is in charge of transforming the native image through */\n  /*    the slot's face transformation fields, then convert it into a      */\n  /*    bitmap that is returned in `slot->bitmap'.                         */\n  /*                                                                       */\n  /*    Note that `slot->bitmap_left' and `slot->bitmap_top' are also used */\n  /*    to specify the position of the bitmap relative to the current pen  */\n  /*    position (e.g., coordinates (0,0) on the baseline).  Of course,    */\n  /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Here a small pseudo code fragment which shows how to use           */\n  /*    `lsb_delta' and `rsb_delta':                                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Pos  origin_x       = 0;                                      */\n  /*      FT_Pos  prev_rsb_delta = 0;                                      */\n  /*                                                                       */\n  /*                                                                       */\n  /*      for all glyphs do                                                */\n  /*        <compute kern between current and previous glyph and add it to */\n  /*         `origin_x'>                                                   */\n  /*                                                                       */\n  /*        <load glyph with `FT_Load_Glyph'>                              */\n  /*                                                                       */\n  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */\n  /*          origin_x -= 64;                                              */\n  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */\n  /*          origin_x += 64;                                              */\n  /*                                                                       */\n  /*        prev_rsb_delta = face->glyph->rsb_delta;                       */\n  /*                                                                       */\n  /*        <save glyph image, or render glyph, or ...>                    */\n  /*                                                                       */\n  /*        origin_x += face->glyph->advance.x;                            */\n  /*      endfor                                                           */\n  /*    }                                                                  */\n  /*                                                                       */\n  typedef struct  FT_GlyphSlotRec_\n  {\n    FT_Library        library;\n    FT_Face           face;\n    FT_GlyphSlot      next;\n    FT_UInt           reserved;       /* retained for binary compatibility */\n    FT_Generic        generic;\n\n    FT_Glyph_Metrics  metrics;\n    FT_Fixed          linearHoriAdvance;\n    FT_Fixed          linearVertAdvance;\n    FT_Vector         advance;\n\n    FT_Glyph_Format   format;\n\n    FT_Bitmap         bitmap;\n    FT_Int            bitmap_left;\n    FT_Int            bitmap_top;\n\n    FT_Outline        outline;\n\n    FT_UInt           num_subglyphs;\n    FT_SubGlyph       subglyphs;\n\n    void*             control_data;\n    long              control_len;\n\n    FT_Pos            lsb_delta;\n    FT_Pos            rsb_delta;\n\n    void*             other;\n\n    FT_Slot_Internal  internal;\n\n  } FT_GlyphSlotRec;\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                         F U N C T I O N S                             */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Init_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a new FreeType library object.  The set of modules      */\n  /*    that are registered by this function is determined at build time.  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A handle to a new library object.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Init_FreeType( FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_FreeType                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a given FreeType library object and all of its children,   */\n  /*    including resources, drivers, faces, sizes, etc.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library object.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_FreeType( FT_Library  library );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_OPEN_XXX                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants used within the `flags' field of the */\n  /*    @FT_Open_Args structure.                                           */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OPEN_MEMORY      :: This is a memory-based stream.              */\n  /*                                                                       */\n  /*    FT_OPEN_STREAM      :: Copy the stream from the `stream' field.    */\n  /*                                                                       */\n  /*    FT_OPEN_PATHNAME    :: Create a new input stream from a C          */\n  /*                           path name.                                  */\n  /*                                                                       */\n  /*    FT_OPEN_DRIVER      :: Use the `driver' field.                     */\n  /*                                                                       */\n  /*    FT_OPEN_PARAMS      :: Use the `num_params' and `params' fields.   */\n  /*                                                                       */\n  /*    ft_open_memory      :: Deprecated; use @FT_OPEN_MEMORY instead.    */\n  /*                                                                       */\n  /*    ft_open_stream      :: Deprecated; use @FT_OPEN_STREAM instead.    */\n  /*                                                                       */\n  /*    ft_open_pathname    :: Deprecated; use @FT_OPEN_PATHNAME instead.  */\n  /*                                                                       */\n  /*    ft_open_driver      :: Deprecated; use @FT_OPEN_DRIVER instead.    */\n  /*                                                                       */\n  /*    ft_open_params      :: Deprecated; use @FT_OPEN_PARAMS instead.    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME'     */\n  /*    flags are mutually exclusive.                                      */\n  /*                                                                       */\n#define FT_OPEN_MEMORY    0x1\n#define FT_OPEN_STREAM    0x2\n#define FT_OPEN_PATHNAME  0x4\n#define FT_OPEN_DRIVER    0x8\n#define FT_OPEN_PARAMS    0x10\n\n#define ft_open_memory    FT_OPEN_MEMORY     /* deprecated */\n#define ft_open_stream    FT_OPEN_STREAM     /* deprecated */\n#define ft_open_pathname  FT_OPEN_PATHNAME   /* deprecated */\n#define ft_open_driver    FT_OPEN_DRIVER     /* deprecated */\n#define ft_open_params    FT_OPEN_PARAMS     /* deprecated */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Parameter                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to pass more or less generic parameters    */\n  /*    to @FT_Open_Face.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    tag  :: A four-byte identification tag.                            */\n  /*                                                                       */\n  /*    data :: A pointer to the parameter data.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The ID and function of parameters are driver-specific.             */\n  /*                                                                       */\n  typedef struct  FT_Parameter_\n  {\n    FT_ULong    tag;\n    FT_Pointer  data;\n\n  } FT_Parameter;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Open_Args                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to indicate how to open a new font file or        */\n  /*    stream.  A pointer to such a structure can be used as a parameter  */\n  /*    for the functions @FT_Open_Face and @FT_Attach_Stream.             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    flags       :: A set of bit flags indicating how to use the        */\n  /*                   structure.                                          */\n  /*                                                                       */\n  /*    memory_base :: The first byte of the file in memory.               */\n  /*                                                                       */\n  /*    memory_size :: The size in bytes of the file in memory.            */\n  /*                                                                       */\n  /*    pathname    :: A pointer to an 8-bit file pathname.                */\n  /*                                                                       */\n  /*    stream      :: A handle to a source stream object.                 */\n  /*                                                                       */\n  /*    driver      :: This field is exclusively used by @FT_Open_Face;    */\n  /*                   it simply specifies the font driver to use to open  */\n  /*                   the face.  If set to 0, FreeType tries to load the  */\n  /*                   face with each one of the drivers in its list.      */\n  /*                                                                       */\n  /*    num_params  :: The number of extra parameters.                     */\n  /*                                                                       */\n  /*    params      :: Extra parameters passed to the font driver when     */\n  /*                   opening a new face.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The stream type is determined by the contents of `flags' which     */\n  /*    are tested in the following order by @FT_Open_Face:                */\n  /*                                                                       */\n  /*    If the `FT_OPEN_MEMORY' bit is set, assume that this is a          */\n  /*    memory file of `memory_size' bytes, located at `memory_address'.   */\n  /*    The data are are not copied, and the client is responsible for     */\n  /*    releasing and destroying them _after_ the corresponding call to    */\n  /*    @FT_Done_Face.                                                     */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_STREAM' bit is set, assume that a       */\n  /*    custom input stream `stream' is used.                              */\n  /*                                                                       */\n  /*    Otherwise, if the `FT_OPEN_PATHNAME' bit is set, assume that this  */\n  /*    is a normal file and use `pathname' to open it.                    */\n  /*                                                                       */\n  /*    If the `FT_OPEN_DRIVER' bit is set, @FT_Open_Face only tries to    */\n  /*    open the file with the driver whose handler is in `driver'.        */\n  /*                                                                       */\n  /*    If the `FT_OPEN_PARAMS' bit is set, the parameters given by        */\n  /*    `num_params' and `params' is used.  They are ignored otherwise.    */\n  /*                                                                       */\n  /*    Ideally, both the `pathname' and `params' fields should be tagged  */\n  /*    as `const'; this is missing for API backwards compatibility.  With */\n  /*    other words, applications should treat them as read-only.          */\n  /*                                                                       */\n  typedef struct  FT_Open_Args_\n  {\n    FT_UInt         flags;\n    const FT_Byte*  memory_base;\n    FT_Long         memory_size;\n    FT_String*      pathname;\n    FT_Stream       stream;\n    FT_Module       driver;\n    FT_Int          num_params;\n    FT_Parameter*   params;\n\n  } FT_Open_Args;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font by its pathname.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pathname   :: A path to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index 0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face( FT_Library   library,\n               const char*  filepathname,\n               FT_Long      face_index,\n               FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Memory_Face                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Open_Face to open a font which has been    */\n  /*    loaded into memory.                                                */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    file_base  :: A pointer to the beginning of the font data.         */\n  /*                                                                       */\n  /*    file_size  :: The size of the memory chunk used by the font data.  */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index 0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See @FT_Open_Face for more details.                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You must not deallocate the memory before calling @FT_Done_Face.   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Memory_Face( FT_Library      library,\n                      const FT_Byte*  file_base,\n                      FT_Long         file_size,\n                      FT_Long         face_index,\n                      FT_Face        *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Open_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a face object from a given resource described by            */\n  /*    @FT_Open_Args.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    args       :: A pointer to an `FT_Open_Args' structure which must  */\n  /*                  be filled by the caller.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the font.  The first    */\n  /*                  face has index 0.                                    */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.  If `face_index' is   */\n  /*                  greater than or equal to zero, it must be non-NULL.  */\n  /*                  See note below.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Unlike FreeType 1.x, this function automatically creates a glyph   */\n  /*    slot for the face object which can be accessed directly through    */\n  /*    `face->glyph'.                                                     */\n  /*                                                                       */\n  /*    FT_Open_Face can be used to quickly check whether the font         */\n  /*    format of a given font resource is supported by FreeType.  If the  */\n  /*    `face_index' field is negative, the function's return value is 0   */\n  /*    if the font format is recognized, or non-zero otherwise;           */\n  /*    the function returns a more or less empty face handle in `*aface'  */\n  /*    (if `aface' isn't NULL).  The only useful field in this special    */\n  /*    case is `face->num_faces' which gives the number of faces within   */\n  /*    the font file.  After examination, the returned @FT_Face structure */\n  /*    should be deallocated with a call to @FT_Done_Face.                */\n  /*                                                                       */\n  /*    Each new face object created with this function also owns a        */\n  /*    default @FT_Size object, accessible as `face->size'.               */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Open_Face( FT_Library           library,\n                const FT_Open_Args*  args,\n                FT_Long              face_index,\n                FT_Face             *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_File                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Attach_Stream to attach a file.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: The target face object.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    filepathname :: The pathname.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_File( FT_Face      face,\n                  const char*  filepathname );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Attach_Stream                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    `Attach' data to a face object.  Normally, this is used to read    */\n  /*    additional information for the face object.  For example, you can  */\n  /*    attach an AFM file that comes with a Type 1 font to get the        */\n  /*    kerning values and other metrics.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: The target face object.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    parameters :: A pointer to @FT_Open_Args which must be filled by   */\n  /*                  the caller.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The meaning of the `attach' (i.e., what really happens when the    */\n  /*    new file is read) is not fixed by FreeType itself.  It really      */\n  /*    depends on the font format (and thus the font driver).             */\n  /*                                                                       */\n  /*    Client applications are expected to know what they are doing       */\n  /*    when invoking this function.  Most drivers simply do not implement */\n  /*    file attachments.                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Attach_Stream( FT_Face        face,\n                    FT_Open_Args*  parameters );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Face                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given face object, as well as all of its child slots and */\n  /*    sizes.                                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Face( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Size                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a bitmap strike.                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to a target face object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strike_index :: The index of the bitmap strike in the              */\n  /*                    `available_sizes' field of @FT_FaceRec structure.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Size( FT_Face  face,\n                  FT_Int   strike_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Size_Request_Type                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the supported size request types.   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_SIZE_REQUEST_TYPE_NOMINAL ::                                    */\n  /*      The nominal size.  The `units_per_EM' field of @FT_FaceRec is    */\n  /*      used to determine both scaling values.                           */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_REAL_DIM ::                                   */\n  /*      The real dimension.  The sum of the the `Ascender' and (minus    */\n  /*      of) the `Descender' fields of @FT_FaceRec are used to determine  */\n  /*      both scaling values.                                             */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_BBOX ::                                       */\n  /*      The font bounding box.  The width and height of the `bbox' field */\n  /*      of @FT_FaceRec are used to determine the horizontal and vertical */\n  /*      scaling value, respectively.                                     */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_CELL ::                                       */\n  /*      The `max_advance_width' field of @FT_FaceRec is used to          */\n  /*      determine the horizontal scaling value; the vertical scaling     */\n  /*      value is determined the same way as                              */\n  /*      @FT_SIZE_REQUEST_TYPE_REAL_DIM does.  Finally, both scaling      */\n  /*      values are set to the smaller one.  This type is useful if you   */\n  /*      want to specify the font size for, say, a window of a given      */\n  /*      dimension and 80x24 cells.                                       */\n  /*                                                                       */\n  /*    FT_SIZE_REQUEST_TYPE_SCALES ::                                     */\n  /*      Specify the scaling values directly.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The above descriptions only apply to scalable formats.  For bitmap */\n  /*    formats, the behaviour is up to the driver.                        */\n  /*                                                                       */\n  /*    See the note section of @FT_Size_Metrics if you wonder how size    */\n  /*    requesting relates to scaling values.                              */\n  /*                                                                       */\n  typedef enum  FT_Size_Request_Type_\n  {\n    FT_SIZE_REQUEST_TYPE_NOMINAL,\n    FT_SIZE_REQUEST_TYPE_REAL_DIM,\n    FT_SIZE_REQUEST_TYPE_BBOX,\n    FT_SIZE_REQUEST_TYPE_CELL,\n    FT_SIZE_REQUEST_TYPE_SCALES,\n\n    FT_SIZE_REQUEST_TYPE_MAX\n\n  } FT_Size_Request_Type;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Size_RequestRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a size request.                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    type           :: See @FT_Size_Request_Type.                       */\n  /*                                                                       */\n  /*    width          :: The desired width.                               */\n  /*                                                                       */\n  /*    height         :: The desired height.                              */\n  /*                                                                       */\n  /*    horiResolution :: The horizontal resolution.  If set to zero,      */\n  /*                      `width' is treated as a 26.6 fractional pixel    */\n  /*                      value.                                           */\n  /*                                                                       */\n  /*    vertResolution :: The vertical resolution.  If set to zero,        */\n  /*                      `height' is treated as a 26.6 fractional pixel   */\n  /*                      value.                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `width' is zero, then the horizontal scaling value is set      */\n  /*    equal to the vertical scaling value, and vice versa.               */\n  /*                                                                       */\n  typedef struct  FT_Size_RequestRec_\n  {\n    FT_Size_Request_Type  type;\n    FT_Long               width;\n    FT_Long               height;\n    FT_UInt               horiResolution;\n    FT_UInt               vertResolution;\n\n  } FT_Size_RequestRec, *FT_Size_Request;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Request_Size                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Resize the scale of the active @FT_Size object in a face.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face :: A handle to a target face object.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    req  :: A pointer to a @FT_Size_RequestRec.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Although drivers may select the bitmap strike matching the         */\n  /*    request, you should not rely on this if you intend to select a     */\n  /*    particular bitmap strike.  Use @FT_Select_Size instead in that     */\n  /*    case.                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Request_Size( FT_Face          face,\n                   FT_Size_Request  req );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Char_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in points).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face            :: A handle to a target face object.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_width      :: The nominal width, in 26.6 fractional points.   */\n  /*                                                                       */\n  /*    char_height     :: The nominal height, in 26.6 fractional points.  */\n  /*                                                                       */\n  /*    horz_resolution :: The horizontal resolution in dpi.               */\n  /*                                                                       */\n  /*    vert_resolution :: The vertical resolution in dpi.                 */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If either the character width or height is zero, it is set equal   */\n  /*    to the other value.                                                */\n  /*                                                                       */\n  /*    If either the horizontal or vertical resolution is zero, it is set */\n  /*    equal to the other value.                                          */\n  /*                                                                       */\n  /*    A character width or height smaller than 1pt is set to 1pt; if     */\n  /*    both resolution values are zero, they are set to 72dpi.            */\n  /*                                                                       */\n\n  FT_EXPORT( FT_Error )\n  FT_Set_Char_Size( FT_Face     face,\n                    FT_F26Dot6  char_width,\n                    FT_F26Dot6  char_height,\n                    FT_UInt     horz_resolution,\n                    FT_UInt     vert_resolution );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Pixel_Sizes                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function calls @FT_Request_Size to request the nominal size   */\n  /*    (in pixels).                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face         :: A handle to the target face object.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    pixel_width  :: The nominal width, in pixels.                      */\n  /*                                                                       */\n  /*    pixel_height :: The nominal height, in pixels.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Pixel_Sizes( FT_Face  face,\n                      FT_UInt  pixel_width,\n                      FT_UInt  pixel_height );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to the target face object where the glyph  */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph_index :: The index of the glyph in the font file.  For       */\n  /*                   CID-keyed fonts (either in PS or in CFF format)     */\n  /*                   this argument specifies the CID value.              */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The loaded glyph may be transformed.  See @FT_Set_Transform for    */\n  /*    the details.                                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Glyph( FT_Face   face,\n                 FT_UInt   glyph_index,\n                 FT_Int32  load_flags );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Load_Char                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to load a single glyph into the glyph slot of a    */\n  /*    face object, according to its character code.                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face        :: A handle to a target face object where the glyph    */\n  /*                   is loaded.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    char_code   :: The glyph's character code, according to the        */\n  /*                   current charmap used in the face.                   */\n  /*                                                                       */\n  /*    load_flags  :: A flag indicating what to load for this glyph.  The */\n  /*                   @FT_LOAD_XXX constants can be used to control the   */\n  /*                   glyph loading process (e.g., whether the outline    */\n  /*                   should be scaled, whether to load bitmaps or not,   */\n  /*                   whether to hint the outline, etc).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function simply calls @FT_Get_Char_Index and @FT_Load_Glyph.  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Load_Char( FT_Face   face,\n                FT_ULong  char_code,\n                FT_Int32  load_flags );\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_XXX\n   *\n   * @description:\n   *   A list of bit-field constants used with @FT_Load_Glyph to indicate\n   *   what kind of operations to perform during glyph loading.\n   *\n   * @values:\n   *   FT_LOAD_DEFAULT ::\n   *     Corresponding to 0, this value is used as the default glyph load\n   *     operation.  In this case, the following happens:\n   *\n   *     1. FreeType looks for a bitmap for the glyph corresponding to the\n   *        face's current size.  If one is found, the function returns.\n   *        The bitmap data can be accessed from the glyph slot (see note\n   *        below).\n   *\n   *     2. If no embedded bitmap is searched or found, FreeType looks for a\n   *        scalable outline.  If one is found, it is loaded from the font\n   *        file, scaled to device pixels, then `hinted' to the pixel grid\n   *        in order to optimize it.  The outline data can be accessed from\n   *        the glyph slot (see note below).\n   *\n   *     Note that by default, the glyph loader doesn't render outlines into\n   *     bitmaps.  The following flags are used to modify this default\n   *     behaviour to more specific and useful cases.\n   *\n   *   FT_LOAD_NO_SCALE ::\n   *     Don't scale the outline glyph loaded, but keep it in font units.\n   *\n   *     This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and\n   *     unsets @FT_LOAD_RENDER.\n   *\n   *   FT_LOAD_NO_HINTING ::\n   *     Disable hinting.  This generally generates `blurrier' bitmap glyph\n   *     when the glyph is rendered in any of the anti-aliased modes.  See\n   *     also the note below.\n   *\n   *     This flag is implied by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_RENDER ::\n   *     Call @FT_Render_Glyph after the glyph is loaded.  By default, the\n   *     glyph is rendered in @FT_RENDER_MODE_NORMAL mode.  This can be\n   *     overridden by @FT_LOAD_TARGET_XXX or @FT_LOAD_MONOCHROME.\n   *\n   *     This flag is unset by @FT_LOAD_NO_SCALE.\n   *\n   *   FT_LOAD_NO_BITMAP ::\n   *     Ignore bitmap strikes when loading.  Bitmap-only fonts ignore this\n   *     flag.\n   *\n   *     @FT_LOAD_NO_SCALE always sets this flag.\n   *\n   *   FT_LOAD_VERTICAL_LAYOUT ::\n   *     Load the glyph for vertical text layout.  _Don't_ use it as it is\n   *     problematic currently.\n   *\n   *   FT_LOAD_FORCE_AUTOHINT ::\n   *     Indicates that the auto-hinter is preferred over the font's native\n   *     hinter.  See also the note below.\n   *\n   *   FT_LOAD_CROP_BITMAP ::\n   *     Indicates that the font driver should crop the loaded bitmap glyph\n   *     (i.e., remove all space around its black bits).  Not all drivers\n   *     implement this.\n   *\n   *   FT_LOAD_PEDANTIC ::\n   *     Indicates that the font driver should perform pedantic verifications\n   *     during glyph loading.  This is mostly used to detect broken glyphs\n   *     in fonts.  By default, FreeType tries to handle broken fonts also.\n   *\n   *   FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ::\n   *     Indicates that the font driver should ignore the global advance\n   *     width defined in the font.  By default, that value is used as the\n   *     advance width for all glyphs when the face has\n   *     @FT_FACE_FLAG_FIXED_WIDTH set.\n   *\n   *     This flag exists for historical reasons (to support buggy CJK\n   *     fonts).\n   *\n   *   FT_LOAD_NO_RECURSE ::\n   *     This flag is only used internally.  It merely indicates that the\n   *     font driver should not load composite glyphs recursively.  Instead,\n   *     it should set the `num_subglyph' and `subglyphs' values of the\n   *     glyph slot accordingly, and set `glyph->format' to\n   *     @FT_GLYPH_FORMAT_COMPOSITE.\n   *\n   *     The description of sub-glyphs is not available to client\n   *     applications for now.\n   *\n   *     This flag implies @FT_LOAD_NO_SCALE and @FT_LOAD_IGNORE_TRANSFORM.\n   *\n   *   FT_LOAD_IGNORE_TRANSFORM ::\n   *     Indicates that the transform matrix set by @FT_Set_Transform should\n   *     be ignored.\n   *\n   *   FT_LOAD_MONOCHROME ::\n   *     This flag is used with @FT_LOAD_RENDER to indicate that you want to\n   *     render an outline glyph to a 1-bit monochrome bitmap glyph, with\n   *     8 pixels packed into each byte of the bitmap data.\n   *\n   *     Note that this has no effect on the hinting algorithm used.  You\n   *     should use @FT_LOAD_TARGET_MONO instead so that the\n   *     monochrome-optimized hinting algorithm is used.\n   *\n   *   FT_LOAD_LINEAR_DESIGN ::\n   *     Indicates that the `linearHoriAdvance' and `linearVertAdvance'\n   *     fields of @FT_GlyphSlotRec should be kept in font units.  See\n   *     @FT_GlyphSlotRec for details.\n   *\n   *   FT_LOAD_NO_AUTOHINT ::\n   *     Disable auto-hinter.  See also the note below.\n   *\n   * @note:\n   *   By default, hinting is enabled and the font's native hinter (see\n   *   @FT_FACE_FLAG_HINTER) is preferred over the auto-hinter.  You can\n   *   disable hinting by setting @FT_LOAD_NO_HINTING or change the\n   *   precedence by setting @FT_LOAD_FORCE_AUTOHINT.  You can also set\n   *   @FT_LOAD_NO_AUTOHINT in case you don't want the auto-hinter to be\n   *   used at all.\n   *\n   *   Besides deciding which hinter to use, you can also decide which\n   *   hinting algorithm to use.  See @FT_LOAD_TARGET_XXX for details.\n   */\n#define FT_LOAD_DEFAULT                      0x0\n#define FT_LOAD_NO_SCALE                     0x1\n#define FT_LOAD_NO_HINTING                   0x2\n#define FT_LOAD_RENDER                       0x4\n#define FT_LOAD_NO_BITMAP                    0x8\n#define FT_LOAD_VERTICAL_LAYOUT              0x10\n#define FT_LOAD_FORCE_AUTOHINT               0x20\n#define FT_LOAD_CROP_BITMAP                  0x40\n#define FT_LOAD_PEDANTIC                     0x80\n#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH  0x200\n#define FT_LOAD_NO_RECURSE                   0x400\n#define FT_LOAD_IGNORE_TRANSFORM             0x800\n#define FT_LOAD_MONOCHROME                   0x1000\n#define FT_LOAD_LINEAR_DESIGN                0x2000\n\n  /* temporary hack! */\n#define FT_LOAD_SBITS_ONLY                   0x4000\n#define FT_LOAD_NO_AUTOHINT                  0x8000U\n\n  /* */\n\n\n  /**************************************************************************\n   *\n   * @enum:\n   *   FT_LOAD_TARGET_XXX\n   *\n   * @description:\n   *   A list of values that are used to select a specific hinting algorithm\n   *   to use by the hinter.  You should OR one of these values to your\n   *   `load_flags' when calling @FT_Load_Glyph.\n   *\n   *   Note that font's native hinters may ignore the hinting algorithm you\n   *   have specified (e.g., the TrueType bytecode interpreter).  You can set\n   *   @FT_LOAD_FORCE_AUTOHINT to ensure that the auto-hinter is used.\n   *\n   *   Also note that @FT_LOAD_TARGET_LIGHT is an exception, in that it\n   *   always implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   * @values:\n   *   FT_LOAD_TARGET_NORMAL ::\n   *     This corresponds to the default hinting algorithm, optimized for\n   *     standard gray-level rendering.  For monochrome output, use\n   *     @FT_LOAD_TARGET_MONO instead.\n   *\n   *   FT_LOAD_TARGET_LIGHT ::\n   *     A lighter hinting algorithm for non-monochrome modes.  Many\n   *     generated glyphs are more fuzzy but better resemble its original\n   *     shape.  A bit like rendering on Mac OS X.\n   *\n   *     As a special exception, this target implies @FT_LOAD_FORCE_AUTOHINT.\n   *\n   *   FT_LOAD_TARGET_MONO ::\n   *     Strong hinting algorithm that should only be used for monochrome\n   *     output.  The result is probably unpleasant if the glyph is rendered\n   *     in non-monochrome modes.\n   *\n   *   FT_LOAD_TARGET_LCD ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally\n   *     decimated LCD displays.\n   *\n   *   FT_LOAD_TARGET_LCD_V ::\n   *     A variant of @FT_LOAD_TARGET_NORMAL optimized for vertically\n   *     decimated LCD displays.\n   *\n   * @note:\n   *   You should use only _one_ of the FT_LOAD_TARGET_XXX values in your\n   *   `load_flags'.  They can't be ORed.\n   *\n   *   If @FT_LOAD_RENDER is also set, the glyph is rendered in the\n   *   corresponding mode (i.e., the mode which matches the used algorithm\n   *   best) unless @FT_LOAD_MONOCHROME is set.\n   *\n   *   You can use a hinting algorithm that doesn't correspond to the same\n   *   rendering mode.  As an example, it is possible to use the `light'\n   *   hinting algorithm and have the results rendered in horizontal LCD\n   *   pixel mode, with code like\n   *\n   *     {\n   *       FT_Load_Glyph( face, glyph_index,\n   *                      load_flags | FT_LOAD_TARGET_LIGHT );\n   *\n   *       FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );\n   *     }\n   */\n\n#define FT_LOAD_TARGET_( x )      ( (FT_Int32)( (x) & 15 ) << 16 )\n\n#define FT_LOAD_TARGET_NORMAL     FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )\n#define FT_LOAD_TARGET_LIGHT      FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )\n#define FT_LOAD_TARGET_MONO       FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )\n#define FT_LOAD_TARGET_LCD        FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )\n#define FT_LOAD_TARGET_LCD_V      FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )\n\n\n  /*\n   * @macro:\n   *   FT_LOAD_TARGET_MODE\n   *\n   * @description:\n   *   Return the @FT_Render_Mode corresponding to a given\n   *   @FT_LOAD_TARGET_XXX value.\n   */\n\n#define FT_LOAD_TARGET_MODE( x )  ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Transform                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to set the transformation that is applied to glyph */\n  /*    images when they are loaded into a glyph slot through              */\n  /*    @FT_Load_Glyph.                                                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face   :: A handle to the source face object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the transformation's 2x2 matrix.  Use 0 for */\n  /*              the identity matrix.                                     */\n  /*    delta  :: A pointer to the translation vector.  Use 0 for the null */\n  /*              vector.                                                  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The transformation is only applied to scalable image formats after */\n  /*    the glyph has been loaded.  It means that hinting is unaltered by  */\n  /*    the transformation and is performed on the character size given in */\n  /*    the last call to @FT_Set_Char_Size or @FT_Set_Pixel_Sizes.         */\n  /*                                                                       */\n  /*    Note that this also transforms the `face.glyph.advance' field, but */\n  /*    *not* the values in `face.glyph.metrics'.                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Transform( FT_Face     face,\n                    FT_Matrix*  matrix,\n                    FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Render_Mode                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type that lists the render modes supported by       */\n  /*    FreeType 2.  Each mode corresponds to a specific type of scanline  */\n  /*    conversion performed on the outline.                               */\n  /*                                                                       */\n  /*    For bitmap fonts the `bitmap->pixel_mode' field in the             */\n  /*    @FT_GlyphSlotRec structure gives the format of the returned        */\n  /*    bitmap.                                                            */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RENDER_MODE_NORMAL ::                                           */\n  /*      This is the default render mode; it corresponds to 8-bit         */\n  /*      anti-aliased bitmaps, using 256 levels of opacity.               */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LIGHT ::                                            */\n  /*      This is equivalent to @FT_RENDER_MODE_NORMAL.  It is only        */\n  /*      defined as a separate value because render modes are also used   */\n  /*      indirectly to define hinting algorithm selectors.  See           */\n  /*      @FT_LOAD_TARGET_XXX for details.                                 */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_MONO ::                                             */\n  /*      This mode corresponds to 1-bit bitmaps.                          */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD ::                                              */\n  /*      This mode corresponds to horizontal RGB and BGR sub-pixel        */\n  /*      displays, like LCD-screens.  It produces 8-bit bitmaps that are  */\n  /*      3 times the width of the original glyph outline in pixels, and   */\n  /*      which use the @FT_PIXEL_MODE_LCD mode.                           */\n  /*                                                                       */\n  /*    FT_RENDER_MODE_LCD_V ::                                            */\n  /*      This mode corresponds to vertical RGB and BGR sub-pixel displays */\n  /*      (like PDA screens, rotated LCD displays, etc.).  It produces     */\n  /*      8-bit bitmaps that are 3 times the height of the original        */\n  /*      glyph outline in pixels and use the @FT_PIXEL_MODE_LCD_V mode.   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   The LCD-optimized glyph bitmaps produced by FT_Render_Glyph are     */\n  /*   _not_ _filtered_ to reduce color-fringes.  It is up to the caller   */\n  /*   to perform this pass.                                               */\n  /*                                                                       */\n  typedef enum  FT_Render_Mode_\n  {\n    FT_RENDER_MODE_NORMAL = 0,\n    FT_RENDER_MODE_LIGHT,\n    FT_RENDER_MODE_MONO,\n    FT_RENDER_MODE_LCD,\n    FT_RENDER_MODE_LCD_V,\n\n    FT_RENDER_MODE_MAX\n\n  } FT_Render_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_render_mode_xxx                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Render_Mode values instead.                                    */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*   ft_render_mode_normal :: see @FT_RENDER_MODE_NORMAL                 */\n  /*   ft_render_mode_mono   :: see @FT_RENDER_MODE_MONO                   */\n  /*                                                                       */\n#define ft_render_mode_normal  FT_RENDER_MODE_NORMAL\n#define ft_render_mode_mono    FT_RENDER_MODE_MONO\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Render_Glyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a given glyph image to a bitmap.  It does so by inspecting */\n  /*    the glyph image format, finding the relevant renderer, and         */\n  /*    invoking it.                                                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    slot        :: A handle to the glyph slot containing the image to  */\n  /*                   convert.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: This is the render mode used to render the glyph    */\n  /*                   image into a bitmap.  See @FT_Render_Mode for a     */\n  /*                   list of possible values.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Render_Glyph( FT_GlyphSlot    slot,\n                   FT_Render_Mode  render_mode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Kerning_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify which kerning values to return in   */\n  /*    @FT_Get_Kerning.                                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_KERNING_DEFAULT  :: Return scaled and grid-fitted kerning       */\n  /*                           distances (value is 0).                     */\n  /*                                                                       */\n  /*    FT_KERNING_UNFITTED :: Return scaled but un-grid-fitted kerning    */\n  /*                           distances.                                  */\n  /*                                                                       */\n  /*    FT_KERNING_UNSCALED :: Return the kerning vector in original font  */\n  /*                           units.                                      */\n  /*                                                                       */\n  typedef enum  FT_Kerning_Mode_\n  {\n    FT_KERNING_DEFAULT  = 0,\n    FT_KERNING_UNFITTED,\n    FT_KERNING_UNSCALED\n\n  } FT_Kerning_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_default                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_DEFAULT       */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_default   FT_KERNING_DEFAULT\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unfitted                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNFITTED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unfitted  FT_KERNING_UNFITTED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Const>                                                               */\n  /*    ft_kerning_unscaled                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This constant is deprecated.  Please use @FT_KERNING_UNSCALED      */\n  /*    instead.                                                           */\n  /*                                                                       */\n#define ft_kerning_unscaled  FT_KERNING_UNSCALED\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Kerning                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the kerning vector between two glyphs of a same face.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    left_glyph  :: The index of the left glyph in the kern pair.       */\n  /*                                                                       */\n  /*    right_glyph :: The index of the right glyph in the kern pair.      */\n  /*                                                                       */\n  /*    kern_mode   :: See @FT_Kerning_Mode for more information.          */\n  /*                   Determines the scale and dimension of the returned  */\n  /*                   kerning vector.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning    :: The kerning vector.  This is either in font units   */\n  /*                   or in pixels (26.6 format) for scalable formats,    */\n  /*                   and in pixels for fixed-sizes formats.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Only horizontal layouts (left-to-right & right-to-left) are        */\n  /*    supported by this method.  Other layouts, or more sophisticated    */\n  /*    kernings, are out of the scope of this API function -- they can be */\n  /*    implemented through format-specific interfaces.                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Kerning( FT_Face     face,\n                  FT_UInt     left_glyph,\n                  FT_UInt     right_glyph,\n                  FT_UInt     kern_mode,\n                  FT_Vector  *akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Track_Kerning                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the track kerning for a given face object at a given size.  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    point_size  :: The point size in 16.16 fractional points.          */\n  /*                                                                       */\n  /*    degree      :: The degree of tightness.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    akerning    :: The kerning in 16.16 fractional points.             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Track_Kerning( FT_Face    face,\n                        FT_Fixed   point_size,\n                        FT_Int     degree,\n                        FT_Fixed*  akerning );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph_Name                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII name of a given glyph in a face.  This only     */\n  /*    works for those faces where @FT_HAS_GLYPH_NAMES(face) returns 1.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face        :: A handle to a source face object.                   */\n  /*                                                                       */\n  /*    glyph_index :: The glyph index.                                    */\n  /*                                                                       */\n  /*    buffer_max  :: The maximal number of bytes available in the        */\n  /*                   buffer.                                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    buffer      :: A pointer to a target buffer where the name is      */\n  /*                   copied to.                                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error is returned if the face doesn't provide glyph names or if */\n  /*    the glyph index is invalid.  In all cases of failure, the first    */\n  /*    byte of `buffer' is set to 0 to indicate an empty name.            */\n  /*                                                                       */\n  /*    The glyph name is truncated to fit within the buffer if it is too  */\n  /*    long.  The returned string is always zero-terminated.              */\n  /*                                                                       */\n  /*    This function is not compiled within the library if the config     */\n  /*    macro `FT_CONFIG_OPTION_NO_GLYPH_NAMES' is defined in              */\n  /*    `include/freetype/config/ftoptions.h'.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph_Name( FT_Face     face,\n                     FT_UInt     glyph_index,\n                     FT_Pointer  buffer,\n                     FT_UInt     buffer_max );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Postscript_Name                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the ASCII Postscript name of a given face, if available.  */\n  /*    This only works with Postscript and TrueType fonts.                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face object.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A pointer to the face's Postscript name.  NULL if unavailable.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned pointer is owned by the face and is destroyed with    */\n  /*    it.                                                                */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_Postscript_Name( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Select_Charmap                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap by its encoding tag (as listed in           */\n  /*    `freetype.h').                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    encoding :: A handle to the selected encoding.                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if no charmap in the face           */\n  /*    corresponds to the encoding queried here.                          */\n  /*                                                                       */\n  /*    Because many fonts contain more than a single cmap for Unicode     */\n  /*    encoding, this function has some special code to select the one    */\n  /*    which covers Unicode best.  It is thus preferable to               */\n  /*    @FT_Set_Charmap in this case.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Select_Charmap( FT_Face      face,\n                     FT_Encoding  encoding );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Charmap                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Select a given charmap for character code to glyph index mapping.  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap :: A handle to the selected charmap.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function returns an error if the charmap is not part of       */\n  /*    the face (i.e., if it is not listed in the `face->charmaps'        */\n  /*    table).                                                            */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Charmap( FT_Face     face,\n                  FT_CharMap  charmap );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Get_Charmap_Index\n   *\n   * @description:\n   *   Retrieve index of a given charmap.\n   *\n   * @input:\n   *   charmap ::\n   *     A handle to a charmap.\n   *\n   * @return:\n   *   The index into the array of character maps within the face to which\n   *   `charmap' belongs.\n   *\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Charmap_Index( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Char_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given character code.  This function   */\n  /*    uses a charmap object to do the mapping.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face     :: A handle to the source face object.                    */\n  /*                                                                       */\n  /*    charcode :: The character code.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0 means `undefined character code'.              */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If you use FreeType to manipulate the contents of font files       */\n  /*    directly, be aware that the glyph index returned by this function  */\n  /*    doesn't always correspond to the internal indices used within      */\n  /*    the file.  This is done to ensure that value 0 always corresponds  */\n  /*    to the `missing glyph'.                                            */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Char_Index( FT_Face   face,\n                     FT_ULong  charcode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_First_Char                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the first character code in the    */\n  /*    current charmap of a given face.  It also returns the              */\n  /*    corresponding glyph index.                                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex :: Glyph index of first character code.  0 if charmap is   */\n  /*               empty.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's first character code.                                */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_Next_Char to be able to  */\n  /*    parse all character codes available in a given charmap.  The code  */\n  /*    should look like this:                                             */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_ULong  charcode;                                              */\n  /*      FT_UInt   gindex;                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*      charcode = FT_Get_First_Char( face, &gindex );                   */\n  /*      while ( gindex != 0 )                                            */\n  /*      {                                                                */\n  /*        ... do something with (charcode,gindex) pair ...               */\n  /*                                                                       */\n  /*        charcode = FT_Get_Next_Char( face, charcode, &gindex );        */\n  /*      }                                                                */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to 0 if the charmap is empty.  The     */\n  /*    result itself can be 0 in two cases: if the charmap is empty or    */\n  /*    when the value 0 is the first valid character code.                */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_First_Char( FT_Face   face,\n                     FT_UInt  *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Next_Char                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to return the next character code in the     */\n  /*    current charmap of a given face following the value `char_code',   */\n  /*    as well as the corresponding glyph index.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face      :: A handle to the source face object.                   */\n  /*    char_code :: The starting character code.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    agindex   :: Glyph index of first character code.  0 if charmap    */\n  /*                 is empty.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The charmap's next character code.                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should use this function with @FT_Get_First_Char to walk       */\n  /*    over all character codes available in a given charmap.  See the    */\n  /*    note for this function for a simple code example.                  */\n  /*                                                                       */\n  /*    Note that `*agindex' is set to 0 when there are no more codes in   */\n  /*    the charmap.                                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_Next_Char( FT_Face    face,\n                    FT_ULong   char_code,\n                    FT_UInt   *agindex );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Name_Index                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the glyph index of a given glyph name.  This function uses  */\n  /*    driver specific objects to do the translation.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face       :: A handle to the source face object.                  */\n  /*                                                                       */\n  /*    glyph_name :: The glyph name.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The glyph index.  0 means `undefined character code'.              */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Name_Index( FT_Face     face,\n                     FT_String*  glyph_name );\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_SUBGLYPH_FLAG_XXX\n   *\n   * @description:\n   *   A list of constants used to describe subglyphs.  Please refer to the\n   *   TrueType specification for the meaning of the various flags.\n   *\n   * @values:\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS ::\n   *   FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES ::\n   *   FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID ::\n   *   FT_SUBGLYPH_FLAG_SCALE ::\n   *   FT_SUBGLYPH_FLAG_XY_SCALE ::\n   *   FT_SUBGLYPH_FLAG_2X2 ::\n   *   FT_SUBGLYPH_FLAG_USE_MY_METRICS ::\n   *\n   */\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\n#define FT_SUBGLYPH_FLAG_SCALE                   8\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_SubGlyph_Info\n   *\n   * @description:\n   *   Retrieve a description of a given subglyph.  Only use it if\n   *   `glyph->format' is @FT_GLYPH_FORMAT_COMPOSITE, or an error is\n   *   returned.\n   *\n   * @input:\n   *   glyph ::\n   *     The source glyph slot.\n   *\n   *   sub_index ::\n   *     The index of subglyph.  Must be less than `glyph->num_subglyphs'.\n   *\n   * @output:\n   *   p_index ::\n   *     The glyph index of the subglyph.\n   *\n   *   p_flags ::\n   *     The subglyph flags, see @FT_SUBGLYPH_FLAG_XXX.\n   *\n   *   p_arg1 ::\n   *     The subglyph's first argument (if any).\n   *\n   *   p_arg2 ::\n   *     The subglyph's second argument (if any).\n   *\n   *   p_transform ::\n   *     The subglyph transformation (if any).\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The values of `*p_arg1', `*p_arg2', and `*p_transform' must be\n   *   interpreted depending on the flags returned in `*p_flags'.  See the\n   *   TrueType specification for details.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FT_Get_SubGlyph_Info( FT_GlyphSlot  glyph,\n                        FT_UInt       sub_index,\n                        FT_Int       *p_index,\n                        FT_UInt      *p_flags,\n                        FT_Int       *p_arg1,\n                        FT_Int       *p_arg2,\n                        FT_Matrix    *p_transform );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Computations                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Crunching fixed numbers and vectors.                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various functions used to perform            */\n  /*    computations on 16.16 fixed-float numbers or 2d vectors.           */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_MulDiv                                                          */\n  /*    FT_MulFix                                                          */\n  /*    FT_DivFix                                                          */\n  /*    FT_RoundFix                                                        */\n  /*    FT_CeilFix                                                         */\n  /*    FT_FloorFix                                                        */\n  /*    FT_Vector_Transform                                                */\n  /*    FT_Matrix_Multiply                                                 */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulDiv                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\n  /*    with maximal accuracy (it uses a 64-bit intermediate integer       */\n  /*    whenever necessary).                                               */\n  /*                                                                       */\n  /*    This function isn't necessarily as fast as some processor specific */\n  /*    operations, but is at least completely portable.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.                                        */\n  /*    c :: The divisor.                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\n  /*    on the signs of `a' and `b'.                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulDiv( FT_Long  a,\n             FT_Long  b,\n             FT_Long  c );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_MulFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*b)/0x10000' with maximal accuracy.  Most of the time this is   */\n  /*    used to multiply a given value by a 16.16 fixed float factor.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*b)/0x10000'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function has been optimized for the case where the absolute   */\n  /*    value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */\n  /*    As this happens mainly when scaling from notional units to         */\n  /*    fractional pixels in FreeType, it resulted in noticeable speed     */\n  /*    improvements between versions 2.x and 1.x.                         */\n  /*                                                                       */\n  /*    As a conclusion, always try to place a 16.16 factor as the         */\n  /*    _second_ argument of this function; this can make a great          */\n  /*    difference.                                                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_MulFix( FT_Long  a,\n             FT_Long  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_DivFix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to perform the computation             */\n  /*    `(a*0x10000)/b' with maximal accuracy.  Most of the time, this is  */\n  /*    used to divide a given value by a 16.16 fixed float factor.        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The first multiplier.                                         */\n  /*    b :: The second multiplier.  Use a 16.16 factor here whenever      */\n  /*         possible (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a*0x10000)/b'.                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The optimization for FT_DivFix() is simple: If (a << 16) fits in   */\n  /*    32 bits, then the division is computed directly.  Otherwise, we    */\n  /*    use a specialized version of @FT_MulDiv.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_DivFix( FT_Long  a,\n             FT_Long  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_RoundFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to round a 16.16 fixed number.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number to be rounded.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x8000) & -0x10000'.                           */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_RoundFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_CeilFix                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the ceiling function of a   */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the ceiling function is to be computed.  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `(a + 0x10000 - 1) & -0x10000'.                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_CeilFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_FloorFix                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very simple function used to compute the floor function of a     */\n  /*    16.16 fixed number.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: The number for which the floor function is to be computed.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result of `a & -0x10000'.                                      */\n  /*                                                                       */\n  FT_EXPORT( FT_Fixed )\n  FT_FloorFix( FT_Fixed  a );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Vector_Transform                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transform a single vector through a 2x2 matrix.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    vector :: The target vector to transform.                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to the source 2x2 matrix.                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `vector' or `matrix' is invalid. */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Vector_Transform( FT_Vector*        vec,\n                       const FT_Matrix*  matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    version                                                            */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    FreeType Version                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions and macros related to FreeType versions.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Note that those functions and macros are of limited use because    */\n  /*    even a new release of FreeType with only documentation changes     */\n  /*    increases the version number.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   *  @enum:\n   *    FREETYPE_XXX\n   *\n   *  @description:\n   *    These three macros identify the FreeType source code version.\n   *    Use @FT_Library_Version to access them at runtime.\n   *\n   *  @values:\n   *    FREETYPE_MAJOR :: The major version number.\n   *    FREETYPE_MINOR :: The minor version number.\n   *    FREETYPE_PATCH :: The patch level.\n   *\n   *  @note:\n   *    The version number of FreeType if built as a dynamic link library\n   *    with the `libtool' package is _not_ controlled by these three\n   *    macros.\n   */\n#define FREETYPE_MAJOR  2\n#define FREETYPE_MINOR  3\n#define FREETYPE_PATCH  5\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Library_Version                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return the version of the FreeType library being used.  This is    */\n  /*    useful when dynamically linking to the library, since one cannot   */\n  /*    use the macros @FREETYPE_MAJOR, @FREETYPE_MINOR, and               */\n  /*    @FREETYPE_PATCH.                                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A source library handle.                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amajor  :: The major version number.                               */\n  /*                                                                       */\n  /*    aminor  :: The minor version number.                               */\n  /*                                                                       */\n  /*    apatch  :: The patch version number.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' argument is because */\n  /*    certain programs implement library initialization in a custom way  */\n  /*    that doesn't use @FT_Init_FreeType.                                */\n  /*                                                                       */\n  /*    In such cases, the library version might not be available before   */\n  /*    the library object has been created.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Library_Version( FT_Library   library,\n                      FT_Int      *amajor,\n                      FT_Int      *aminor,\n                      FT_Int      *apatch );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_CheckTrueTypePatents                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parse all bytecode instructions of a TrueType font file to check   */\n  /*    whether any of the patented opcodes are used.  This is only useful */\n  /*    if you want to be able to use the unpatented hinter with           */\n  /*    fonts that do *not* use these opcodes.                             */\n  /*                                                                       */\n  /*    Note that this function parses *all* glyph instructions in the     */\n  /*    font file, which may be slow.                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A face handle.                                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1 if this is a TrueType font that uses one of the patented         */\n  /*    opcodes, 0 otherwise.                                              */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_CheckTrueTypePatents( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Face_SetUnpatentedHinting                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Enable or disable the unpatented hinter for a given face.          */\n  /*    Only enable it if you have determined that the face doesn't        */\n  /*    use any patented opcodes (see @FT_Face_CheckTrueTypePatents).      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A face handle.                                            */\n  /*                                                                       */\n  /*    value :: New boolean setting.                                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The old setting value.  This will always be false if this is not   */\n  /*    a SFNT font, or if the unpatented hinter is not compiled in this   */\n  /*    instance of the library.                                           */\n  /*                                                                       */\n  /* <Since>                                                               */\n  /*    2.3.5                                                              */\n  /*                                                                       */\n  FT_EXPORT( FT_Bool )\n  FT_Face_SetUnpatentedHinting( FT_Face  face,\n                                FT_Bool  value );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FREETYPE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftbbox.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbbox.h                                                               */\n/*                                                                         */\n/*    FreeType exact bbox computation (specification).                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003 by                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This component has a _single_ role: to compute exact outline bounding */\n  /* boxes.                                                                */\n  /*                                                                       */\n  /* It is separated from the rest of the engine for various technical     */\n  /* reasons.  It may well be integrated in `ftoutln' later.               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTBBOX_H__\n#define __FTBBOX_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Computes the exact bounding box of an outline.  This is slower     */\n  /*    than computing the control box.  However, it uses an advanced      */\n  /*    algorithm which returns _very_ quickly when the two boxes          */\n  /*    coincide.  Otherwise, the outline Bézier arcs are walked over to   */\n  /*    extract their extrema.                                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    abbox   :: The outline's exact bounding box.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_BBox( FT_Outline*  outline,\n                       FT_BBox     *abbox );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBBOX_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftbdf.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbdf.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing BDF-specific strings (specification).     */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBDF_H__\n#define __FTBDF_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bdf_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    BDF Files                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    BDF specific API.                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of BDF specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_PropertyType\n  *\n  * @description:\n  *    A list of BDF property types.\n  *\n  * @values:\n  *    BDF_PROPERTY_TYPE_NONE ::\n  *      Value 0 is used to indicate a missing property.\n  *\n  *    BDF_PROPERTY_TYPE_ATOM ::\n  *      Property is a string atom.\n  *\n  *    BDF_PROPERTY_TYPE_INTEGER ::\n  *      Property is a 32-bit signed integer.\n  *\n  *    BDF_PROPERTY_TYPE_CARDINAL ::\n  *      Property is a 32-bit unsigned integer.\n  */\n  typedef enum  BDF_PropertyType_\n  {\n    BDF_PROPERTY_TYPE_NONE     = 0,\n    BDF_PROPERTY_TYPE_ATOM     = 1,\n    BDF_PROPERTY_TYPE_INTEGER  = 2,\n    BDF_PROPERTY_TYPE_CARDINAL = 3\n\n  } BDF_PropertyType;\n\n\n /**********************************************************************\n  *\n  * @type:\n  *    BDF_Property\n  *\n  * @description:\n  *    A handle to a @BDF_PropertyRec structure to model a given\n  *    BDF/PCF property.\n  */\n  typedef struct BDF_PropertyRec_*  BDF_Property;\n\n\n /**********************************************************************\n  *\n  * @struct:\n  *    BDF_PropertyRec\n  *\n  * @description:\n  *    This structure models a given BDF/PCF property.\n  *\n  * @fields:\n  *    type ::\n  *      The property type.\n  *\n  *    u.atom ::\n  *      The atom string, if type is @BDF_PROPERTY_TYPE_ATOM.\n  *\n  *    u.integer ::\n  *      A signed integer, if type is @BDF_PROPERTY_TYPE_INTEGER.\n  *\n  *    u.cardinal ::\n  *      An unsigned integer, if type is @BDF_PROPERTY_TYPE_CARDINAL.\n  */\n  typedef struct  BDF_PropertyRec_\n  {\n    BDF_PropertyType  type;\n    union {\n      const char*     atom;\n      FT_Int32        integer;\n      FT_UInt32       cardinal;\n\n    } u;\n\n  } BDF_PropertyRec;\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Charset_ID\n  *\n  * @description:\n  *    Retrieves a BDF font character set identity, according to\n  *    the BDF specification.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  * @output:\n  *    acharset_encoding ::\n  *       Charset encoding, as a C string, owned by the face.\n  *\n  *    acharset_registry ::\n  *       Charset registry, as a C string, owned by the face.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   This function only works with BDF faces, returning an error otherwise.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Charset_ID( FT_Face       face,\n                         const char*  *acharset_encoding,\n                         const char*  *acharset_registry );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_BDF_Property\n  *\n  * @description:\n  *    Retrieves a BDF property from a BDF or PCF font file.\n  *\n  * @input:\n  *    face :: A handle to the input face.\n  *\n  *    name :: The property name.\n  *\n  * @output:\n  *    aproperty :: The property.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   This function works with BDF _and_ PCF fonts.  It returns an error\n  *   otherwise.  It also returns an error if the property is not in the\n  *   font.\n  *\n  *   In case of error, `aproperty->type' is always set to\n  *   @BDF_PROPERTY_TYPE_NONE.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_BDF_Property( FT_Face           face,\n                       const char*       prop_name,\n                       BDF_PropertyRec  *aproperty );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTBDF_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftbitmap.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftbitmap.h                                                             */\n/*                                                                         */\n/*    FreeType utility functions for converting 1bpp, 2bpp, 4bpp, and 8bpp */\n/*    bitmaps into 8bpp format (specification).                            */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTBITMAP_H__\n#define __FTBITMAP_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    bitmap_handling                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Bitmap Handling                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Handling FT_Bitmap objects.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains functions for converting FT_Bitmap objects.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_New                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Initialize a pointer to an @FT_Bitmap structure.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the bitmap structure.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Bitmap_New( FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Copy                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copies an bitmap into another one.                                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    source  :: A handle to the source bitmap.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target  :: A handle to the target bitmap.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Copy( FT_Library        library,\n                  const FT_Bitmap  *source,\n                  FT_Bitmap        *target);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Embolden                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Embolden a bitmap.  The new bitmap will be about `xStrength'       */\n  /*    pixels wider and `yStrength' pixels higher.  The left and bottom   */\n  /*    borders are kept unchanged.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    xStrength :: How strong the glyph is emboldened horizontally.      */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /*    yStrength :: How strong the glyph is emboldened vertically.        */\n  /*                 Expressed in 26.6 pixel format.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    bitmap    :: A handle to the target bitmap.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The current implementation restricts `xStrength' to be less than   */\n  /*    or equal to 8 if bitmap is of pixel_mode @FT_PIXEL_MODE_MONO.      */\n  /*                                                                       */\n  /*    If you want to embolden the bitmap owned by a @FT_GlyphSlotRec,    */\n  /*    you should call `FT_GlyphSlot_Own_Bitmap' on the slot first.       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Embolden( FT_Library  library,\n                      FT_Bitmap*  bitmap,\n                      FT_Pos      xStrength,\n                      FT_Pos      yStrength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Convert                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Convert a bitmap object with depth 1bpp, 2bpp, 4bpp, or 8bpp to a  */\n  /*    bitmap object with depth 8bpp, making the number of used bytes per */\n  /*    line (a.k.a. the `pitch') a multiple of `alignment'.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: A handle to a library object.                         */\n  /*                                                                       */\n  /*    source    :: The source bitmap.                                    */\n  /*                                                                       */\n  /*    alignment :: The pitch of the bitmap is a multiple of this         */\n  /*                 parameter.  Common values are 1, 2, or 4.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target    :: The target bitmap.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    It is possible to call @FT_Bitmap_Convert multiple times without   */\n  /*    calling @FT_Bitmap_Done (the memory is simply reallocated).        */\n  /*                                                                       */\n  /*    Use @FT_Bitmap_Done to finally remove the bitmap object.           */\n  /*                                                                       */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Convert( FT_Library        library,\n                     const FT_Bitmap  *source,\n                     FT_Bitmap        *target,\n                     FT_Int            alignment );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Bitmap_Done                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroy a bitmap object created with @FT_Bitmap_New.               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /*    bitmap  :: The bitmap object to be freed.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `library' argument is taken to have access to FreeType's       */\n  /*    memory handling functions.                                         */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Bitmap_Done( FT_Library  library,\n                  FT_Bitmap  *bitmap );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTBITMAP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftcache.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftcache.h                                                              */\n/*                                                                         */\n/*    FreeType Cache subsystem (specification).                            */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTCACHE_H__\n#define __FTCACHE_H__\n\n\n#include <ft2build.h>\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************\n   *\n   * <Section>\n   *    cache_subsystem\n   *\n   * <Title>\n   *    Cache Sub-System\n   *\n   * <Abstract>\n   *    How to cache face, size, and glyph data with FreeType 2.\n   *\n   * <Description>\n   *   This section describes the FreeType 2 cache sub-system, which is used\n   *   to limit the number of concurrently opened @FT_Face and @FT_Size\n   *   objects, as well as caching information like character maps and glyph\n   *   images while limiting their maximum memory usage.\n   *\n   *   Note that all types and functions begin with the `FTC_' prefix.\n   *\n   *   The cache is highly portable and thus doesn't know anything about the\n   *   fonts installed on your system, or how to access them.  This implies\n   *   the following scheme:\n   *\n   *   First, available or installed font faces are uniquely identified by\n   *   @FTC_FaceID values, provided to the cache by the client.  Note that\n   *   the cache only stores and compares these values, and doesn't try to\n   *   interpret them in any way.\n   *\n   *   Second, the cache calls, only when needed, a client-provided function\n   *   to convert a @FTC_FaceID into a new @FT_Face object.  The latter is\n   *   then completely managed by the cache, including its termination\n   *   through @FT_Done_Face.\n   *\n   *   Clients are free to map face IDs to anything else.  The most simple\n   *   usage is to associate them to a (pathname,face_index) pair that is\n   *   used to call @FT_New_Face.  However, more complex schemes are also\n   *   possible.\n   *\n   *   Note that for the cache to work correctly, the face ID values must be\n   *   *persistent*, which means that the contents they point to should not\n   *   change at runtime, or that their value should not become invalid.\n   *\n   *   If this is unavoidable (e.g., when a font is uninstalled at runtime),\n   *   you should call @FTC_Manager_RemoveFaceID as soon as possible, to let\n   *   the cache get rid of any references to the old @FTC_FaceID it may\n   *   keep internally.  Failure to do so will lead to incorrect behaviour\n   *   or even crashes.\n   *\n   *   To use the cache, start with calling @FTC_Manager_New to create a new\n   *   @FTC_Manager object, which models a single cache instance.  You can\n   *   then look up @FT_Face and @FT_Size objects with\n   *   @FTC_Manager_LookupFace and @FTC_Manager_LookupSize, respectively.\n   *\n   *   If you want to use the charmap caching, call @FTC_CMapCache_New, then\n   *   later use @FTC_CMapCache_Lookup to perform the equivalent of\n   *   @FT_Get_Char_Index, only much faster.\n   *\n   *   If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then\n   *   later use @FTC_ImageCache_Lookup to retrieve the corresponding\n   *   @FT_Glyph objects from the cache.\n   *\n   *   If you need lots of small bitmaps, it is much more memory efficient\n   *   to call @FTC_SBitCache_New followed by @FTC_SBitCache_Lookup.  This\n   *   returns @FTC_SBitRec structures, which are used to store small\n   *   bitmaps directly.  (A small bitmap is one whose metrics and\n   *   dimensions all fit into 8-bit integers).\n   *\n   *   We hope to also provide a kerning cache in the near future.\n   *\n   *\n   * <Order>\n   *   FTC_Manager\n   *   FTC_FaceID\n   *   FTC_Face_Requester\n   *\n   *   FTC_Manager_New\n   *   FTC_Manager_Reset\n   *   FTC_Manager_Done\n   *   FTC_Manager_LookupFace\n   *   FTC_Manager_LookupSize\n   *   FTC_Manager_RemoveFaceID\n   *\n   *   FTC_Node\n   *   FTC_Node_Unref\n   *\n   *   FTC_ImageCache\n   *   FTC_ImageCache_New\n   *   FTC_ImageCache_Lookup\n   *\n   *   FTC_SBit\n   *   FTC_SBitCache\n   *   FTC_SBitCache_New\n   *   FTC_SBitCache_Lookup\n   *\n   *   FTC_CMapCache\n   *   FTC_CMapCache_New\n   *   FTC_CMapCache_Lookup\n   *\n   *************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                    BASIC TYPE DEFINITIONS                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type: FTC_FaceID\n   *\n   * @description:\n   *   An opaque pointer type that is used to identity face objects.  The\n   *   contents of such objects is application-dependent.\n   *\n   *   These pointers are typically used to point to a user-defined\n   *   structure containing a font file path, and face index.\n   *\n   * @note:\n   *   Never use NULL as a valid @FTC_FaceID.\n   *\n   *   Face IDs are passed by the client to the cache manager, which calls,\n   *   when needed, the @FTC_Face_Requester to translate them into new\n   *   @FT_Face objects.\n   *\n   *   If the content of a given face ID changes at runtime, or if the value\n   *   becomes invalid (e.g., when uninstalling a font), you should\n   *   immediately call @FTC_Manager_RemoveFaceID before any other cache\n   *   function.\n   *\n   *   Failure to do so will result in incorrect behaviour or even\n   *   memory leaks and crashes.\n   */\n  typedef struct FTC_FaceIDRec_*  FTC_FaceID;\n\n\n  /************************************************************************\n   *\n   * @functype:\n   *   FTC_Face_Requester\n   *\n   * @description:\n   *   A callback function provided by client applications.  It is used by\n   *   the cache manager to translate a given @FTC_FaceID into a new valid\n   *   @FT_Face object, on demand.\n   *\n   * <Input>\n   *   face_id ::\n   *     The face ID to resolve.\n   *\n   *   library ::\n   *     A handle to a FreeType library object.\n   *\n   *   req_data ::\n   *     Application-provided request data (see note below).\n   *\n   * <Output>\n   *   aface ::\n   *     A new @FT_Face handle.\n   *\n   * <Return>\n   *   FreeType error code.  0 means success.\n   *\n   * <Note>\n   *   The third parameter `req_data' is the same as the one passed by the\n   *   client when @FTC_Manager_New is called.\n   *\n   *   The face requester should not perform funny things on the returned\n   *   face object, like creating a new @FT_Size for it, or setting a\n   *   transformation through @FT_Set_Transform!\n   */\n  typedef FT_Error\n  (*FTC_Face_Requester)( FTC_FaceID  face_id,\n                         FT_Library  library,\n                         FT_Pointer  request_data,\n                         FT_Face*    aface );\n\n /* */\n\n#define FT_POINTER_TO_ULONG( p )  ( (FT_ULong)(FT_Pointer)(p) )\n\n#define FTC_FACE_ID_HASH( i )                                \\\n          ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^   \\\n                       ( FT_POINTER_TO_ULONG( i ) << 7 ) ) )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                      CACHE MANAGER OBJECT                     *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Manager                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This object corresponds to one instance of the cache-subsystem.    */\n  /*    It is used to cache one or more @FT_Face objects, along with       */\n  /*    corresponding @FT_Size objects.                                    */\n  /*                                                                       */\n  /*    The manager intentionally limits the total number of opened        */\n  /*    @FT_Face and @FT_Size objects to control memory usage.  See the    */\n  /*    `max_faces' and `max_sizes' parameters of @FTC_Manager_New.        */\n  /*                                                                       */\n  /*    The manager is also used to cache `nodes' of various types while   */\n  /*    limiting their total memory usage.                                 */\n  /*                                                                       */\n  /*    All limitations are enforced by keeping lists of managed objects   */\n  /*    in most-recently-used order, and flushing old nodes to make room   */\n  /*    for new ones.                                                      */\n  /*                                                                       */\n  typedef struct FTC_ManagerRec_*  FTC_Manager;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_Node                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An opaque handle to a cache node object.  Each cache node is       */\n  /*    reference-counted.  A node with a count of 0 might be flushed      */\n  /*    out of a full cache whenever a lookup request is performed.        */\n  /*                                                                       */\n  /*    If you lookup nodes, you have the ability to `acquire' them, i.e., */\n  /*    to increment their reference count.  This will prevent the node    */\n  /*    from being flushed out of the cache until you explicitly `release' */\n  /*    it (see @FTC_Node_Unref).                                          */\n  /*                                                                       */\n  /*    See also @FTC_SBitCache_Lookup and @FTC_ImageCache_Lookup.         */\n  /*                                                                       */\n  typedef struct FTC_NodeRec_*  FTC_Node;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_New                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Creates a new cache manager.                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library   :: The parent FreeType library handle to use.            */\n  /*                                                                       */\n  /*    max_faces :: Maximum number of opened @FT_Face objects managed by  */\n  /*                 this cache instance.  Use 0 for defaults.             */\n  /*                                                                       */\n  /*    max_sizes :: Maximum number of opened @FT_Size objects managed by  */\n  /*                 this cache instance.  Use 0 for defaults.             */\n  /*                                                                       */\n  /*    max_bytes :: Maximum number of bytes to use for cached data nodes. */\n  /*                 Use 0 for defaults.  Note that this value does not    */\n  /*                 account for managed @FT_Face and @FT_Size objects.    */\n  /*                                                                       */\n  /*    requester :: An application-provided callback used to translate    */\n  /*                 face IDs into real @FT_Face objects.                  */\n  /*                                                                       */\n  /*    req_data  :: A generic pointer that is passed to the requester     */\n  /*                 each time it is called (see @FTC_Face_Requester).     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amanager  :: A handle to a new manager object.  0 in case of       */\n  /*                 failure.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_New( FT_Library          library,\n                   FT_UInt             max_faces,\n                   FT_UInt             max_sizes,\n                   FT_ULong            max_bytes,\n                   FTC_Face_Requester  requester,\n                   FT_Pointer          req_data,\n                   FTC_Manager        *amanager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Reset                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Empties a given cache manager.  This simply gets rid of all the    */\n  /*    currently cached @FT_Face and @FT_Size objects within the manager. */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    manager :: A handle to the manager.                                */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Reset( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_Done                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a given manager after emptying it.                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the target cache manager object.            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Manager_Done( FTC_Manager  manager );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupFace                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieves the @FT_Face object that corresponds to a given face ID  */\n  /*    through a cache manager.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    face_id :: The ID of the face object.                              */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface   :: A handle to the face object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Face object is always owned by the manager.  You  */\n  /*    should never try to discard it yourself.                           */\n  /*                                                                       */\n  /*    The @FT_Face object doesn't necessarily have a current size object */\n  /*    (i.e., face->size can be 0).  If you need a specific `font size',  */\n  /*    use @FTC_Manager_LookupSize instead.                               */\n  /*                                                                       */\n  /*    Never change the face's transformation matrix (i.e., never call    */\n  /*    the @FT_Set_Transform function) on a returned face!  If you need   */\n  /*    to transform glyphs, do it yourself after glyph loading.           */\n  /*                                                                       */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory was available */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupFace( FTC_Manager  manager,\n                          FTC_FaceID   face_id,\n                          FT_Face     *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_ScalerRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a given character size in either      */\n  /*    pixels or points to the cache manager.  See                        */\n  /*    @FTC_Manager_LookupSize.                                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face_id :: The source face ID.                                     */\n  /*                                                                       */\n  /*    width   :: The character width.                                    */\n  /*                                                                       */\n  /*    height  :: The character height.                                   */\n  /*                                                                       */\n  /*    pixel   :: A Boolean.  If 1, the `width' and `height' fields are   */\n  /*               interpreted as integer pixel character sizes.           */\n  /*               Otherwise, they are expressed as 1/64th of points.      */\n  /*                                                                       */\n  /*    x_res   :: Only used when `pixel' is value 0 to indicate the       */\n  /*               horizontal resolution in dpi.                           */\n  /*                                                                       */\n  /*    y_res   :: Only used when `pixel' is value 0 to indicate the       */\n  /*               vertical resolution in dpi.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This type is mainly used to retrieve @FT_Size objects through the  */\n  /*    cache manager.                                                     */\n  /*                                                                       */\n  typedef struct  FTC_ScalerRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UInt     width;\n    FT_UInt     height;\n    FT_Int      pixel;\n    FT_UInt     x_res;\n    FT_UInt     y_res;\n\n  } FTC_ScalerRec, *FTC_Scaler;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Manager_LookupSize                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieve the @FT_Size object that corresponds to a given           */\n  /*    @FTC_ScalerRec pointer through a cache manager.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the cache manager.                          */\n  /*                                                                       */\n  /*    scaler  :: A scaler handle.                                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize   :: A handle to the size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned @FT_Size object is always owned by the manager.  You  */\n  /*    should never try to discard it by yourself.                        */\n  /*                                                                       */\n  /*    You can access the parent @FT_Face object simply as `size->face'   */\n  /*    if you need it.  Note that this object is also owned by the        */\n  /*    manager.                                                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    When you perform a lookup, out-of-memory errors are detected       */\n  /*    _within_ the lookup and force incremental flushes of the cache     */\n  /*    until enough memory is released for the lookup to succeed.         */\n  /*                                                                       */\n  /*    If a lookup fails with `FT_Err_Out_Of_Memory' the cache has        */\n  /*    already been completely flushed, and still no memory is available  */\n  /*    for the operation.                                                 */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_Manager_LookupSize( FTC_Manager  manager,\n                          FTC_Scaler   scaler,\n                          FT_Size     *asize );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_Node_Unref                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Decrement a cache node's internal reference count.  When the count */\n  /*    reaches 0, it is not destroyed but becomes eligible for subsequent */\n  /*    cache flushes.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node    :: The cache node handle.                                  */\n  /*                                                                       */\n  /*    manager :: The cache manager handle.                               */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FTC_Node_Unref( FTC_Node     node,\n                  FTC_Manager  manager );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_Manager_RemoveFaceID\n   *\n   * @description:\n   *   A special function used to indicate to the cache manager that\n   *   a given @FTC_FaceID is no longer valid, either because its\n   *   content changed, or because it was deallocated or uninstalled.\n   *\n   * @input:\n   *   manager ::\n   *     The cache manager handle.\n   *\n   *   face_id ::\n   *     The @FTC_FaceID to be removed.\n   *\n   * @note:\n   *   This function flushes all nodes from the cache corresponding to this\n   *   `face_id', with the exception of nodes with a non-null reference\n   *   count.\n   *\n   *   Such nodes are however modified internally so as to never appear\n   *   in later lookups with the same `face_id' value, and to be immediately\n   *   destroyed when released by all their users.\n   *\n   */\n  FT_EXPORT( void )\n  FTC_Manager_RemoveFaceID( FTC_Manager  manager,\n                            FTC_FaceID   face_id );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_CMapCache\n   *\n   * @description:\n   *   An opaque handle used to model a charmap cache.  This cache is to\n   *   hold character codes -> glyph indices mappings.\n   *\n   */\n  typedef struct FTC_CMapCacheRec_*  FTC_CMapCache;\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_New\n   *\n   * @description:\n   *   Create a new charmap cache.\n   *\n   * @input:\n   *   manager ::\n   *     A handle to the cache manager.\n   *\n   * @output:\n   *   acache ::\n   *     A new cache handle.  NULL in case of error.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   Like all other caches, this one will be destroyed with the cache\n   *   manager.\n   *\n   */\n  FT_EXPORT( FT_Error )\n  FTC_CMapCache_New( FTC_Manager     manager,\n                     FTC_CMapCache  *acache );\n\n\n  /************************************************************************\n   *\n   * @function:\n   *   FTC_CMapCache_Lookup\n   *\n   * @description:\n   *   Translate a character code into a glyph index, using the charmap\n   *   cache.\n   *\n   * @input:\n   *   cache ::\n   *     A charmap cache handle.\n   *\n   *   face_id ::\n   *     The source face ID.\n   *\n   *   cmap_index ::\n   *     The index of the charmap in the source face.\n   *\n   *   char_code ::\n   *     The character code (in the corresponding charmap).\n   *\n   * @return:\n   *    Glyph index.  0 means `no glyph'.\n   *\n   */\n  FT_EXPORT( FT_UInt )\n  FTC_CMapCache_Lookup( FTC_CMapCache  cache,\n                        FTC_FaceID     face_id,\n                        FT_Int         cmap_index,\n                        FT_UInt32      char_code );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    cache_subsystem                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****                       IMAGE CACHE OBJECT                      *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FTC_ImageTypeRec\n   *\n   * @description:\n   *   A structure used to model the type of images in a glyph cache.\n   *\n   * @fields:\n   *   face_id ::\n   *     The face ID.\n   *\n   *   width ::\n   *     The width in pixels.\n   *\n   *   height ::\n   *     The height in pixels.\n   *\n   *   flags ::\n   *     The load flags, as in @FT_Load_Glyph.\n   *\n   */\n  typedef struct  FTC_ImageTypeRec_\n  {\n    FTC_FaceID  face_id;\n    FT_Int      width;\n    FT_Int      height;\n    FT_Int32    flags;\n\n  } FTC_ImageTypeRec;\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FTC_ImageType\n   *\n   * @description:\n   *   A handle to an @FTC_ImageTypeRec structure.\n   *\n   */\n  typedef struct FTC_ImageTypeRec_*  FTC_ImageType;\n\n\n  /* */\n\n\n#define FTC_IMAGE_TYPE_COMPARE( d1, d2 )      \\\n          ( (d1)->face_id == (d2)->face_id && \\\n            (d1)->width   == (d2)->width   && \\\n            (d1)->flags   == (d2)->flags   )\n\n#define FTC_IMAGE_TYPE_HASH( d )                          \\\n          (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id )  ^ \\\n                      ( (d)->width << 8 ) ^ (d)->height ^ \\\n                      ( (d)->flags << 4 )               )\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_ImageCache                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an glyph image cache object.  They are designed to     */\n  /*    hold many distinct glyph images while not exceeding a certain      */\n  /*    memory threshold.                                                  */\n  /*                                                                       */\n  typedef struct FTC_ImageCacheRec_*  FTC_ImageCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_New                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Creates a new glyph image cache.                                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: The parent manager for the image cache.                 */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new glyph image cache object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_New( FTC_Manager      manager,\n                      FTC_ImageCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_Lookup                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieves a given glyph image from a glyph image cache.            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source glyph image cache.                */\n  /*                                                                       */\n  /*    type   :: A pointer to a glyph image type descriptor.              */\n  /*                                                                       */\n  /*    gindex :: The glyph index to retrieve.                             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: The corresponding @FT_Glyph object.  0 in case of        */\n  /*              failure.                                                 */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_Lookup( FTC_ImageCache  cache,\n                         FTC_ImageType   type,\n                         FT_UInt         gindex,\n                         FT_Glyph       *aglyph,\n                         FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_ImageCache_LookupScaler                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_ImageCache_Lookup that uses an @FTC_ScalerRec    */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source glyph image cache.            */\n  /*                                                                       */\n  /*    scaler     :: A pointer to a scaler descriptor.                    */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index to retrieve.                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph     :: The corresponding @FT_Glyph object.  0 in case of    */\n  /*                  failure.                                             */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The returned glyph is owned and managed by the glyph image cache.  */\n  /*    Never try to transform or discard it manually!  You can however    */\n  /*    create a copy with @FT_Glyph_Copy and modify the new one.          */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the glyph image, after increasing its reference    */\n  /*    count.  This ensures that the node (as well as the @FT_Glyph) will */\n  /*    always be kept in the cache until you call @FTC_Node_Unref to      */\n  /*    `release' it.                                                      */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the @FT_Glyph could be flushed out of the cache on the next   */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_ImageCache_LookupScaler( FTC_ImageCache  cache,\n                               FTC_Scaler      scaler,\n                               FT_ULong        load_flags,\n                               FT_UInt         gindex,\n                               FT_Glyph       *aglyph,\n                               FTC_Node       *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBit                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap descriptor.  See the @FTC_SBitRec       */\n  /*    structure for details.                                             */\n  /*                                                                       */\n  typedef struct FTC_SBitRec_*  FTC_SBit;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_SBitRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A very compact structure used to describe a small glyph bitmap.    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    width     :: The bitmap width in pixels.                           */\n  /*                                                                       */\n  /*    height    :: The bitmap height in pixels.                          */\n  /*                                                                       */\n  /*    left      :: The horizontal distance from the pen position to the  */\n  /*                 left bitmap border (a.k.a. `left side bearing', or    */\n  /*                 `lsb').                                               */\n  /*                                                                       */\n  /*    top       :: The vertical distance from the pen position (on the   */\n  /*                 baseline) to the upper bitmap border (a.k.a. `top     */\n  /*                 side bearing').  The distance is positive for upwards */\n  /*                 Y coordinates.                                        */\n  /*                                                                       */\n  /*    format    :: The format of the glyph bitmap (monochrome or gray).  */\n  /*                                                                       */\n  /*    max_grays :: Maximum gray level value (in the range 1 to 255).     */\n  /*                                                                       */\n  /*    pitch     :: The number of bytes per bitmap line.  May be positive */\n  /*                 or negative.                                          */\n  /*                                                                       */\n  /*    xadvance  :: The horizontal advance width in pixels.               */\n  /*                                                                       */\n  /*    yadvance  :: The vertical advance height in pixels.                */\n  /*                                                                       */\n  /*    buffer    :: A pointer to the bitmap pixels.                       */\n  /*                                                                       */\n  typedef struct  FTC_SBitRec_\n  {\n    FT_Byte   width;\n    FT_Byte   height;\n    FT_Char   left;\n    FT_Char   top;\n\n    FT_Byte   format;\n    FT_Byte   max_grays;\n    FT_Short  pitch;\n    FT_Char   xadvance;\n    FT_Char   yadvance;\n\n    FT_Byte*  buffer;\n\n  } FTC_SBitRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FTC_SBitCache                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a small bitmap cache.  These are special cache objects */\n  /*    used to store small glyph bitmaps (and anti-aliased pixmaps) in a  */\n  /*    much more efficient way than the traditional glyph image cache     */\n  /*    implemented by @FTC_ImageCache.                                    */\n  /*                                                                       */\n  typedef struct FTC_SBitCacheRec_*  FTC_SBitCache;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_New                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Creates a new cache to store small glyph bitmaps.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    manager :: A handle to the source cache manager.                   */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acache  :: A handle to the new sbit cache.  NULL in case of error. */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_New( FTC_Manager     manager,\n                     FTC_SBitCache  *acache );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_Lookup                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Looks up a given small glyph bitmap in a given sbit cache and      */\n  /*    `lock' it to prevent its flushing from the cache until needed.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache  :: A handle to the source sbit cache.                       */\n  /*                                                                       */\n  /*    type   :: A pointer to the glyph image type descriptor.            */\n  /*                                                                       */\n  /*    gindex :: The glyph index.                                         */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit   :: A handle to a small bitmap descriptor.                   */\n  /*                                                                       */\n  /*    anode  :: Used to return the address of of the corresponding cache */\n  /*              node after incrementing its reference count (see note    */\n  /*              below).                                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to 0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_Lookup( FTC_SBitCache    cache,\n                        FTC_ImageType    type,\n                        FT_UInt          gindex,\n                        FTC_SBit        *sbit,\n                        FTC_Node        *anode );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FTC_SBitCache_LookupScaler                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A variant of @FTC_SBitCache_Lookup that uses an @FTC_ScalerRec     */\n  /*    to specify the face ID and its size.                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    cache      :: A handle to the source sbit cache.                   */\n  /*                                                                       */\n  /*    scaler     :: A pointer to the scaler descriptor.                  */\n  /*                                                                       */\n  /*    load_flags :: The corresponding load flags.                        */\n  /*                                                                       */\n  /*    gindex     :: The glyph index.                                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    sbit       :: A handle to a small bitmap descriptor.               */\n  /*                                                                       */\n  /*    anode      :: Used to return the address of of the corresponding   */\n  /*                  cache node after incrementing its reference count    */\n  /*                  (see note below).                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The small bitmap descriptor and its bit buffer are owned by the    */\n  /*    cache and should never be freed by the application.  They might    */\n  /*    as well disappear from memory on the next cache lookup, so don't   */\n  /*    treat them as persistent data.                                     */\n  /*                                                                       */\n  /*    The descriptor's `buffer' field is set to 0 to indicate a missing  */\n  /*    glyph bitmap.                                                      */\n  /*                                                                       */\n  /*    If `anode' is _not_ NULL, it receives the address of the cache     */\n  /*    node containing the bitmap, after increasing its reference count.  */\n  /*    This ensures that the node (as well as the image) will always be   */\n  /*    kept in the cache until you call @FTC_Node_Unref to `release' it.  */\n  /*                                                                       */\n  /*    If `anode' is NULL, the cache node is left unchanged, which means  */\n  /*    that the bitmap could be flushed out of the cache on the next      */\n  /*    call to one of the caching sub-system APIs.  Don't assume that it  */\n  /*    is persistent!                                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FTC_SBitCache_LookupScaler( FTC_SBitCache  cache,\n                              FTC_Scaler     scaler,\n                              FT_ULong       load_flags,\n                              FT_UInt        gindex,\n                              FTC_SBit      *sbit,\n                              FTC_Node      *anode );\n\n\n /* */\n\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\n\n  /*@***********************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FTC_FontRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to describe a given `font' to the cache    */\n  /*    manager.  Note that a `font' is the combination of a given face    */\n  /*    with a given character size.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    face_id    :: The ID of the face to use.                           */\n  /*                                                                       */\n  /*    pix_width  :: The character width in integer pixels.               */\n  /*                                                                       */\n  /*    pix_height :: The character height in integer pixels.              */\n  /*                                                                       */\n  typedef struct  FTC_FontRec_\n  {\n    FTC_FaceID  face_id;\n    FT_UShort   pix_width;\n    FT_UShort   pix_height;\n\n  } FTC_FontRec;\n\n\n  /* */\n\n\n#define FTC_FONT_COMPARE( f1, f2 )                  \\\n          ( (f1)->face_id    == (f2)->face_id    && \\\n            (f1)->pix_width  == (f2)->pix_width  && \\\n            (f1)->pix_height == (f2)->pix_height )\n\n#define FTC_FONT_HASH( f )                              \\\n          (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \\\n                       ((f)->pix_width << 8)          ^ \\\n                       ((f)->pix_height)              )\n\n  typedef FTC_FontRec*  FTC_Font;\n\n\n  FT_EXPORT( FT_Error )\n  FTC_Manager_Lookup_Face( FTC_Manager  manager,\n                           FTC_FaceID   face_id,\n                           FT_Face     *aface );\n\n  FT_EXPORT( FT_Error )\n  FTC_Manager_Lookup_Size( FTC_Manager  manager,\n                           FTC_Font     font,\n                           FT_Face     *aface,\n                           FT_Size     *asize );\n\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTCACHE_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftchapters.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/* This file defines the structure of the FreeType reference.              */\n/* It is used by the python script which generates the HTML files.         */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    general_remarks                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    General Remarks                                                      */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    user_allocation                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    core_api                                                             */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Core API                                                             */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    version                                                              */\n/*    basic_types                                                          */\n/*    base_interface                                                       */\n/*    glyph_management                                                     */\n/*    mac_specific                                                         */\n/*    sizes_management                                                     */\n/*    header_file_macros                                                   */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    format_specific                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Format-Specific API                                                  */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    multiple_masters                                                     */\n/*    truetype_tables                                                      */\n/*    type1_tables                                                         */\n/*    sfnt_names                                                           */\n/*    bdf_fonts                                                            */\n/*    pfr_fonts                                                            */\n/*    winfnt_fonts                                                         */\n/*    font_formats                                                         */\n/*    gasp_table                                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Cache Sub-System                                                     */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    cache_subsystem                                                      */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* <Chapter>                                                               */\n/*    support_api                                                          */\n/*                                                                         */\n/* <Title>                                                                 */\n/*    Support API                                                          */\n/*                                                                         */\n/* <Sections>                                                              */\n/*    computations                                                         */\n/*    list_processing                                                      */\n/*    outline_processing                                                   */\n/*    bitmap_handling                                                      */\n/*    raster                                                               */\n/*    glyph_stroker                                                        */\n/*    system_interface                                                     */\n/*    module_management                                                    */\n/*    gzip                                                                 */\n/*    lzw                                                                  */\n/*    lcd_filtering                                                        */\n/*                                                                         */\n/***************************************************************************/\n"
  },
  {
    "path": "libIGraph/include/freetype/fterrdef.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrdef.h                                                             */\n/*                                                                         */\n/*    FreeType error codes (specification).                                */\n/*                                                                         */\n/*  Copyright 2002, 2004, 2006, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                LIST OF ERROR CODES/MESSAGES             *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n  /* You need to define both FT_ERRORDEF_ and FT_NOERRORDEF_ before */\n  /* including this file.                                           */\n\n\n  /* generic errors */\n\n  FT_NOERRORDEF_( Ok,                                        0x00, \\\n                  \"no error\" )\n\n  FT_ERRORDEF_( Cannot_Open_Resource,                        0x01, \\\n                \"cannot open resource\" )\n  FT_ERRORDEF_( Unknown_File_Format,                         0x02, \\\n                \"unknown file format\" )\n  FT_ERRORDEF_( Invalid_File_Format,                         0x03, \\\n                \"broken file\" )\n  FT_ERRORDEF_( Invalid_Version,                             0x04, \\\n                \"invalid FreeType version\" )\n  FT_ERRORDEF_( Lower_Module_Version,                        0x05, \\\n                \"module version is too low\" )\n  FT_ERRORDEF_( Invalid_Argument,                            0x06, \\\n                \"invalid argument\" )\n  FT_ERRORDEF_( Unimplemented_Feature,                       0x07, \\\n                \"unimplemented feature\" )\n  FT_ERRORDEF_( Invalid_Table,                               0x08, \\\n                \"broken table\" )\n  FT_ERRORDEF_( Invalid_Offset,                              0x09, \\\n                \"broken offset within table\" )\n  FT_ERRORDEF_( Array_Too_Large,                             0x0A, \\\n                \"array allocation size too large\" )\n\n  /* glyph/character errors */\n\n  FT_ERRORDEF_( Invalid_Glyph_Index,                         0x10, \\\n                \"invalid glyph index\" )\n  FT_ERRORDEF_( Invalid_Character_Code,                      0x11, \\\n                \"invalid character code\" )\n  FT_ERRORDEF_( Invalid_Glyph_Format,                        0x12, \\\n                \"unsupported glyph image format\" )\n  FT_ERRORDEF_( Cannot_Render_Glyph,                         0x13, \\\n                \"cannot render this glyph format\" )\n  FT_ERRORDEF_( Invalid_Outline,                             0x14, \\\n                \"invalid outline\" )\n  FT_ERRORDEF_( Invalid_Composite,                           0x15, \\\n                \"invalid composite glyph\" )\n  FT_ERRORDEF_( Too_Many_Hints,                              0x16, \\\n                \"too many hints\" )\n  FT_ERRORDEF_( Invalid_Pixel_Size,                          0x17, \\\n                \"invalid pixel size\" )\n\n  /* handle errors */\n\n  FT_ERRORDEF_( Invalid_Handle,                              0x20, \\\n                \"invalid object handle\" )\n  FT_ERRORDEF_( Invalid_Library_Handle,                      0x21, \\\n                \"invalid library handle\" )\n  FT_ERRORDEF_( Invalid_Driver_Handle,                       0x22, \\\n                \"invalid module handle\" )\n  FT_ERRORDEF_( Invalid_Face_Handle,                         0x23, \\\n                \"invalid face handle\" )\n  FT_ERRORDEF_( Invalid_Size_Handle,                         0x24, \\\n                \"invalid size handle\" )\n  FT_ERRORDEF_( Invalid_Slot_Handle,                         0x25, \\\n                \"invalid glyph slot handle\" )\n  FT_ERRORDEF_( Invalid_CharMap_Handle,                      0x26, \\\n                \"invalid charmap handle\" )\n  FT_ERRORDEF_( Invalid_Cache_Handle,                        0x27, \\\n                \"invalid cache manager handle\" )\n  FT_ERRORDEF_( Invalid_Stream_Handle,                       0x28, \\\n                \"invalid stream handle\" )\n\n  /* driver errors */\n\n  FT_ERRORDEF_( Too_Many_Drivers,                            0x30, \\\n                \"too many modules\" )\n  FT_ERRORDEF_( Too_Many_Extensions,                         0x31, \\\n                \"too many extensions\" )\n\n  /* memory errors */\n\n  FT_ERRORDEF_( Out_Of_Memory,                               0x40, \\\n                \"out of memory\" )\n  FT_ERRORDEF_( Unlisted_Object,                             0x41, \\\n                \"unlisted object\" )\n\n  /* stream errors */\n\n  FT_ERRORDEF_( Cannot_Open_Stream,                          0x51, \\\n                \"cannot open stream\" )\n  FT_ERRORDEF_( Invalid_Stream_Seek,                         0x52, \\\n                \"invalid stream seek\" )\n  FT_ERRORDEF_( Invalid_Stream_Skip,                         0x53, \\\n                \"invalid stream skip\" )\n  FT_ERRORDEF_( Invalid_Stream_Read,                         0x54, \\\n                \"invalid stream read\" )\n  FT_ERRORDEF_( Invalid_Stream_Operation,                    0x55, \\\n                \"invalid stream operation\" )\n  FT_ERRORDEF_( Invalid_Frame_Operation,                     0x56, \\\n                \"invalid frame operation\" )\n  FT_ERRORDEF_( Nested_Frame_Access,                         0x57, \\\n                \"nested frame access\" )\n  FT_ERRORDEF_( Invalid_Frame_Read,                          0x58, \\\n                \"invalid frame read\" )\n\n  /* raster errors */\n\n  FT_ERRORDEF_( Raster_Uninitialized,                        0x60, \\\n                \"raster uninitialized\" )\n  FT_ERRORDEF_( Raster_Corrupted,                            0x61, \\\n                \"raster corrupted\" )\n  FT_ERRORDEF_( Raster_Overflow,                             0x62, \\\n                \"raster overflow\" )\n  FT_ERRORDEF_( Raster_Negative_Height,                      0x63, \\\n                \"negative height while rastering\" )\n\n  /* cache errors */\n\n  FT_ERRORDEF_( Too_Many_Caches,                             0x70, \\\n                \"too many registered caches\" )\n\n  /* TrueType and SFNT errors */\n\n  FT_ERRORDEF_( Invalid_Opcode,                              0x80, \\\n                \"invalid opcode\" )\n  FT_ERRORDEF_( Too_Few_Arguments,                           0x81, \\\n                \"too few arguments\" )\n  FT_ERRORDEF_( Stack_Overflow,                              0x82, \\\n                \"stack overflow\" )\n  FT_ERRORDEF_( Code_Overflow,                               0x83, \\\n                \"code overflow\" )\n  FT_ERRORDEF_( Bad_Argument,                                0x84, \\\n                \"bad argument\" )\n  FT_ERRORDEF_( Divide_By_Zero,                              0x85, \\\n                \"division by zero\" )\n  FT_ERRORDEF_( Invalid_Reference,                           0x86, \\\n                \"invalid reference\" )\n  FT_ERRORDEF_( Debug_OpCode,                                0x87, \\\n                \"found debug opcode\" )\n  FT_ERRORDEF_( ENDF_In_Exec_Stream,                         0x88, \\\n                \"found ENDF opcode in execution stream\" )\n  FT_ERRORDEF_( Nested_DEFS,                                 0x89, \\\n                \"nested DEFS\" )\n  FT_ERRORDEF_( Invalid_CodeRange,                           0x8A, \\\n                \"invalid code range\" )\n  FT_ERRORDEF_( Execution_Too_Long,                          0x8B, \\\n                \"execution context too long\" )\n  FT_ERRORDEF_( Too_Many_Function_Defs,                      0x8C, \\\n                \"too many function definitions\" )\n  FT_ERRORDEF_( Too_Many_Instruction_Defs,                   0x8D, \\\n                \"too many instruction definitions\" )\n  FT_ERRORDEF_( Table_Missing,                               0x8E, \\\n                \"SFNT font table missing\" )\n  FT_ERRORDEF_( Horiz_Header_Missing,                        0x8F, \\\n                \"horizontal header (hhea) table missing\" )\n  FT_ERRORDEF_( Locations_Missing,                           0x90, \\\n                \"locations (loca) table missing\" )\n  FT_ERRORDEF_( Name_Table_Missing,                          0x91, \\\n                \"name table missing\" )\n  FT_ERRORDEF_( CMap_Table_Missing,                          0x92, \\\n                \"character map (cmap) table missing\" )\n  FT_ERRORDEF_( Hmtx_Table_Missing,                          0x93, \\\n                \"horizontal metrics (hmtx) table missing\" )\n  FT_ERRORDEF_( Post_Table_Missing,                          0x94, \\\n                \"PostScript (post) table missing\" )\n  FT_ERRORDEF_( Invalid_Horiz_Metrics,                       0x95, \\\n                \"invalid horizontal metrics\" )\n  FT_ERRORDEF_( Invalid_CharMap_Format,                      0x96, \\\n                \"invalid character map (cmap) format\" )\n  FT_ERRORDEF_( Invalid_PPem,                                0x97, \\\n                \"invalid ppem value\" )\n  FT_ERRORDEF_( Invalid_Vert_Metrics,                        0x98, \\\n                \"invalid vertical metrics\" )\n  FT_ERRORDEF_( Could_Not_Find_Context,                      0x99, \\\n                \"could not find context\" )\n  FT_ERRORDEF_( Invalid_Post_Table_Format,                   0x9A, \\\n                \"invalid PostScript (post) table format\" )\n  FT_ERRORDEF_( Invalid_Post_Table,                          0x9B, \\\n                \"invalid PostScript (post) table\" )\n\n  /* CFF, CID, and Type 1 errors */\n\n  FT_ERRORDEF_( Syntax_Error,                                0xA0, \\\n                \"opcode syntax error\" )\n  FT_ERRORDEF_( Stack_Underflow,                             0xA1, \\\n                \"argument stack underflow\" )\n  FT_ERRORDEF_( Ignore,                                      0xA2, \\\n                \"ignore\" )\n\n  /* BDF errors */\n\n  FT_ERRORDEF_( Missing_Startfont_Field,                     0xB0, \\\n                \"`STARTFONT' field missing\" )\n  FT_ERRORDEF_( Missing_Font_Field,                          0xB1, \\\n                \"`FONT' field missing\" )\n  FT_ERRORDEF_( Missing_Size_Field,                          0xB2, \\\n                \"`SIZE' field missing\" )\n  FT_ERRORDEF_( Missing_Chars_Field,                         0xB3, \\\n                \"`CHARS' field missing\" )\n  FT_ERRORDEF_( Missing_Startchar_Field,                     0xB4, \\\n                \"`STARTCHAR' field missing\" )\n  FT_ERRORDEF_( Missing_Encoding_Field,                      0xB5, \\\n                \"`ENCODING' field missing\" )\n  FT_ERRORDEF_( Missing_Bbx_Field,                           0xB6, \\\n                \"`BBX' field missing\" )\n  FT_ERRORDEF_( Bbx_Too_Big,                                 0xB7, \\\n                \"`BBX' too big\" )\n  FT_ERRORDEF_( Corrupted_Font_Header,                       0xB8, \\\n                \"Font header corrupted or missing fields\" )\n  FT_ERRORDEF_( Corrupted_Font_Glyphs,                       0xB9, \\\n                \"Font glyphs corrupted or missing fields\" )\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/fterrors.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fterrors.h                                                             */\n/*                                                                         */\n/*    FreeType error code handling (specification).                        */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2007 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This special header file is used to define the handling of FT2        */\n  /* enumeration constants.  It can also be used to generate error message */\n  /* strings with a small macro trick explained below.                     */\n  /*                                                                       */\n  /* I - Error Formats                                                     */\n  /* -----------------                                                     */\n  /*                                                                       */\n  /*   The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be   */\n  /*   defined in ftoption.h in order to make the higher byte indicate     */\n  /*   the module where the error has happened (this is not compatible     */\n  /*   with standard builds of FreeType 2).  You can then use the macro    */\n  /*   FT_ERROR_BASE macro to extract the generic error code from an       */\n  /*   FT_Error value.                                                     */\n  /*                                                                       */\n  /*                                                                       */\n  /* II - Error Message strings                                            */\n  /* --------------------------                                            */\n  /*                                                                       */\n  /*   The error definitions below are made through special macros that    */\n  /*   allow client applications to build a table of error message strings */\n  /*   if they need it.  The strings are not included in a normal build of */\n  /*   FreeType 2 to save space (most client applications do not use       */\n  /*   them).                                                              */\n  /*                                                                       */\n  /*   To do so, you have to define the following macros before including  */\n  /*   this file:                                                          */\n  /*                                                                       */\n  /*   FT_ERROR_START_LIST ::                                              */\n  /*     This macro is called before anything else to define the start of  */\n  /*     the error list.  It is followed by several FT_ERROR_DEF calls     */\n  /*     (see below).                                                      */\n  /*                                                                       */\n  /*   FT_ERROR_DEF( e, v, s ) ::                                          */\n  /*     This macro is called to define one single error.                  */\n  /*     `e' is the error code identifier (e.g. FT_Err_Invalid_Argument).  */\n  /*     `v' is the error numerical value.                                 */\n  /*     `s' is the corresponding error string.                            */\n  /*                                                                       */\n  /*   FT_ERROR_END_LIST ::                                                */\n  /*     This macro ends the list.                                         */\n  /*                                                                       */\n  /*   Additionally, you have to undefine __FTERRORS_H__ before #including */\n  /*   this file.                                                          */\n  /*                                                                       */\n  /*   Here is a simple example:                                           */\n  /*                                                                       */\n  /*     {                                                                 */\n  /*       #undef __FTERRORS_H__                                           */\n  /*       #define FT_ERRORDEF( e, v, s )  { e, s },                       */\n  /*       #define FT_ERROR_START_LIST     {                               */\n  /*       #define FT_ERROR_END_LIST       { 0, 0 } };                     */\n  /*                                                                       */\n  /*       const struct                                                    */\n  /*       {                                                               */\n  /*         int          err_code;                                        */\n  /*         const char*  err_msg;                                         */\n  /*       } ft_errors[] =                                                 */\n  /*                                                                       */\n  /*       #include FT_ERRORS_H                                            */\n  /*     }                                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTERRORS_H__\n#define __FTERRORS_H__\n\n\n  /* include module base error codes */\n#include FT_MODULE_ERRORS_H\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n#undef  FT_ERR_XCAT\n#undef  FT_ERR_CAT\n\n#define FT_ERR_XCAT( x, y )  x ## y\n#define FT_ERR_CAT( x, y )   FT_ERR_XCAT( x, y )\n\n\n  /* FT_ERR_PREFIX is used as a prefix for error identifiers. */\n  /* By default, we use `FT_Err_'.                            */\n  /*                                                          */\n#ifndef FT_ERR_PREFIX\n#define FT_ERR_PREFIX  FT_Err_\n#endif\n\n\n  /* FT_ERR_BASE is used as the base for module-specific errors. */\n  /*                                                             */\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n\n#ifndef FT_ERR_BASE\n#define FT_ERR_BASE  FT_Mod_Err_Base\n#endif\n\n#else\n\n#undef FT_ERR_BASE\n#define FT_ERR_BASE  0\n\n#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */\n\n\n  /* If FT_ERRORDEF is not defined, we need to define a simple */\n  /* enumeration type.                                         */\n  /*                                                           */\n#ifndef FT_ERRORDEF\n\n#define FT_ERRORDEF( e, v, s )  e = v,\n#define FT_ERROR_START_LIST     enum {\n#define FT_ERROR_END_LIST       FT_ERR_CAT( FT_ERR_PREFIX, Max ) };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_ERRORDEF */\n\n\n  /* this macro is used to define an error */\n#define FT_ERRORDEF_( e, v, s )   \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )\n\n  /* this is only used for <module>_Err_Ok, which must be 0! */\n#define FT_NOERRORDEF_( e, v, s ) \\\n          FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )\n\n\n#ifdef FT_ERROR_START_LIST\n  FT_ERROR_START_LIST\n#endif\n\n\n  /* now include the error codes */\n#include FT_ERROR_DEFINITIONS_H\n\n\n#ifdef FT_ERROR_END_LIST\n  FT_ERROR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      SIMPLE CLEANUP                     *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_ERROR_START_LIST\n#undef FT_ERROR_END_LIST\n\n#undef FT_ERRORDEF\n#undef FT_ERRORDEF_\n#undef FT_NOERRORDEF_\n\n#undef FT_NEED_EXTERN_C\n#undef FT_ERR_CONCAT\n#undef FT_ERR_BASE\n\n  /* FT_KEEP_ERR_PREFIX is needed for ftvalid.h */\n#ifndef FT_KEEP_ERR_PREFIX\n#undef FT_ERR_PREFIX\n#endif\n\n#endif /* __FTERRORS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftgasp.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgasp.h                                                               */\n/*                                                                         */\n/*    Access of TrueType's `gasp' table (specification).                   */\n/*                                                                         */\n/*  Copyright 2007 by                                                      */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef _FT_GASP_H_\n#define _FT_GASP_H_\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n  /***************************************************************************\n   *\n   * @section:\n   *   gasp_table\n   *\n   * @title:\n   *   Gasp Table\n   *\n   * @abstract:\n   *   Retrieving TrueType `gasp' table entries\n   *\n   * @description:\n   *   The function @FT_Get_Gasp can be used to query a TrueType or OpenType\n   *   font for specific entries in their `gasp' table, if any.  This is\n   *   mainly useful when implementing native TrueType hinting with the\n   *   bytecode interpreter to duplicate the Windows text rendering results.\n   */\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_GASP_XXX\n   *\n   * @description:\n   *   A list of values and/or bit-flags returned by the @FT_Get_Gasp\n   *   function.\n   *\n   * @values:\n   *   FT_GASP_NO_TABLE ::\n   *     This special value means that there is no GASP table in this face.\n   *     It is up to the client to decide what to do.\n   *\n   *   FT_GASP_DO_GRIDFIT ::\n   *     Grid-fitting and hinting should be performed at the specified ppem.\n   *     This *really* means TrueType bytecode interpretation.\n   *\n   *   FT_GASP_DO_GRAY ::\n   *     Anti-aliased rendering should be performed at the specified ppem.\n   *\n   *   FT_GASP_SYMMETRIC_SMOOTHING ::\n   *     Smoothing along multiple axes must be used with ClearType.\n   *\n   *   FT_GASP_SYMMETRIC_GRIDFIT ::\n   *     Grid-fitting must be used with ClearType's symmetric smoothing.\n   *\n   * @note:\n   *   `ClearType' is Microsoft's implementation of LCD rendering, partly\n   *   protected by patents.\n   *\n   * @since:\n   *   2.3.0\n   */\n#define FT_GASP_NO_TABLE               -1\n#define FT_GASP_DO_GRIDFIT           0x01\n#define FT_GASP_DO_GRAY              0x02\n#define FT_GASP_SYMMETRIC_SMOOTHING  0x08\n#define FT_GASP_SYMMETRIC_GRIDFIT    0x10\n\n\n  /*************************************************************************\n   *\n   * @func:\n   *   FT_Get_Gasp\n   *\n   * @description:\n   *   Read the `gasp' table from a TrueType or OpenType font file and\n   *   return the entry corresponding to a given character pixel size.\n   *\n   * @input:\n   *   face :: The source face handle.\n   *   ppem :: The vertical character pixel size.\n   *\n   * @return:\n   *   Bit flags (see @FT_GASP_XXX), or @FT_GASP_NO_TABLE is there is no\n   *   `gasp' table in the face.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Int )\n  FT_Get_Gasp( FT_Face  face,\n               FT_UInt  ppem );\n\n/* */\n\n#endif /* _FT_GASP_H_ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftglyph.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftglyph.h                                                              */\n/*                                                                         */\n/*    FreeType convenience functions to handle glyphs (specification).     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file contains the definition of several convenience functions    */\n  /* that can be used by client applications to easily retrieve glyph      */\n  /* bitmaps and outlines from a given face.                               */\n  /*                                                                       */\n  /* These functions should be optional if you are writing a font server   */\n  /* or text layout engine on top of FreeType.  However, they are pretty   */\n  /* handy for many other simple uses of the library.                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTGLYPH_H__\n#define __FTGLYPH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    glyph_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Glyph Management                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Generic interface to manage individual glyph data.                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains definitions used to manage glyph data        */\n  /*    through generic FT_Glyph objects.  Each of them can contain a      */\n  /*    bitmap, a vector outline, or even images in other formats.         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* forward declaration to a private type */\n  typedef struct FT_Glyph_Class_  FT_Glyph_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Glyph                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Handle to an object used to model generic glyph images.  It is a   */\n  /*    pointer to the @FT_GlyphRec structure and can contain a glyph      */\n  /*    bitmap or pointer.                                                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Glyph objects are not owned by the library.  You must thus release */\n  /*    them manually (through @FT_Done_Glyph) _before_ calling            */\n  /*    @FT_Done_FreeType.                                                 */\n  /*                                                                       */\n  typedef struct FT_GlyphRec_*  FT_Glyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_GlyphRec                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The root glyph structure contains a given glyph image plus its     */\n  /*    advance width in 16.16 fixed float format.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    library :: A handle to the FreeType library object.                */\n  /*                                                                       */\n  /*    clazz   :: A pointer to the glyph's class.  Private.               */\n  /*                                                                       */\n  /*    format  :: The format of the glyph's image.                        */\n  /*                                                                       */\n  /*    advance :: A 16.16 vector that gives the glyph's advance width.    */\n  /*                                                                       */\n  typedef struct  FT_GlyphRec_\n  {\n    FT_Library             library;\n    const FT_Glyph_Class*  clazz;\n    FT_Glyph_Format        format;\n    FT_Vector              advance;\n\n  } FT_GlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_BitmapGlyph                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model a bitmap glyph image.  This is */\n  /*    a sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.     */\n  /*                                                                       */\n  typedef struct FT_BitmapGlyphRec_*  FT_BitmapGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BitmapGlyphRec                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for bitmap glyph images.  This really is a        */\n  /*    `sub-class' of @FT_GlyphRec.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root   :: The root @FT_Glyph fields.                               */\n  /*                                                                       */\n  /*    left   :: The left-side bearing, i.e., the horizontal distance     */\n  /*              from the current pen position to the left border of the  */\n  /*              glyph bitmap.                                            */\n  /*                                                                       */\n  /*    top    :: The top-side bearing, i.e., the vertical distance from   */\n  /*              the current pen position to the top border of the glyph  */\n  /*              bitmap.  This distance is positive for upwards-y!        */\n  /*                                                                       */\n  /*    bitmap :: A descriptor for the bitmap.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast an @FT_Glyph to @FT_BitmapGlyph if you have       */\n  /*    `glyph->format == FT_GLYPH_FORMAT_BITMAP'.  This lets you access   */\n  /*    the bitmap's contents easily.                                      */\n  /*                                                                       */\n  /*    The corresponding pixel buffer is always owned by @FT_BitmapGlyph  */\n  /*    and is thus created and destroyed with it.                         */\n  /*                                                                       */\n  typedef struct  FT_BitmapGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Int       left;\n    FT_Int       top;\n    FT_Bitmap    bitmap;\n\n  } FT_BitmapGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_OutlineGlyph                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to an object used to model an outline glyph image.  This  */\n  /*    is a sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec. */\n  /*                                                                       */\n  typedef struct FT_OutlineGlyphRec_*  FT_OutlineGlyph;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_OutlineGlyphRec                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used for outline (vectorial) glyph images.  This       */\n  /*    really is a `sub-class' of @FT_GlyphRec.                           */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root    :: The root @FT_Glyph fields.                              */\n  /*                                                                       */\n  /*    outline :: A descriptor for the outline.                           */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can typecast a @FT_Glyph to @FT_OutlineGlyph if you have       */\n  /*    `glyph->format == FT_GLYPH_FORMAT_OUTLINE'.  This lets you access  */\n  /*    the outline's content easily.                                      */\n  /*                                                                       */\n  /*    As the outline is extracted from a glyph slot, its coordinates are */\n  /*    expressed normally in 26.6 pixels, unless the flag                 */\n  /*    @FT_LOAD_NO_SCALE was used in @FT_Load_Glyph() or @FT_Load_Char(). */\n  /*                                                                       */\n  /*    The outline's tables are always owned by the object and are        */\n  /*    destroyed with it.                                                 */\n  /*                                                                       */\n  typedef struct  FT_OutlineGlyphRec_\n  {\n    FT_GlyphRec  root;\n    FT_Outline   outline;\n\n  } FT_OutlineGlyphRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Glyph                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to extract a glyph image from a slot.              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    slot   :: A handle to the source glyph slot.                       */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aglyph :: A handle to the glyph object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Glyph( FT_GlyphSlot  slot,\n                FT_Glyph     *aglyph );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Copy                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to copy a glyph image.  Note that the created      */\n  /*    @FT_Glyph object must be released with @FT_Done_Glyph.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source glyph object.                     */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target glyph object.  0 in case of       */\n  /*              error.                                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Copy( FT_Glyph   source,\n                 FT_Glyph  *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Transform                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Transforms a glyph image if its format is scalable.                */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    glyph  :: A handle to the target glyph object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix :: A pointer to a 2x2 matrix to apply.                      */\n  /*                                                                       */\n  /*    delta  :: A pointer to a 2d vector to apply.  Coordinates are      */\n  /*              expressed in 1/64th of a pixel.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code (if not 0, the glyph format is not scalable).  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The 2x2 transformation matrix is also applied to the glyph's       */\n  /*    advance vector.                                                    */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Transform( FT_Glyph    glyph,\n                      FT_Matrix*  matrix,\n                      FT_Vector*  delta );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_BBox_Mode                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The mode how the values of @FT_Glyph_Get_CBox are returned.        */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_BBOX_UNSCALED ::                                          */\n  /*      Return unscaled font units.                                      */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_SUBPIXELS ::                                         */\n  /*      Return unfitted 26.6 coordinates.                                */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_GRIDFIT ::                                           */\n  /*      Return grid-fitted 26.6 coordinates.                             */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_TRUNCATE ::                                          */\n  /*      Return coordinates in integer pixels.                            */\n  /*                                                                       */\n  /*    FT_GLYPH_BBOX_PIXELS ::                                            */\n  /*      Return grid-fitted pixel coordinates.                            */\n  /*                                                                       */\n  typedef enum  FT_Glyph_BBox_Mode_\n  {\n    FT_GLYPH_BBOX_UNSCALED  = 0,\n    FT_GLYPH_BBOX_SUBPIXELS = 0,\n    FT_GLYPH_BBOX_GRIDFIT   = 1,\n    FT_GLYPH_BBOX_TRUNCATE  = 2,\n    FT_GLYPH_BBOX_PIXELS    = 3\n\n  } FT_Glyph_BBox_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_bbox_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    These constants are deprecated.  Use the corresponding             */\n  /*    @FT_Glyph_BBox_Mode values instead.                                */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*   ft_glyph_bbox_unscaled  :: See @FT_GLYPH_BBOX_UNSCALED.             */\n  /*   ft_glyph_bbox_subpixels :: See @FT_GLYPH_BBOX_SUBPIXELS.            */\n  /*   ft_glyph_bbox_gridfit   :: See @FT_GLYPH_BBOX_GRIDFIT.              */\n  /*   ft_glyph_bbox_truncate  :: See @FT_GLYPH_BBOX_TRUNCATE.             */\n  /*   ft_glyph_bbox_pixels    :: See @FT_GLYPH_BBOX_PIXELS.               */\n  /*                                                                       */\n#define ft_glyph_bbox_unscaled   FT_GLYPH_BBOX_UNSCALED\n#define ft_glyph_bbox_subpixels  FT_GLYPH_BBOX_SUBPIXELS\n#define ft_glyph_bbox_gridfit    FT_GLYPH_BBOX_GRIDFIT\n#define ft_glyph_bbox_truncate   FT_GLYPH_BBOX_TRUNCATE\n#define ft_glyph_bbox_pixels     FT_GLYPH_BBOX_PIXELS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_Get_CBox                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a glyph's `control box'.  The control box encloses all the  */\n  /*    outline's points, including Bézier control points.  Though it      */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the source glyph object.                      */\n  /*                                                                       */\n  /*    mode  :: The mode which indicates how to interpret the returned    */\n  /*             bounding box values.                                      */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox :: The glyph coordinate bounding box.  Coordinates are       */\n  /*             expressed in 1/64th of pixels if it is grid-fitted.       */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Coordinates are relative to the glyph origin, using the Y-upwards  */\n  /*    convention.                                                        */\n  /*                                                                       */\n  /*    If the glyph has been loaded with @FT_LOAD_NO_SCALE, `bbox_mode'   */\n  /*    must be set to @FT_GLYPH_BBOX_UNSCALED to get unscaled font        */\n  /*    units in 26.6 pixel format.  The value @FT_GLYPH_BBOX_SUBPIXELS    */\n  /*    is another name for this constant.                                 */\n  /*                                                                       */\n  /*    Note that the maximum coordinates are exclusive, which means that  */\n  /*    one can compute the width and height of the glyph image (be it in  */\n  /*    integer or 26.6 pixels) as:                                        */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      width  = bbox.xMax - bbox.xMin;                                  */\n  /*      height = bbox.yMax - bbox.yMin;                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Note also that for 26.6 coordinates, if `bbox_mode' is set to      */\n  /*    @FT_GLYPH_BBOX_GRIDFIT, the coordinates will also be grid-fitted,  */\n  /*    which corresponds to:                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      bbox.xMin = FLOOR(bbox.xMin);                                    */\n  /*      bbox.yMin = FLOOR(bbox.yMin);                                    */\n  /*      bbox.xMax = CEILING(bbox.xMax);                                  */\n  /*      bbox.yMax = CEILING(bbox.yMax);                                  */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    To get the bbox in pixel coordinates, set `bbox_mode' to           */\n  /*    @FT_GLYPH_BBOX_TRUNCATE.                                           */\n  /*                                                                       */\n  /*    To get the bbox in grid-fitted pixel coordinates, set `bbox_mode'  */\n  /*    to @FT_GLYPH_BBOX_PIXELS.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Glyph_Get_CBox( FT_Glyph  glyph,\n                     FT_UInt   bbox_mode,\n                     FT_BBox  *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Glyph_To_Bitmap                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Converts a given glyph object to a bitmap glyph object.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    the_glyph   :: A pointer to a handle to the target glyph.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    render_mode :: An enumeration that describe how the data is        */\n  /*                   rendered.                                           */\n  /*                                                                       */\n  /*    origin      :: A pointer to a vector used to translate the glyph   */\n  /*                   image before rendering.  Can be 0 (if no            */\n  /*                   translation).  The origin is expressed in           */\n  /*                   26.6 pixels.                                        */\n  /*                                                                       */\n  /*    destroy     :: A boolean that indicates that the original glyph    */\n  /*                   image should be destroyed by this function.  It is  */\n  /*                   never destroyed in case of error.                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The glyph image is translated with the `origin' vector before      */\n  /*    rendering.                                                         */\n  /*                                                                       */\n  /*    The first parameter is a pointer to an @FT_Glyph handle, that will */\n  /*    be replaced by this function.  Typically, you would use (omitting  */\n  /*    error handling):                                                   */\n  /*                                                                       */\n  /*                                                                       */\n  /*      {                                                                */\n  /*        FT_Glyph        glyph;                                         */\n  /*        FT_BitmapGlyph  glyph_bitmap;                                  */\n  /*                                                                       */\n  /*                                                                       */\n  /*        // load glyph                                                  */\n  /*        error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT );     */\n  /*                                                                       */\n  /*        // extract glyph image                                         */\n  /*        error = FT_Get_Glyph( face->glyph, &glyph );                   */\n  /*                                                                       */\n  /*        // convert to a bitmap (default render mode + destroy old)     */\n  /*        if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )                 */\n  /*        {                                                              */\n  /*          error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_DEFAULT,  */\n  /*                                      0, 1 );                          */\n  /*          if ( error ) // glyph unchanged                              */\n  /*            ...                                                        */\n  /*        }                                                              */\n  /*                                                                       */\n  /*        // access bitmap content by typecasting                        */\n  /*        glyph_bitmap = (FT_BitmapGlyph)glyph;                          */\n  /*                                                                       */\n  /*        // do funny stuff with it, like blitting/drawing               */\n  /*        ...                                                            */\n  /*                                                                       */\n  /*        // discard glyph image (bitmap or not)                         */\n  /*        FT_Done_Glyph( glyph );                                        */\n  /*      }                                                                */\n  /*                                                                       */\n  /*                                                                       */\n  /*    This function does nothing if the glyph format isn't scalable.     */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_To_Bitmap( FT_Glyph*       the_glyph,\n                      FT_Render_Mode  render_mode,\n                      FT_Vector*      origin,\n                      FT_Bool         destroy );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Glyph                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys a given glyph.                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    glyph :: A handle to the target glyph object.                      */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Done_Glyph( FT_Glyph  glyph );\n\n  /* */\n\n\n  /* other helpful functions */\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    computations                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Multiply                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Performs the matrix operation `b = a*b'.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    a :: A pointer to matrix `a'.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    b :: A pointer to matrix `b'.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The result is undefined if either `a' or `b' is zero.              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Matrix_Multiply( const FT_Matrix*  a,\n                      FT_Matrix*  b );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Matrix_Invert                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Inverts a 2x2 matrix.  Returns an error if it can't be inverted.   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    matrix :: A pointer to the target matrix.  Remains untouched in    */\n  /*              case of error.                                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Matrix_Invert( FT_Matrix*  matrix );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGLYPH_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftgxval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgxval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006 by                                          */\n/*  Masatake YAMATO, Redhat K.K,                                           */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n/***************************************************************************/\n/*                                                                         */\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\n/* Development of gxlayout is supported by the Information-technology      */\n/* Promotion Agency(IPA), Japan.                                           */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGXVAL_H__\n#define __FTGXVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gx_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueTypeGX/AAT Validation                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate TrueTypeGX/AAT tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some TrueTypeGX tables (feat, mort, morx, bsln, just, kern, opbd,  */\n  /*    trak, prop, lcar).                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                                                                       */\n  /* Warning: Use FT_VALIDATE_XXX to validate a table.                     */\n  /*          Following definitions are for gxvalid developers.            */\n  /*                                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n#define FT_VALIDATE_feat_INDEX     0\n#define FT_VALIDATE_mort_INDEX     1\n#define FT_VALIDATE_morx_INDEX     2\n#define FT_VALIDATE_bsln_INDEX     3\n#define FT_VALIDATE_just_INDEX     4\n#define FT_VALIDATE_kern_INDEX     5\n#define FT_VALIDATE_opbd_INDEX     6\n#define FT_VALIDATE_trak_INDEX     7\n#define FT_VALIDATE_prop_INDEX     8\n#define FT_VALIDATE_lcar_INDEX     9\n#define FT_VALIDATE_GX_LAST_INDEX  FT_VALIDATE_lcar_INDEX\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_VALIDATE_GX_LENGTH\n   *\n   * @description:\n   *   The number of tables checked in this module.  Use it as a parameter\n   *   for the `table-length' argument of function @FT_TrueTypeGX_Validate.\n   */\n#define FT_VALIDATE_GX_LENGTH     (FT_VALIDATE_GX_LAST_INDEX + 1)\n\n  /* */\n\n  /* Up to 0x1000 is used by otvalid.\n     Ox2xxx is reserved for feature OT extension. */\n#define FT_VALIDATE_GX_START 0x4000\n#define FT_VALIDATE_GX_BITFIELD( tag )                  \\\n  ( FT_VALIDATE_GX_START << FT_VALIDATE_##tag##_INDEX )\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_GXXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_TrueTypeGX_Validate to\n  *    indicate which TrueTypeGX/AAT Type tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_feat ::\n  *      Validate `feat' table.\n  *\n  *    FT_VALIDATE_mort ::\n  *      Validate `mort' table.\n  *\n  *    FT_VALIDATE_morx ::\n  *      Validate `morx' table.\n  *\n  *    FT_VALIDATE_bsln ::\n  *      Validate `bsln' table.\n  *\n  *    FT_VALIDATE_just ::\n  *      Validate `just' table.\n  *\n  *    FT_VALIDATE_kern ::\n  *      Validate `kern' table.\n  *\n  *    FT_VALIDATE_opbd ::\n  *      Validate `opbd' table.\n  *\n  *    FT_VALIDATE_trak ::\n  *      Validate `trak' table.\n  *\n  *    FT_VALIDATE_prop ::\n  *      Validate `prop' table.\n  *\n  *    FT_VALIDATE_lcar ::\n  *      Validate `lcar' table.\n  *\n  *    FT_VALIDATE_GX ::\n  *      Validate all TrueTypeGX tables (feat, mort, morx, bsln, just, kern,\n  *      opbd, trak, prop and lcar).\n  *\n  */\n\n#define FT_VALIDATE_feat  FT_VALIDATE_GX_BITFIELD( feat )\n#define FT_VALIDATE_mort  FT_VALIDATE_GX_BITFIELD( mort )\n#define FT_VALIDATE_morx  FT_VALIDATE_GX_BITFIELD( morx )\n#define FT_VALIDATE_bsln  FT_VALIDATE_GX_BITFIELD( bsln )\n#define FT_VALIDATE_just  FT_VALIDATE_GX_BITFIELD( just )\n#define FT_VALIDATE_kern  FT_VALIDATE_GX_BITFIELD( kern )\n#define FT_VALIDATE_opbd  FT_VALIDATE_GX_BITFIELD( opbd )\n#define FT_VALIDATE_trak  FT_VALIDATE_GX_BITFIELD( trak )\n#define FT_VALIDATE_prop  FT_VALIDATE_GX_BITFIELD( prop )\n#define FT_VALIDATE_lcar  FT_VALIDATE_GX_BITFIELD( lcar )\n\n#define FT_VALIDATE_GX  ( FT_VALIDATE_feat | \\\n                          FT_VALIDATE_mort | \\\n                          FT_VALIDATE_morx | \\\n                          FT_VALIDATE_bsln | \\\n                          FT_VALIDATE_just | \\\n                          FT_VALIDATE_kern | \\\n                          FT_VALIDATE_opbd | \\\n                          FT_VALIDATE_trak | \\\n                          FT_VALIDATE_prop | \\\n                          FT_VALIDATE_lcar )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Validate\n  *\n  * @description:\n  *    Validate various TrueTypeGX tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_GXXXX for possible values.\n  *\n  *    table_length ::\n  *       The size of the `tables' array.  Normally, @FT_VALIDATE_GX_LENGTH\n  *       should be passed.\n  *\n  * @output:\n  *    tables ::\n  *       The array where all validated sfnt tables are stored.\n  *       The array itself must be allocated by a client.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   This function only works with TrueTypeGX fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the buffers pointed to by\n  *   each `tables' element, by calling @FT_TrueTypeGX_Free.  A NULL value\n  *   indicates that the table either doesn't exist in the font, the\n  *   application hasn't asked for validation, or the validator doesn't have\n  *   the ability to validate the sfnt table.\n  */\n  FT_EXPORT( FT_Error )\n  FT_TrueTypeGX_Validate( FT_Face   face,\n                          FT_UInt   validation_flags,\n                          FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\n                          FT_UInt   table_length );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_TrueTypeGX_Free\n  *\n  * @description:\n  *    Free the buffer allocated by TrueTypeGX validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer allocated by\n  *       @FT_TrueTypeGX_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_TrueTypeGX_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_TrueTypeGX_Free( FT_Face   face,\n                      FT_Bytes  table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_CKERNXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_ClassicKern_Validate\n  *    to indicate the classic kern dialect or dialects.  If the selected\n  *    type doesn't fit, @FT_ClassicKern_Validate regards the table as\n  *    invalid.\n  *\n  * @values:\n  *    FT_VALIDATE_MS ::\n  *      Handle the `kern' table as a classic Microsoft kern table.\n  *\n  *    FT_VALIDATE_APPLE ::\n  *      Handle the `kern' table as a classic Apple kern table.\n  *\n  *    FT_VALIDATE_CKERN ::\n  *      Handle the `kern' as either classic Apple or Microsoft kern table.\n  */\n#define FT_VALIDATE_MS     ( FT_VALIDATE_GX_START << 0 )\n#define FT_VALIDATE_APPLE  ( FT_VALIDATE_GX_START << 1 )\n\n#define FT_VALIDATE_CKERN  ( FT_VALIDATE_MS | FT_VALIDATE_APPLE )\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Validate\n  *\n  * @description:\n  *    Validate classic (16bit format) kern table to assure that the offsets\n  *    and indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without error\n  *    checking (which can be quite time consuming).\n  *\n  *    The `kern' table validator in @FT_TrueTypeGX_Validate deals with both\n  *    the new 32bit format and the classic 16bit format, while\n  *    FT_ClassicKern_Validate only supports the classic 16bit format.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the dialect to be validated.  See\n  *       @FT_VALIDATE_CKERNXXX for possible values.\n  *\n  * @output:\n  *    ckern_table ::\n  *       A pointer to the kern table.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   After use, the application should deallocate the buffers pointed to by\n  *   `ckern_table', by calling @FT_ClassicKern_Free.  A NULL value\n  *   indicates that the table doesn't exist in the font.\n  */\n  FT_EXPORT( FT_Error )\n  FT_ClassicKern_Validate( FT_Face    face,\n                           FT_UInt    validation_flags,\n                           FT_Bytes  *ckern_table );\n\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_ClassicKern_Free\n  *\n  * @description:\n  *    Free the buffer allocated by classic Kern validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_ClassicKern_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_ClassicKern_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_ClassicKern_Free( FT_Face   face,\n                       FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGXVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftgzip.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftgzip.h                                                               */\n/*                                                                         */\n/*    Gzip-compressed stream support.                                      */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTGZIP_H__\n#define __FTGZIP_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    gzip                                                               */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    GZIP Streams                                                       */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using gzip-compressed font files.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Gzip-specific functions.  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenGzip\n  *\n  * @description:\n  *   Open a new stream to parse gzip-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.gz' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream ::\n  *     The target embedding stream.\n  *\n  *   source ::\n  *     The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream.\n  *\n  *   In certain builds of the library, gzip compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a gzipped stream from\n  *   it and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with zlib support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenGzip( FT_Stream  stream,\n                      FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTGZIP_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftimage.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftimage.h                                                              */\n/*                                                                         */\n/*    FreeType glyph image formats and default raster interface            */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Note: A `raster' is simply a scan-line converter, used to render      */\n  /*       FT_Outlines into FT_Bitmaps.                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTIMAGE_H__\n#define __FTIMAGE_H__\n\n\n/* _STANDALONE_ is from ftgrays.c */\n#ifndef _STANDALONE_\n#include <ft2build.h>\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pos                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The type FT_Pos is a 32-bit integer used to store vectorial        */\n  /*    coordinates.  Depending on the context, these can represent        */\n  /*    distances in integer font units, or 16,16, or 26.6 fixed float     */\n  /*    pixel coordinates.                                                 */\n  /*                                                                       */\n  typedef signed long  FT_Pos;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Vector                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector; coordinates are of   */\n  /*    the FT_Pos type.                                                   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: The horizontal coordinate.                                    */\n  /*    y :: The vertical coordinate.                                      */\n  /*                                                                       */\n  typedef struct  FT_Vector_\n  {\n    FT_Pos  x;\n    FT_Pos  y;\n\n  } FT_Vector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_BBox                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold an outline's bounding box, i.e., the      */\n  /*    coordinates of its extrema in the horizontal and vertical          */\n  /*    directions.                                                        */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xMin :: The horizontal minimum (left-most).                        */\n  /*                                                                       */\n  /*    yMin :: The vertical minimum (bottom-most).                        */\n  /*                                                                       */\n  /*    xMax :: The horizontal maximum (right-most).                       */\n  /*                                                                       */\n  /*    yMax :: The vertical maximum (top-most).                           */\n  /*                                                                       */\n  typedef struct  FT_BBox_\n  {\n    FT_Pos  xMin, yMin;\n    FT_Pos  xMax, yMax;\n\n  } FT_BBox;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Pixel_Mode                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of pixels in a     */\n  /*    given bitmap.  Note that additional formats may be added in the    */\n  /*    future.                                                            */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_PIXEL_MODE_NONE ::                                              */\n  /*      Value 0 is reserved.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_MONO ::                                              */\n  /*      A monochrome bitmap, using 1 bit per pixel.  Note that pixels    */\n  /*      are stored in most-significant order (MSB), which means that     */\n  /*      the left-most pixel in a byte has value 128.                     */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY ::                                              */\n  /*      An 8-bit bitmap, generally used to represent anti-aliased glyph  */\n  /*      images.  Each pixel is stored in one byte.  Note that the number */\n  /*      of value `gray' levels is stored in the `num_bytes' field of     */\n  /*      the @FT_Bitmap structure (it generally is 256).                  */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY2 ::                                             */\n  /*      A 2-bit/pixel bitmap, used to represent embedded anti-aliased    */\n  /*      bitmaps in font files according to the OpenType specification.   */\n  /*      We haven't found a single font using this format, however.       */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_GRAY4 ::                                             */\n  /*      A 4-bit/pixel bitmap, used to represent embedded anti-aliased    */\n  /*      bitmaps in font files according to the OpenType specification.   */\n  /*      We haven't found a single font using this format, however.       */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD ::                                               */\n  /*      An 8-bit bitmap, used to represent RGB or BGR decimated glyph    */\n  /*      images used for display on LCD displays; the bitmap is three     */\n  /*      times wider than the original glyph image.  See also             */\n  /*      @FT_RENDER_MODE_LCD.                                             */\n  /*                                                                       */\n  /*    FT_PIXEL_MODE_LCD_V ::                                             */\n  /*      An 8-bit bitmap, used to represent RGB or BGR decimated glyph    */\n  /*      images used for display on rotated LCD displays; the bitmap      */\n  /*      is three times taller than the original glyph image.  See also   */\n  /*      @FT_RENDER_MODE_LCD_V.                                           */\n  /*                                                                       */\n  typedef enum  FT_Pixel_Mode_\n  {\n    FT_PIXEL_MODE_NONE = 0,\n    FT_PIXEL_MODE_MONO,\n    FT_PIXEL_MODE_GRAY,\n    FT_PIXEL_MODE_GRAY2,\n    FT_PIXEL_MODE_GRAY4,\n    FT_PIXEL_MODE_LCD,\n    FT_PIXEL_MODE_LCD_V,\n\n    FT_PIXEL_MODE_MAX      /* do not remove */\n\n  } FT_Pixel_Mode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_pixel_mode_xxx                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Pixel_Mode values instead.                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_pixel_mode_none  :: See @FT_PIXEL_MODE_NONE.                    */\n  /*    ft_pixel_mode_mono  :: See @FT_PIXEL_MODE_MONO.                    */\n  /*    ft_pixel_mode_grays :: See @FT_PIXEL_MODE_GRAY.                    */\n  /*    ft_pixel_mode_pal2  :: See @FT_PIXEL_MODE_GRAY2.                   */\n  /*    ft_pixel_mode_pal4  :: See @FT_PIXEL_MODE_GRAY4.                   */\n  /*                                                                       */\n#define ft_pixel_mode_none   FT_PIXEL_MODE_NONE\n#define ft_pixel_mode_mono   FT_PIXEL_MODE_MONO\n#define ft_pixel_mode_grays  FT_PIXEL_MODE_GRAY\n#define ft_pixel_mode_pal2   FT_PIXEL_MODE_GRAY2\n#define ft_pixel_mode_pal4   FT_PIXEL_MODE_GRAY4\n\n /* */\n\n#if 0\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Palette_Mode                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT!                           */\n  /*                                                                       */\n  /*    An enumeration type to describe the format of a bitmap palette,    */\n  /*    used with ft_pixel_mode_pal4 and ft_pixel_mode_pal8.               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    ft_palette_mode_rgb  :: The palette is an array of 3-bytes RGB     */\n  /*                            records.                                   */\n  /*                                                                       */\n  /*    ft_palette_mode_rgba :: The palette is an array of 4-bytes RGBA    */\n  /*                            records.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    As ft_pixel_mode_pal2, pal4 and pal8 are currently unused by       */\n  /*    FreeType, these types are not handled by the library itself.       */\n  /*                                                                       */\n  typedef enum  FT_Palette_Mode_\n  {\n    ft_palette_mode_rgb = 0,\n    ft_palette_mode_rgba,\n\n    ft_palettte_mode_max   /* do not remove */\n\n  } FT_Palette_Mode;\n\n  /* */\n\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Bitmap                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to describe a bitmap or pixmap to the raster.     */\n  /*    Note that we now manage pixmaps of various depths through the      */\n  /*    `pixel_mode' field.                                                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    rows         :: The number of bitmap rows.                         */\n  /*                                                                       */\n  /*    width        :: The number of pixels in bitmap row.                */\n  /*                                                                       */\n  /*    pitch        :: The pitch's absolute value is the number of bytes  */\n  /*                    taken by one bitmap row, including padding.        */\n  /*                    However, the pitch is positive when the bitmap has */\n  /*                    a `down' flow, and negative when it has an `up'    */\n  /*                    flow.  In all cases, the pitch is an offset to add */\n  /*                    to a bitmap pointer in order to go down one row.   */\n  /*                                                                       */\n  /*    buffer       :: A typeless pointer to the bitmap buffer.  This     */\n  /*                    value should be aligned on 32-bit boundaries in    */\n  /*                    most cases.                                        */\n  /*                                                                       */\n  /*    num_grays    :: This field is only used with                       */\n  /*                    @FT_PIXEL_MODE_GRAY; it gives the number of gray   */\n  /*                    levels used in the bitmap.                         */\n  /*                                                                       */\n  /*    pixel_mode   :: The pixel mode, i.e., how pixel bits are stored.   */\n  /*                    See @FT_Pixel_Mode for possible values.            */\n  /*                                                                       */\n  /*    palette_mode :: This field is intended for paletted pixel modes;   */\n  /*                    it indicates how the palette is stored.  Not       */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /*    palette      :: A typeless pointer to the bitmap palette; this     */\n  /*                    field is intended for paletted pixel modes.  Not   */\n  /*                    used currently.                                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*   For now, the only pixel modes supported by FreeType are mono and    */\n  /*   grays.  However, drivers might be added in the future to support    */\n  /*   more `colorful' options.                                            */\n  /*                                                                       */\n  typedef struct  FT_Bitmap_\n  {\n    int             rows;\n    int             width;\n    int             pitch;\n    unsigned char*  buffer;\n    short           num_grays;\n    char            pixel_mode;\n    char            palette_mode;\n    void*           palette;\n\n  } FT_Bitmap;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This structure is used to describe an outline to the scan-line     */\n  /*    converter.                                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    n_contours :: The number of contours in the outline.               */\n  /*                                                                       */\n  /*    n_points   :: The number of points in the outline.                 */\n  /*                                                                       */\n  /*    points     :: A pointer to an array of `n_points' @FT_Vector       */\n  /*                  elements, giving the outline's point coordinates.    */\n  /*                                                                       */\n  /*    tags       :: A pointer to an array of `n_points' chars, giving    */\n  /*                  each outline point's type.  If bit 0 is unset, the   */\n  /*                  point is `off' the curve, i.e., a Bézier control     */\n  /*                  point, while it is `on' when set.                    */\n  /*                                                                       */\n  /*                  Bit 1 is meaningful for `off' points only.  If set,  */\n  /*                  it indicates a third-order Bézier arc control point; */\n  /*                  and a second-order control point if unset.           */\n  /*                                                                       */\n  /*    contours   :: An array of `n_contours' shorts, giving the end      */\n  /*                  point of each contour within the outline.  For       */\n  /*                  example, the first contour is defined by the points  */\n  /*                  `0' to `contours[0]', the second one is defined by   */\n  /*                  the points `contours[0]+1' to `contours[1]', etc.    */\n  /*                                                                       */\n  /*    flags      :: A set of bit flags used to characterize the outline  */\n  /*                  and give hints to the scan-converter and hinter on   */\n  /*                  how to convert/grid-fit it.  See @FT_OUTLINE_FLAGS.  */\n  /*                                                                       */\n  typedef struct  FT_Outline_\n  {\n    short       n_contours;      /* number of contours in glyph        */\n    short       n_points;        /* number of points in the glyph      */\n\n    FT_Vector*  points;          /* the outline's points               */\n    char*       tags;            /* the points flags                   */\n    short*      contours;        /* the contour end points             */\n\n    int         flags;           /* outline masks                      */\n\n  } FT_Outline;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*   FT_OUTLINE_FLAGS                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit-field constants use for the flags in an outline's    */\n  /*    `flags' field.                                                     */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_OUTLINE_NONE           :: Value 0 is reserved.                  */\n  /*                                                                       */\n  /*    FT_OUTLINE_OWNER          :: If set, this flag indicates that the  */\n  /*                                 outline's field arrays (i.e.,         */\n  /*                                 `points', `flags' & `contours') are   */\n  /*                                 `owned' by the outline object, and    */\n  /*                                 should thus be freed when it is       */\n  /*                                 destroyed.                            */\n  /*                                                                       */\n  /*   FT_OUTLINE_EVEN_ODD_FILL   :: By default, outlines are filled using */\n  /*                                 the non-zero winding rule.  If set to */\n  /*                                 1, the outline will be filled using   */\n  /*                                 the even-odd fill rule (only works    */\n  /*                                 with the smooth raster).              */\n  /*                                                                       */\n  /*   FT_OUTLINE_REVERSE_FILL    :: By default, outside contours of an    */\n  /*                                 outline are oriented in clock-wise    */\n  /*                                 direction, as defined in the TrueType */\n  /*                                 specification.  This flag is set if   */\n  /*                                 the outline uses the opposite         */\n  /*                                 direction (typically for Type 1       */\n  /*                                 fonts).  This flag is ignored by the  */\n  /*                                 scan-converter.                       */\n  /*                                                                       */\n  /*   FT_OUTLINE_IGNORE_DROPOUTS :: By default, the scan converter will   */\n  /*                                 try to detect drop-outs in an outline */\n  /*                                 and correct the glyph bitmap to       */\n  /*                                 ensure consistent shape continuity.   */\n  /*                                 If set, this flag hints the scan-line */\n  /*                                 converter to ignore such cases.       */\n  /*                                                                       */\n  /*   FT_OUTLINE_HIGH_PRECISION  :: This flag indicates that the          */\n  /*                                 scan-line converter should try to     */\n  /*                                 convert this outline to bitmaps with  */\n  /*                                 the highest possible quality.  It is  */\n  /*                                 typically set for small character     */\n  /*                                 sizes.  Note that this is only a      */\n  /*                                 hint, that might be completely        */\n  /*                                 ignored by a given scan-converter.    */\n  /*                                                                       */\n  /*   FT_OUTLINE_SINGLE_PASS     :: This flag is set to force a given     */\n  /*                                 scan-converter to only use a single   */\n  /*                                 pass over the outline to render a     */\n  /*                                 bitmap glyph image.  Normally, it is  */\n  /*                                 set for very large character sizes.   */\n  /*                                 It is only a hint, that might be      */\n  /*                                 completely ignored by a given         */\n  /*                                 scan-converter.                       */\n  /*                                                                       */\n#define FT_OUTLINE_NONE             0x0\n#define FT_OUTLINE_OWNER            0x1\n#define FT_OUTLINE_EVEN_ODD_FILL    0x2\n#define FT_OUTLINE_REVERSE_FILL     0x4\n#define FT_OUTLINE_IGNORE_DROPOUTS  0x8\n\n#define FT_OUTLINE_HIGH_PRECISION   0x100\n#define FT_OUTLINE_SINGLE_PASS      0x200\n\n\n /*************************************************************************\n  *\n  * @enum:\n  *   ft_outline_flags\n  *\n  * @description:\n  *   These constants are deprecated.  Please use the corresponding\n  *   @FT_OUTLINE_FLAGS values.\n  *\n  * @values:\n  *   ft_outline_none            :: See @FT_OUTLINE_NONE.\n  *   ft_outline_owner           :: See @FT_OUTLINE_OWNER.\n  *   ft_outline_even_odd_fill   :: See @FT_OUTLINE_EVEN_ODD_FILL.\n  *   ft_outline_reverse_fill    :: See @FT_OUTLINE_REVERSE_FILL.\n  *   ft_outline_ignore_dropouts :: See @FT_OUTLINE_IGNORE_DROPOUTS.\n  *   ft_outline_high_precision  :: See @FT_OUTLINE_HIGH_PRECISION.\n  *   ft_outline_single_pass     :: See @FT_OUTLINE_SINGLE_PASS.\n  */\n#define ft_outline_none             FT_OUTLINE_NONE\n#define ft_outline_owner            FT_OUTLINE_OWNER\n#define ft_outline_even_odd_fill    FT_OUTLINE_EVEN_ODD_FILL\n#define ft_outline_reverse_fill     FT_OUTLINE_REVERSE_FILL\n#define ft_outline_ignore_dropouts  FT_OUTLINE_IGNORE_DROPOUTS\n#define ft_outline_high_precision   FT_OUTLINE_HIGH_PRECISION\n#define ft_outline_single_pass      FT_OUTLINE_SINGLE_PASS\n\n  /* */\n\n#define FT_CURVE_TAG( flag )  ( flag & 3 )\n\n#define FT_CURVE_TAG_ON           1\n#define FT_CURVE_TAG_CONIC        0\n#define FT_CURVE_TAG_CUBIC        2\n\n#define FT_CURVE_TAG_TOUCH_X      8  /* reserved for the TrueType hinter */\n#define FT_CURVE_TAG_TOUCH_Y     16  /* reserved for the TrueType hinter */\n\n#define FT_CURVE_TAG_TOUCH_BOTH  ( FT_CURVE_TAG_TOUCH_X | \\\n                                   FT_CURVE_TAG_TOUCH_Y )\n\n#define  FT_Curve_Tag_On       FT_CURVE_TAG_ON\n#define  FT_Curve_Tag_Conic    FT_CURVE_TAG_CONIC\n#define  FT_Curve_Tag_Cubic    FT_CURVE_TAG_CUBIC\n#define  FT_Curve_Tag_Touch_X  FT_CURVE_TAG_TOUCH_X\n#define  FT_Curve_Tag_Touch_Y  FT_CURVE_TAG_TOUCH_Y\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_MoveToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `move  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `move to' is emitted to start a new contour in an outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `move to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0 means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_MoveToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define FT_Outline_MoveTo_Func  FT_Outline_MoveToFunc\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_LineToFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `line  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `line to' is emitted to indicate a segment in the outline.       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    to   :: A pointer to the target point of the `line to'.            */\n  /*                                                                       */\n  /*    user :: A typeless pointer which is passed from the caller of the  */\n  /*            decomposition function.                                    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0 means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_LineToFunc)( const FT_Vector*  to,\n                            void*             user );\n\n#define  FT_Outline_LineTo_Func  FT_Outline_LineToFunc\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_ConicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type use to describe the signature of a `conic  */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `conic to' is emitted to indicate a second-order Bézier arc in   */\n  /*    the outline.                                                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control :: An intermediate control point between the last position */\n  /*               and the new target in `to'.                             */\n  /*                                                                       */\n  /*    to      :: A pointer to the target end point of the conic arc.     */\n  /*                                                                       */\n  /*    user    :: A typeless pointer which is passed from the caller of   */\n  /*               the decomposition function.                             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0 means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_ConicToFunc)( const FT_Vector*  control,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define  FT_Outline_ConicTo_Func  FT_Outline_ConicToFunc\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Outline_CubicToFunc                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function pointer type used to describe the signature of a `cubic */\n  /*    to' function during outline walking/decomposition.                 */\n  /*                                                                       */\n  /*    A `cubic to' is emitted to indicate a third-order Bézier arc.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    control1 :: A pointer to the first Bézier control point.           */\n  /*                                                                       */\n  /*    control2 :: A pointer to the second Bézier control point.          */\n  /*                                                                       */\n  /*    to       :: A pointer to the target end point.                     */\n  /*                                                                       */\n  /*    user     :: A typeless pointer which is passed from the caller of  */\n  /*                the decomposition function.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0 means success.                                      */\n  /*                                                                       */\n  typedef int\n  (*FT_Outline_CubicToFunc)( const FT_Vector*  control1,\n                             const FT_Vector*  control2,\n                             const FT_Vector*  to,\n                             void*             user );\n\n#define  FT_Outline_CubicTo_Func  FT_Outline_CubicToFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Outline_Funcs                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold various function pointers used during outline  */\n  /*    decomposition in order to emit segments, conic, and cubic Béziers, */\n  /*    as well as `move to' and `close to' operations.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    move_to  :: The `move to' emitter.                                 */\n  /*                                                                       */\n  /*    line_to  :: The segment emitter.                                   */\n  /*                                                                       */\n  /*    conic_to :: The second-order Bézier arc emitter.                   */\n  /*                                                                       */\n  /*    cubic_to :: The third-order Bézier arc emitter.                    */\n  /*                                                                       */\n  /*    shift    :: The shift that is applied to coordinates before they   */\n  /*                are sent to the emitter.                               */\n  /*                                                                       */\n  /*    delta    :: The delta that is applied to coordinates before they   */\n  /*                are sent to the emitter, but after the shift.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The point coordinates sent to the emitters are the transformed     */\n  /*    version of the original coordinates (this is important for high    */\n  /*    accuracy during scan-conversion).  The transformation is simple:   */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      x' = (x << shift) - delta                                        */\n  /*      y' = (x << shift) - delta                                        */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    Set the value of `shift' and `delta' to 0 to get the original      */\n  /*    point coordinates.                                                 */\n  /*                                                                       */\n  typedef struct  FT_Outline_Funcs_\n  {\n    FT_Outline_MoveToFunc   move_to;\n    FT_Outline_LineToFunc   line_to;\n    FT_Outline_ConicToFunc  conic_to;\n    FT_Outline_CubicToFunc  cubic_to;\n\n    int                     shift;\n    FT_Pos                  delta;\n\n  } FT_Outline_Funcs;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags to an unsigned long type.     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Since many 16bit compilers don't like 32bit enumerations, you      */\n  /*    should redefine this macro in case of problems to something like   */\n  /*    this:                                                              */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  value         */\n  /*    }                                                                  */\n  /*                                                                       */\n  /*    to get a simple enumeration without assigning special numbers.     */\n  /*                                                                       */\n#ifndef FT_IMAGE_TAG\n#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 )  \\\n          value = ( ( (unsigned long)_x1 << 24 ) | \\\n                    ( (unsigned long)_x2 << 16 ) | \\\n                    ( (unsigned long)_x3 << 8  ) | \\\n                      (unsigned long)_x4         )\n#endif /* FT_IMAGE_TAG */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Glyph_Format                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration type used to describe the format of a given glyph   */\n  /*    image.  Note that this version of FreeType only supports two image */\n  /*    formats, even though future font drivers will be able to register  */\n  /*    their own format.                                                  */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_GLYPH_FORMAT_NONE ::                                            */\n  /*      The value 0 is reserved.                                         */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_COMPOSITE ::                                       */\n  /*      The glyph image is a composite of several other images.  This    */\n  /*      format is _only_ used with @FT_LOAD_NO_RECURSE, and is used to   */\n  /*      report compound glyphs (like accented characters).               */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_BITMAP ::                                          */\n  /*      The glyph image is a bitmap, and can be described as an          */\n  /*      @FT_Bitmap.  You generally need to access the `bitmap' field of  */\n  /*      the @FT_GlyphSlotRec structure to read it.                       */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_OUTLINE ::                                         */\n  /*      The glyph image is a vectorial outline made of line segments     */\n  /*      and Bézier arcs; it can be described as an @FT_Outline; you      */\n  /*      generally want to access the `outline' field of the              */\n  /*      @FT_GlyphSlotRec structure to read it.                           */\n  /*                                                                       */\n  /*    FT_GLYPH_FORMAT_PLOTTER ::                                         */\n  /*      The glyph image is a vectorial path with no inside and outside   */\n  /*      contours.  Some Type 1 fonts, like those in the Hershey family,  */\n  /*      contain glyphs in this format.  These are described as           */\n  /*      @FT_Outline, but FreeType isn't currently capable of rendering   */\n  /*      them correctly.                                                  */\n  /*                                                                       */\n  typedef enum  FT_Glyph_Format_\n  {\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_NONE, 0, 0, 0, 0 ),\n\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP,    'b', 'i', 't', 's' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE,   'o', 'u', 't', 'l' ),\n    FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER,   'p', 'l', 'o', 't' )\n\n  } FT_Glyph_Format;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    ft_glyph_format_xxx                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of deprecated constants.  Use the corresponding             */\n  /*    @FT_Glyph_Format values instead.                                   */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    ft_glyph_format_none      :: See @FT_GLYPH_FORMAT_NONE.            */\n  /*    ft_glyph_format_composite :: See @FT_GLYPH_FORMAT_COMPOSITE.       */\n  /*    ft_glyph_format_bitmap    :: See @FT_GLYPH_FORMAT_BITMAP.          */\n  /*    ft_glyph_format_outline   :: See @FT_GLYPH_FORMAT_OUTLINE.         */\n  /*    ft_glyph_format_plotter   :: See @FT_GLYPH_FORMAT_PLOTTER.         */\n  /*                                                                       */\n#define ft_glyph_format_none       FT_GLYPH_FORMAT_NONE\n#define ft_glyph_format_composite  FT_GLYPH_FORMAT_COMPOSITE\n#define ft_glyph_format_bitmap     FT_GLYPH_FORMAT_BITMAP\n#define ft_glyph_format_outline    FT_GLYPH_FORMAT_OUTLINE\n#define ft_glyph_format_plotter    FT_GLYPH_FORMAT_PLOTTER\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*****                                                               *****/\n  /*****            R A S T E R   D E F I N I T I O N S                *****/\n  /*****                                                               *****/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* A raster is a scan converter, in charge of rendering an outline into  */\n  /* a a bitmap.  This section contains the public API for rasters.        */\n  /*                                                                       */\n  /* Note that in FreeType 2, all rasters are now encapsulated within      */\n  /* specific modules called `renderers'.  See `freetype/ftrender.h' for   */\n  /* more details on renderers.                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    raster                                                             */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Scanline Converter                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How vectorial outlines are converted into bitmaps and pixmaps.     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains technical definitions.                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Raster                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle (pointer) to a raster object.  Each object can be used    */\n  /*    independently to convert an outline into a bitmap or pixmap.       */\n  /*                                                                       */\n  typedef struct FT_RasterRec_*  FT_Raster;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Span                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a single span of gray (or black) pixels  */\n  /*    when rendering a monochrome or anti-aliased bitmap.                */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x        :: The span's horizontal start position.                  */\n  /*                                                                       */\n  /*    len      :: The span's length in pixels.                           */\n  /*                                                                       */\n  /*    coverage :: The span color/coverage, ranging from 0 (background)   */\n  /*                to 255 (foreground).  Only used for anti-aliased       */\n  /*                rendering.                                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is used by the span drawing callback type named     */\n  /*    @FT_SpanFunc which takes the y-coordinate of the span as a         */\n  /*    a parameter.                                                       */\n  /*                                                                       */\n  /*    The coverage value is always between 0 and 255.                    */\n  /*                                                                       */\n  typedef struct  FT_Span_\n  {\n    short           x;\n    unsigned short  len;\n    unsigned char   coverage;\n\n  } FT_Span;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_SpanFunc                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used as a call-back by the anti-aliased renderer in     */\n  /*    order to let client applications draw themselves the gray pixel    */\n  /*    spans on each scan line.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The scanline's y-coordinate.                              */\n  /*                                                                       */\n  /*    count :: The number of spans to draw on this scanline.             */\n  /*                                                                       */\n  /*    spans :: A table of `count' spans to draw on the scanline.         */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This callback allows client applications to directly render the    */\n  /*    gray spans of the anti-aliased bitmap to any kind of surfaces.     */\n  /*                                                                       */\n  /*    This can be used to write anti-aliased outlines directly to a      */\n  /*    given background bitmap, and even perform translucency.            */\n  /*                                                                       */\n  /*    Note that the `count' field cannot be greater than a fixed value   */\n  /*    defined by the `FT_MAX_GRAY_SPANS' configuration macro in          */\n  /*    `ftoption.h'.  By default, this value is set to 32, which means    */\n  /*    that if there are more than 32 spans on a given scanline, the      */\n  /*    callback is called several times with the same `y' parameter in    */\n  /*    order to draw all callbacks.                                       */\n  /*                                                                       */\n  /*    Otherwise, the callback is only called once per scan-line, and     */\n  /*    only for those scanlines that do have `gray' pixels on them.       */\n  /*                                                                       */\n  typedef void\n  (*FT_SpanFunc)( int             y,\n                  int             count,\n                  const FT_Span*  spans,\n                  void*           user );\n\n#define FT_Raster_Span_Func   FT_SpanFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitTest_Func                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to test whether a given target pixel is already set to the drawing */\n  /*    `color'.  These tests are crucial to implement drop-out control    */\n  /*    per-se the TrueType spec.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y-coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x-coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   1 if the pixel is `set', 0 otherwise.                               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_BitTest_Func)( int    y,\n                             int    x,\n                             void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_BitSet_Func                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    THIS TYPE IS DEPRECATED.  DO NOT USE IT.                           */\n  /*                                                                       */\n  /*    A function used as a call-back by the monochrome scan-converter    */\n  /*    to set an individual target pixel.  This is crucial to implement   */\n  /*    drop-out control according to the TrueType specification.          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    y     :: The pixel's y-coordinate.                                 */\n  /*                                                                       */\n  /*    x     :: The pixel's x-coordinate.                                 */\n  /*                                                                       */\n  /*    user  :: User-supplied data that is passed to the callback.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    1 if the pixel is `set', 0 otherwise.                              */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_BitSet_Func)( int    y,\n                            int    x,\n                            void*  user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_RASTER_FLAG_XXX                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A list of bit flag constants as used in the `flags' field of a     */\n  /*    @FT_Raster_Params structure.                                       */\n  /*                                                                       */\n  /* <Values>                                                              */\n  /*    FT_RASTER_FLAG_DEFAULT :: This value is 0.                         */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_AA      :: This flag is set to indicate that an     */\n  /*                              anti-aliased glyph image should be       */\n  /*                              generated.  Otherwise, it will be        */\n  /*                              monochrome (1-bit).                      */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_DIRECT  :: This flag is set to indicate direct      */\n  /*                              rendering.  In this mode, client         */\n  /*                              applications must provide their own span */\n  /*                              callback.  This lets them directly       */\n  /*                              draw or compose over an existing bitmap. */\n  /*                              If this bit is not set, the target       */\n  /*                              pixmap's buffer _must_ be zeroed before  */\n  /*                              rendering.                               */\n  /*                                                                       */\n  /*                              Note that for now, direct rendering is   */\n  /*                              only possible with anti-aliased glyphs.  */\n  /*                                                                       */\n  /*    FT_RASTER_FLAG_CLIP    :: This flag is only used in direct         */\n  /*                              rendering mode.  If set, the output will */\n  /*                              be clipped to a box specified in the     */\n  /*                              `clip_box' field of the                  */\n  /*                              @FT_Raster_Params structure.             */\n  /*                                                                       */\n  /*                              Note that by default, the glyph bitmap   */\n  /*                              is clipped to the target pixmap, except  */\n  /*                              in direct rendering mode where all spans */\n  /*                              are generated if no clipping box is set. */\n  /*                                                                       */\n#define FT_RASTER_FLAG_DEFAULT  0x0\n#define FT_RASTER_FLAG_AA       0x1\n#define FT_RASTER_FLAG_DIRECT   0x2\n#define FT_RASTER_FLAG_CLIP     0x4\n\n  /* deprecated */\n#define ft_raster_flag_default  FT_RASTER_FLAG_DEFAULT\n#define ft_raster_flag_aa       FT_RASTER_FLAG_AA\n#define ft_raster_flag_direct   FT_RASTER_FLAG_DIRECT\n#define ft_raster_flag_clip     FT_RASTER_FLAG_CLIP\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Params                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure to hold the arguments used by a raster's render        */\n  /*    function.                                                          */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    target      :: The target bitmap.                                  */\n  /*                                                                       */\n  /*    source      :: A pointer to the source glyph image (e.g., an       */\n  /*                   @FT_Outline).                                       */\n  /*                                                                       */\n  /*    flags       :: The rendering flags.                                */\n  /*                                                                       */\n  /*    gray_spans  :: The gray span drawing callback.                     */\n  /*                                                                       */\n  /*    black_spans :: The black span drawing callback.                    */\n  /*                                                                       */\n  /*    bit_test    :: The bit test callback.  UNIMPLEMENTED!              */\n  /*                                                                       */\n  /*    bit_set     :: The bit set callback.  UNIMPLEMENTED!               */\n  /*                                                                       */\n  /*    user        :: User-supplied data that is passed to each drawing   */\n  /*                   callback.                                           */\n  /*                                                                       */\n  /*    clip_box    :: An optional clipping box.  It is only used in       */\n  /*                   direct rendering mode.  Note that coordinates here  */\n  /*                   should be expressed in _integer_ pixels (and not in */\n  /*                   26.6 fixed-point units).                            */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An anti-aliased glyph bitmap is drawn if the @FT_RASTER_FLAG_AA    */\n  /*    bit flag is set in the `flags' field, otherwise a monochrome       */\n  /*    bitmap is generated.                                               */\n  /*                                                                       */\n  /*    If the @FT_RASTER_FLAG_DIRECT bit flag is set in `flags', the      */\n  /*    raster will call the `gray_spans' callback to draw gray pixel      */\n  /*    spans, in the case of an aa glyph bitmap, it will call             */\n  /*    `black_spans', and `bit_test' and `bit_set' in the case of a       */\n  /*    monochrome bitmap.  This allows direct composition over a          */\n  /*    pre-existing bitmap through user-provided callbacks to perform the */\n  /*    span drawing/composition.                                          */\n  /*                                                                       */\n  /*    Note that the `bit_test' and `bit_set' callbacks are required when */\n  /*    rendering a monochrome bitmap, as they are crucial to implement    */\n  /*    correct drop-out control as defined in the TrueType specification. */\n  /*                                                                       */\n  typedef struct  FT_Raster_Params_\n  {\n    const FT_Bitmap*        target;\n    const void*             source;\n    int                     flags;\n    FT_SpanFunc             gray_spans;\n    FT_SpanFunc             black_spans;\n    FT_Raster_BitTest_Func  bit_test;     /* doesn't work! */\n    FT_Raster_BitSet_Func   bit_set;      /* doesn't work! */\n    void*                   user;\n    FT_BBox                 clip_box;\n\n  } FT_Raster_Params;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_NewFunc                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to create a new raster object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory :: A handle to the memory allocator.                        */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0 means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `memory' parameter is a typeless pointer in order to avoid     */\n  /*    un-wanted dependencies on the rest of the FreeType code.  In       */\n  /*    practice, it is an @FT_Memory object, i.e., a handle to the        */\n  /*    standard FreeType memory allocator.  However, this field can be    */\n  /*    completely ignored by a given raster implementation.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_NewFunc)( void*       memory,\n                        FT_Raster*  raster );\n\n#define  FT_Raster_New_Func    FT_Raster_NewFunc\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_DoneFunc                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A function used to destroy a given raster object.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_DoneFunc)( FT_Raster  raster );\n\n#define  FT_Raster_Done_Func   FT_Raster_DoneFunc\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_ResetFunc                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    FreeType provides an area of memory called the `render pool',      */\n  /*    available to all registered rasters.  This pool can be freely used */\n  /*    during a given scan-conversion but is shared by all rasters.  Its  */\n  /*    content is thus transient.                                         */\n  /*                                                                       */\n  /*    This function is called each time the render pool changes, or just */\n  /*    after a new raster object is created.                              */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster    :: A handle to the new raster object.                    */\n  /*                                                                       */\n  /*    pool_base :: The address in memory of the render pool.             */\n  /*                                                                       */\n  /*    pool_size :: The size in bytes of the render pool.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Rasters can ignore the render pool and rely on dynamic memory      */\n  /*    allocation if they want to (a handle to the memory allocator is    */\n  /*    passed to the raster constructor).  However, this is not           */\n  /*    recommended for efficiency purposes.                               */\n  /*                                                                       */\n  typedef void\n  (*FT_Raster_ResetFunc)( FT_Raster       raster,\n                          unsigned char*  pool_base,\n                          unsigned long   pool_size );\n\n#define  FT_Raster_Reset_Func   FT_Raster_ResetFunc\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_SetModeFunc                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is a generic facility to change modes or attributes  */\n  /*    in a given raster.  This can be used for debugging purposes, or    */\n  /*    simply to allow implementation-specific `features' in a given      */\n  /*    raster module.                                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the new raster object.                       */\n  /*                                                                       */\n  /*    mode   :: A 4-byte tag used to name the mode or property.          */\n  /*                                                                       */\n  /*    args   :: A pointer to the new mode/property to use.               */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_SetModeFunc)( FT_Raster      raster,\n                            unsigned long  mode,\n                            void*          args );\n\n#define  FT_Raster_Set_Mode_Func  FT_Raster_SetModeFunc\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Raster_RenderFunc                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   Invokes a given raster to scan-convert a given glyph image into a   */\n  /*   target bitmap.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    raster :: A handle to the raster object.                           */\n  /*                                                                       */\n  /*    params :: A pointer to an @FT_Raster_Params structure used to      */\n  /*              store the rendering parameters.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    Error code.  0 means success.                                      */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The exact format of the source image depends on the raster's glyph */\n  /*    format defined in its @FT_Raster_Funcs structure.  It can be an    */\n  /*    @FT_Outline or anything else in order to support a large array of  */\n  /*    glyph formats.                                                     */\n  /*                                                                       */\n  /*    Note also that the render function can fail and return a           */\n  /*    `FT_Err_Unimplemented_Feature' error code if the raster used does  */\n  /*    not support direct composition.                                    */\n  /*                                                                       */\n  /*    XXX: For now, the standard raster doesn't support direct           */\n  /*         composition but this should change for the final release (see */\n  /*         the files `demos/src/ftgrays.c' and `demos/src/ftgrays2.c'    */\n  /*         for examples of distinct implementations which support direct */\n  /*         composition).                                                 */\n  /*                                                                       */\n  typedef int\n  (*FT_Raster_RenderFunc)( FT_Raster                raster,\n                           const FT_Raster_Params*  params );\n\n#define  FT_Raster_Render_Func    FT_Raster_RenderFunc\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Raster_Funcs                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   A structure used to describe a given raster class to the library.   */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    glyph_format  :: The supported glyph format for this raster.       */\n  /*                                                                       */\n  /*    raster_new    :: The raster constructor.                           */\n  /*                                                                       */\n  /*    raster_reset  :: Used to reset the render pool within the raster.  */\n  /*                                                                       */\n  /*    raster_render :: A function to render a glyph into a given bitmap. */\n  /*                                                                       */\n  /*    raster_done   :: The raster destructor.                            */\n  /*                                                                       */\n  typedef struct  FT_Raster_Funcs_\n  {\n    FT_Glyph_Format         glyph_format;\n    FT_Raster_NewFunc       raster_new;\n    FT_Raster_ResetFunc     raster_reset;\n    FT_Raster_SetModeFunc   raster_set_mode;\n    FT_Raster_RenderFunc    raster_render;\n    FT_Raster_DoneFunc      raster_done;\n\n  } FT_Raster_Funcs;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTIMAGE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftincrem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftincrem.h                                                             */\n/*                                                                         */\n/*    FreeType incremental loading (specification).                        */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2006, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTINCREM_H__\n#define __FTINCREM_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n /***************************************************************************\n  *\n  * @section:\n  *    incremental\n  *\n  * @title:\n  *    Incremental Loading\n  *\n  * @abstract:\n  *    Custom Glyph Loading.\n  *\n  * @description:\n  *   This section contains various functions used to perform so-called\n  *   `incremental' glyph loading.  This is a mode where all glyphs loaded\n  *   from a given @FT_Face are provided by the client application,\n  *\n  *   Apart from that, all other tables are loaded normally from the font\n  *   file.  This mode is useful when FreeType is used within another\n  *   engine, e.g., a Postscript Imaging Processor.\n  *\n  *   To enable this mode, you must use @FT_Open_Face, passing an\n  *   @FT_Parameter with the @FT_PARAM_TAG_INCREMENTAL tag and an\n  *   @FT_Incremental_Interface value.  See the comments for\n  *   @FT_Incremental_InterfaceRec for an example.\n  *\n  */\n\n\n /***************************************************************************\n  *\n  * @type:\n  *   FT_Incremental\n  *\n  * @description:\n  *   An opaque type describing a user-provided object used to implement\n  *   `incremental' glyph loading within FreeType.  This is used to support\n  *   embedded fonts in certain environments (e.g., Postscript interpreters),\n  *   where the glyph data isn't in the font file, or must be overridden by\n  *   different values.\n  *\n  * @note:\n  *   It is up to client applications to create and implement @FT_Incremental\n  *   objects, as long as they provide implementations for the methods\n  *   @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc\n  *   and @FT_Incremental_GetGlyphMetricsFunc.\n  *\n  *   See the description of @FT_Incremental_InterfaceRec to understand how\n  *   to use incremental objects with FreeType.\n  */\n  typedef struct FT_IncrementalRec_*  FT_Incremental;\n\n\n /***************************************************************************\n  *\n  * @struct:\n  *   FT_Incremental_Metrics\n  *\n  * @description:\n  *   A small structure used to contain the basic glyph metrics returned\n  *   by the @FT_Incremental_GetGlyphMetricsFunc method.\n  *\n  * @fields:\n  *   bearing_x ::\n  *     Left bearing, in font units.\n  *\n  *   bearing_y ::\n  *     Top bearing, in font units.\n  *\n  *   advance ::\n  *     Glyph advance, in font units.\n  *\n  * @note:\n  *   These correspond to horizontal or vertical metrics depending on the\n  *   value of the `vertical' argument to the function\n  *   @FT_Incremental_GetGlyphMetricsFunc.\n  */\n  typedef struct  FT_Incremental_MetricsRec_\n  {\n    FT_Long  bearing_x;\n    FT_Long  bearing_y;\n    FT_Long  advance;\n\n  } FT_Incremental_MetricsRec, *FT_Incremental_Metrics;\n\n\n /***************************************************************************\n  *\n  * @type:\n  *   FT_Incremental_GetGlyphDataFunc\n  *\n  * @description:\n  *   A function called by FreeType to access a given glyph's data bytes\n  *   during @FT_Load_Glyph or @FT_Load_Char if incremental loading is\n  *   enabled.\n  *\n  *   Note that the format of the glyph's data bytes depends on the font\n  *   file format.  For TrueType, it must correspond to the raw bytes within\n  *   the `glyf' table.  For Postscript formats, it must correspond to the\n  *   *unencrypted* charstring bytes, without any `lenIV' header.  It is\n  *   undefined for any other format.\n  *\n  * @input:\n  *   incremental ::\n  *     Handle to an opaque @FT_Incremental handle provided by the client\n  *     application.\n  *\n  *   glyph_index ::\n  *     Index of relevant glyph.\n  *\n  * @output:\n  *   adata ::\n  *     A structure describing the returned glyph data bytes (which will be\n  *     accessed as a read-only byte block).\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   If this function returns successfully the method\n  *   @FT_Incremental_FreeGlyphDataFunc will be called later to release\n  *   the data bytes.\n  *\n  *   Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for\n  *   compound glyphs.\n  */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental  incremental,\n                                      FT_UInt         glyph_index,\n                                      FT_Data*        adata );\n\n\n /***************************************************************************\n  *\n  * @type:\n  *   FT_Incremental_FreeGlyphDataFunc\n  *\n  * @description:\n  *   A function used to release the glyph data bytes returned by a\n  *   successful call to @FT_Incremental_GetGlyphDataFunc.\n  *\n  * @input:\n  *   incremental ::\n  *     A handle to an opaque @FT_Incremental handle provided by the client\n  *     application.\n  *\n  *   data ::\n  *     A structure describing the glyph data bytes (which will be accessed\n  *     as a read-only byte block).\n  */\n  typedef void\n  (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental  incremental,\n                                       FT_Data*        data );\n\n\n /***************************************************************************\n  *\n  * @type:\n  *   FT_Incremental_GetGlyphMetricsFunc\n  *\n  * @description:\n  *   A function used to retrieve the basic metrics of a given glyph index\n  *   before accessing its data.  This is necessary because, in certain\n  *   formats like TrueType, the metrics are stored in a different place from\n  *   the glyph images proper.\n  *\n  * @input:\n  *   incremental ::\n  *     A handle to an opaque @FT_Incremental handle provided by the client\n  *     application.\n  *\n  *   glyph_index ::\n  *     Index of relevant glyph.\n  *\n  *   vertical ::\n  *     If true, return vertical metrics.\n  *\n  *   ametrics ::\n  *     This parameter is used for both input and output.\n  *     The original glyph metrics, if any, in font units.  If metrics are\n  *     not available all the values must be set to zero.\n  *\n  * @output:\n  *   ametrics ::\n  *     The replacement glyph metrics in font units.\n  *\n  */\n  typedef FT_Error\n  (*FT_Incremental_GetGlyphMetricsFunc)\n                      ( FT_Incremental              incremental,\n                        FT_UInt                     glyph_index,\n                        FT_Bool                     vertical,\n                        FT_Incremental_MetricsRec  *ametrics );\n\n\n  /**************************************************************************\n   *\n   * @struct:\n   *   FT_Incremental_FuncsRec\n   *\n   * @description:\n   *   A table of functions for accessing fonts that load data\n   *   incrementally.  Used in @FT_Incremental_InterfaceRec.\n   *\n   * @fields:\n   *   get_glyph_data ::\n   *     The function to get glyph data.  Must not be null.\n   *\n   *   free_glyph_data ::\n   *     The function to release glyph data.  Must not be null.\n   *\n   *   get_glyph_metrics ::\n   *     The function to get glyph metrics.  May be null if the font does\n   *     not provide overriding glyph metrics.\n   */\n  typedef struct  FT_Incremental_FuncsRec_\n  {\n    FT_Incremental_GetGlyphDataFunc     get_glyph_data;\n    FT_Incremental_FreeGlyphDataFunc    free_glyph_data;\n    FT_Incremental_GetGlyphMetricsFunc  get_glyph_metrics;\n\n  } FT_Incremental_FuncsRec;\n\n\n /***************************************************************************\n  *\n  * @struct:\n  *   FT_Incremental_InterfaceRec\n  *\n  * @description:\n  *   A structure to be used with @FT_Open_Face to indicate that the user\n  *   wants to support incremental glyph loading.  You should use it with\n  *   @FT_PARAM_TAG_INCREMENTAL as in the following example:\n  *\n  *     {\n  *       FT_Incremental_InterfaceRec  inc_int;\n  *       FT_Parameter                 parameter;\n  *       FT_Open_Args                 open_args;\n  *\n  *\n  *       // set up incremental descriptor\n  *       inc_int.funcs  = my_funcs;\n  *       inc_int.object = my_object;\n  *\n  *       // set up optional parameter\n  *       parameter.tag  = FT_PARAM_TAG_INCREMENTAL;\n  *       parameter.data = &inc_int;\n  *\n  *       // set up FT_Open_Args structure\n  *       open_args.flags      = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;\n  *       open_args.pathname   = my_font_pathname;\n  *       open_args.num_params = 1;\n  *       open_args.params     = &parameter; // we use one optional argument\n  *\n  *       // open the font\n  *       error = FT_Open_Face( library, &open_args, index, &face );\n  *       ...\n  *     }\n  */\n  typedef struct  FT_Incremental_InterfaceRec_\n  {\n    const FT_Incremental_FuncsRec*  funcs;\n    FT_Incremental                  object;\n\n  } FT_Incremental_InterfaceRec;\n\n\n /***************************************************************************\n  *\n  * @type:\n  *   FT_Incremental_Interface\n  *\n  * @description:\n  *   A pointer to an @FT_Incremental_InterfaceRec structure.\n  *\n  */\n  typedef FT_Incremental_InterfaceRec*   FT_Incremental_Interface;\n\n\n /***************************************************************************\n  *\n  * @constant:\n  *   FT_PARAM_TAG_INCREMENTAL\n  *\n  * @description:\n  *   A constant used as the tag of @FT_Parameter structures to indicate\n  *   an incremental loading object to be used by FreeType.\n  *\n  */\n#define FT_PARAM_TAG_INCREMENTAL  FT_MAKE_TAG( 'i', 'n', 'c', 'r' )\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTINCREM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftlcdfil.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlcdfil.h                                                             */\n/*                                                                         */\n/*    FreeType API for color filtering of subpixel bitmap glyphs           */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2006, 2007 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_LCD_FILTER_H__\n#define __FT_LCD_FILTER_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n\nFT_BEGIN_HEADER\n\n  /***************************************************************************\n   *\n   * @section:\n   *   lcd_filtering\n   *\n   * @title:\n   *   LCD Filtering\n   *\n   * @abstract:\n   *   Reduce color fringes of LCD-optimized bitmaps.\n   *\n   * @description:\n   *   The @FT_Library_SetLcdFilter API can be used to specify a low-pass\n   *   filter which is then applied to LCD-optimized bitmaps generated\n   *   through @FT_Render_Glyph.  This is useful to reduce color fringes\n   *   which would occur with unfiltered rendering.\n   *\n   *   Note that no filter is active by default, and that this function is\n   *   *not* implemented in default builds of the library.  You need to\n   *   #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your `ftoption.h' file\n   *   in order to activate it.\n   */\n\n\n  /****************************************************************************\n   *\n   * @func:\n   *   FT_LcdFilter\n   *\n   * @description:\n   *   A list of values to identify various types of LCD filters.\n   *\n   * @values:\n   *   FT_LCD_FILTER_NONE ::\n   *     Do not perform filtering.  When used with subpixel rendering, this\n   *     results in sometimes severe color fringes.\n   *\n   *   FT_LCD_FILTER_DEFAULT ::\n   *     The default filter reduces color fringes considerably, at the cost\n   *     of a slight blurriness in the output.\n   *\n   *   FT_LCD_FILTER_LIGHT ::\n   *     The light filter is a variant that produces less blurriness at the\n   *     cost of slightly more color fringes than the default one.  It might\n   *     be better, depending on taste, your monitor, or your personal vision.\n   *\n   *   FT_LCD_FILTER_LEGACY ::\n   *     This filter corresponds to the original libXft color filter.  It\n   *     provides high contrast output but can exhibit really bad color\n   *     fringes if glyphs are not extremely well hinted to the pixel grid.\n   *     In other words, it only works well if the TrueType bytecode\n   *     interpreter is enabled *and* high-quality hinted fonts are used.\n   *\n   *     This filter is only provided for comparison purposes, and might be\n   *     disabled or stay unsupported in the future.\n   *\n   * @since:\n   *   2.3.0\n   */\n  typedef enum\n  {\n    FT_LCD_FILTER_NONE    = 0,\n    FT_LCD_FILTER_DEFAULT = 1,\n    FT_LCD_FILTER_LIGHT   = 2,\n    FT_LCD_FILTER_LEGACY  = 16,\n\n    FT_LCD_FILTER_MAX   /* do not remove */\n\n  } FT_LcdFilter;\n\n\n  /**************************************************************************\n   *\n   * @func:\n   *   FT_Library_SetLcdFilter\n   *\n   * @description:\n   *   This function is used to apply color filtering to LCD decimated\n   *   bitmaps, like the ones used when calling @FT_Render_Glyph with\n   *   @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.\n   *\n   * @input:\n   *   library ::\n   *     A handle to the target library instance.\n   *\n   *   filter ::\n   *     The filter type.\n   *\n   *     You can use @FT_LCD_FILTER_NONE here to disable this feature, or\n   *     @FT_LCD_FILTER_DEFAULT to use a default filter that should work\n   *     well on most LCD screens.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   This feature is always disabled by default.  Clients must make an\n   *   explicit call to this function with a `filter' value other than\n   *   @FT_LCD_FILTER_NONE in order to enable it.\n   *\n   *   Due to *PATENTS* covering subpixel rendering, this function doesn't\n   *   do anything except returning `FT_Err_Unimplemented_Feature' if the\n   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not\n   *   defined in your build of the library, which should correspond to all\n   *   default builds of FreeType.\n   *\n   *   The filter affects glyph bitmaps rendered through @FT_Render_Glyph,\n   *   @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.\n   *\n   *   It does _not_ affect the output of @FT_Outline_Render and\n   *   @FT_Outline_Get_Bitmap.\n   *\n   *   If this feature is activated, the dimensions of LCD glyph bitmaps are\n   *   either larger or taller than the dimensions of the corresponding\n   *   outline with regards to the pixel grid.  For example, for\n   *   @FT_RENDER_MODE_LCD, the filter adds up to 3 pixels to the left, and\n   *   up to 3 pixels to the right.\n   *\n   *   The bitmap offset values are adjusted correctly, so clients shouldn't\n   *   need to modify their layout and glyph positioning code when enabling\n   *   the filter.\n   *\n   * @since:\n   *   2.3.0\n   */\n  FT_EXPORT( FT_Error )\n  FT_Library_SetLcdFilter( FT_Library    library,\n                           FT_LcdFilter  filter );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_LCD_FILTER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftlist.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlist.h                                                               */\n/*                                                                         */\n/*    Generic list support for FreeType (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2007 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*  This file implements functions relative to list processing.  Its     */\n  /*  data structures are defined in `freetype.h'.                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTLIST_H__\n#define __FTLIST_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    List Processing                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Simple management of lists.                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains various definitions related to list          */\n  /*    processing using doubly-linked nodes.                              */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_List                                                            */\n  /*    FT_ListNode                                                        */\n  /*    FT_ListRec                                                         */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /*    FT_List_Add                                                        */\n  /*    FT_List_Insert                                                     */\n  /*    FT_List_Find                                                       */\n  /*    FT_List_Remove                                                     */\n  /*    FT_List_Up                                                         */\n  /*    FT_List_Iterate                                                    */\n  /*    FT_List_Iterator                                                   */\n  /*    FT_List_Finalize                                                   */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Find                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finds the list node for a given listed object.                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    data :: The address of the listed object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    List node.  NULL if it wasn't found.                               */\n  /*                                                                       */\n  FT_EXPORT( FT_ListNode )\n  FT_List_Find( FT_List  list,\n                void*    data );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Add                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Appends an element to the end of a list.                           */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to append.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Add( FT_List      list,\n               FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Insert                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Inserts an element at the head of a list.                          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to parent list.                                  */\n  /*    node :: The node to insert.                                        */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Insert( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Remove                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Removes a node from a list.  This function doesn't check whether   */\n  /*    the node is in the list!                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The node to remove.                                        */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Remove( FT_List      list,\n                  FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Up                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Moves a node to the head/top of a list.  Used to maintain LRU      */\n  /*    lists.                                                             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    list :: A pointer to the parent list.                              */\n  /*    node :: The node to move.                                          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Up( FT_List      list,\n              FT_ListNode  node );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Iterator                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An FT_List iterator function which is called during a list parse   */\n  /*    by @FT_List_Iterate.                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    node :: The current iteration list node.                           */\n  /*                                                                       */\n  /*    user :: A typeless pointer passed to @FT_List_Iterate.             */\n  /*            Can be used to point to the iteration's state.             */\n  /*                                                                       */\n  typedef FT_Error\n  (*FT_List_Iterator)( FT_ListNode  node,\n                       void*        user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Iterate                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Parses a list and calls a given iterator function on each element. */\n  /*    Note that parsing is stopped as soon as one of the iterator calls  */\n  /*    returns a non-zero value.                                          */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list     :: A handle to the list.                                  */\n  /*    iterator :: An iterator function, called on each node of the list. */\n  /*    user     :: A user-supplied field which is passed as the second    */\n  /*                argument to the iterator.                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The result (a FreeType error code) of the last iterator call.      */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_List_Iterate( FT_List           list,\n                   FT_List_Iterator  iterator,\n                   void*             user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_List_Destructor                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An @FT_List iterator function which is called during a list        */\n  /*    finalization by @FT_List_Finalize to destroy all elements in a     */\n  /*    given list.                                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    system :: The current system object.                               */\n  /*                                                                       */\n  /*    data   :: The current object to destroy.                           */\n  /*                                                                       */\n  /*    user   :: A typeless pointer passed to @FT_List_Iterate.  It can   */\n  /*              be used to point to the iteration's state.               */\n  /*                                                                       */\n  typedef void\n  (*FT_List_Destructor)( FT_Memory  memory,\n                         void*      data,\n                         void*      user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_List_Finalize                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys all elements in the list as well as the list itself.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    list    :: A handle to the list.                                   */\n  /*                                                                       */\n  /*    destroy :: A list destructor that will be applied to each element  */\n  /*               of the list.                                            */\n  /*                                                                       */\n  /*    memory  :: The current memory object which handles deallocation.   */\n  /*                                                                       */\n  /*    user    :: A user-supplied field which is passed as the last       */\n  /*               argument to the destructor.                             */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_List_Finalize( FT_List             list,\n                    FT_List_Destructor  destroy,\n                    FT_Memory           memory,\n                    void*               user );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLIST_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftlzw.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftlzw.h                                                                */\n/*                                                                         */\n/*    LZW-compressed stream support.                                       */\n/*                                                                         */\n/*  Copyright 2004, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTLZW_H__\n#define __FTLZW_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    lzw                                                                */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    LZW Streams                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Using LZW-compressed font files.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of LZW-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n /************************************************************************\n  *\n  * @function:\n  *   FT_Stream_OpenLZW\n  *\n  * @description:\n  *   Open a new stream to parse LZW-compressed font files.  This is\n  *   mainly used to support the compressed `*.pcf.Z' fonts that come\n  *   with XFree86.\n  *\n  * @input:\n  *   stream :: The target embedding stream.\n  *\n  *   source :: The source stream.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   The source stream must be opened _before_ calling this function.\n  *\n  *   Calling the internal function `FT_Stream_Close' on the new stream will\n  *   *not* call `FT_Stream_Close' on the source stream.  None of the stream\n  *   objects will be released to the heap.\n  *\n  *   The stream implementation is very basic and resets the decompression\n  *   process each time seeking backwards is needed within the stream\n  *\n  *   In certain builds of the library, LZW compression recognition is\n  *   automatically handled when calling @FT_New_Face or @FT_Open_Face.\n  *   This means that if no font driver is capable of handling the raw\n  *   compressed file, the library will try to open a LZW stream from it\n  *   and re-open the face with it.\n  *\n  *   This function may return `FT_Err_Unimplemented_Feature' if your build\n  *   of FreeType was not compiled with LZW support.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Stream_OpenLZW( FT_Stream  stream,\n                     FT_Stream  source );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTLZW_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftmac.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmac.h                                                                */\n/*                                                                         */\n/*    Additional Mac-specific API.                                         */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2006, 2007 by                               */\n/*  Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.     */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/* NOTE: Include this file after <freetype/freetype.h> and after the       */\n/*       Mac-specific <Types.h> header (or any other Mac header that       */\n/*       includes <Types.h>); we use Handle type.                          */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMAC_H__\n#define __FTMAC_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n/* gcc-3.4.1 and later can warn about functions tagged as deprecated */\n#ifndef FT_DEPRECATED_ATTRIBUTE\n#if defined(__GNUC__)                                               && \\\n    ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))\n#define FT_DEPRECATED_ATTRIBUTE  __attribute__((deprecated))\n#else\n#define FT_DEPRECATED_ATTRIBUTE\n#endif\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    mac_specific                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Mac Specific Interface                                             */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Only available on the Macintosh.                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following definitions are only available if FreeType is        */\n  /*    compiled on a Macintosh.                                           */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FOND                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a FOND resource.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fond       :: A FOND resource.                                     */\n  /*                                                                       */\n  /*    face_index :: Only supported for the -1 `sanity check' special     */\n  /*                  case.                                                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Notes>                                                               */\n  /*    This function can be used to create @FT_Face objects from fonts    */\n  /*    that are installed in the system as follows.                       */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      fond = GetResource( 'FOND', fontName );                          */\n  /*      error = FT_New_Face_From_FOND( library, fond, 0, &face );        */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FOND( FT_Library  library,\n                         Handle      fond,\n                         FT_Long     face_index,\n                         FT_Face    *aface );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_Name                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font (e.g., Times New Roman       */\n  /*                  Bold).                                               */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file.  For passing to                  */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face.  For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_Name( const char*  fontName,\n                            FSSpec*      pathSpec,\n                            FT_Long*     face_index )\n                          FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFile_From_Mac_ATS_Name                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return an FSSpec for the disk file containing the named font.      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName   :: Mac OS name of the font in ATS framework.            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    pathSpec   :: FSSpec to the file. For passing to                   */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /*    face_index :: Index of the face. For passing to                    */\n  /*                  @FT_New_Face_From_FSSpec.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFile_From_Mac_ATS_Name( const char*  fontName,\n                                FSSpec*      pathSpec,\n                                FT_Long*     face_index )\n                              FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_GetFilePath_From_Mac_ATS_Name                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return a pathname of the disk file and face index for given font   */\n  /*    name which is handled by ATS framework.                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    fontName    :: Mac OS name of the font in ATS framework.           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    path        :: Buffer to store pathname of the file.  For passing  */\n  /*                   to @FT_New_Face.  The client must allocate this     */\n  /*                   buffer before calling this function.                */\n  /*                                                                       */\n  /*    maxPathSize :: Lengths of the buffer `path' that client allocated. */\n  /*                                                                       */\n  /*    face_index  :: Index of the face.  For passing to @FT_New_Face.    */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_GetFilePath_From_Mac_ATS_Name( const char*  fontName,\n                                    UInt8*       path,\n                                    UInt32       maxPathSize,\n                                    FT_Long*     face_index );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSSpec                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSSpec to the font file.                                  */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSSpec to the font file.                             */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index 0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSSpec is identical to @FT_New_Face except       */\n  /*    it accepts an FSSpec instead of a path.                            */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSSpec( FT_Library     library,\n                           const FSSpec  *spec,\n                           FT_Long        face_index,\n                           FT_Face       *aface )\n                         FT_DEPRECATED_ATTRIBUTE;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Face_From_FSRef                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new face object from a given resource and typeface index  */\n  /*    using an FSRef to the font file.                                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library resource.                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    spec       :: FSRef to the font file.                              */\n  /*                                                                       */\n  /*    face_index :: The index of the face within the resource.  The      */\n  /*                  first face has index 0.                              */\n  /* <Output>                                                              */\n  /*    aface      :: A handle to a new face object.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    @FT_New_Face_From_FSRef is identical to @FT_New_Face except        */\n  /*    it accepts an FSRef instead of a path.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Face_From_FSRef( FT_Library    library,\n                          const FSRef  *ref,\n                          FT_Long       face_index,\n                          FT_Face      *aface )\n                        FT_DEPRECATED_ATTRIBUTE;\n\n  /* */\n\n\nFT_END_HEADER\n\n\n#endif /* __FTMAC_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftmm.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmm.h                                                                 */\n/*                                                                         */\n/*    FreeType Multiple Master font interface (specification).             */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMM_H__\n#define __FTMM_H__\n\n\n#include <ft2build.h>\n#include FT_TYPE1_TABLES_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    multiple_masters                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Multiple Masters                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to manage Multiple Masters fonts.                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The following types and functions are used to manage Multiple      */\n  /*    Master fonts, i.e., the selection of specific design instances by  */\n  /*    setting design axis coordinates.                                   */\n  /*                                                                       */\n  /*    George Williams has extended this interface to make it work with   */\n  /*    both Type 1 Multiple Masters fonts and GX distortable (var)        */\n  /*    fonts.  Some of these routines only work with MM fonts, others     */\n  /*    will work with both types.  They are similar enough that a         */\n  /*    consistent interface makes sense.                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Axis                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  typedef struct  FT_MM_Axis_\n  {\n    FT_String*  name;\n    FT_Long     minimum;\n    FT_Long     maximum;\n\n  } FT_MM_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Multi_Master                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    font.                                                              */\n  /*                                                                       */\n  /*    This structure can't be used for GX var fonts.                     */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis    :: Number of axes.  Cannot exceed 4.                   */\n  /*                                                                       */\n  /*    num_designs :: Number of designs; should be normally 2^num_axis    */\n  /*                   even though the Type 1 specification strangely      */\n  /*                   allows for intermediate designs to be present. This */\n  /*                   number cannot exceed 16.                            */\n  /*                                                                       */\n  /*    axis        :: A table of axis descriptors.                        */\n  /*                                                                       */\n  typedef struct  FT_Multi_Master_\n  {\n    FT_UInt     num_axis;\n    FT_UInt     num_designs;\n    FT_MM_Axis  axis[T1_MAX_MM_AXIS];\n\n  } FT_Multi_Master;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Axis                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a given axis in design space for  */\n  /*    Multiple Masters and GX var fonts.                                 */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    name    :: The axis's name.                                        */\n  /*               Not always meaningful for GX.                           */\n  /*                                                                       */\n  /*    minimum :: The axis's minimum design coordinate.                   */\n  /*                                                                       */\n  /*    def     :: The axis's default design coordinate.                   */\n  /*               FreeType computes meaningful default values for MM; it  */\n  /*               is then an integer value, not in 16.16 format.          */\n  /*                                                                       */\n  /*    maximum :: The axis's maximum design coordinate.                   */\n  /*                                                                       */\n  /*    tag     :: The axis's tag (the GX equivalent to `name').           */\n  /*               FreeType provides default values for MM if possible.    */\n  /*                                                                       */\n  /*    strid   :: The entry in `name' table (another GX version of        */\n  /*               `name').                                                */\n  /*               Not meaningful for MM.                                  */\n  /*                                                                       */\n  typedef struct  FT_Var_Axis_\n  {\n    FT_String*  name;\n\n    FT_Fixed    minimum;\n    FT_Fixed    def;\n    FT_Fixed    maximum;\n\n    FT_ULong    tag;\n    FT_UInt     strid;\n\n  } FT_Var_Axis;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Var_Named_Style                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to model a named style in a GX var font.   */\n  /*                                                                       */\n  /*    This structure can't be used for MM fonts.                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    coords :: The design coordinates for this style.                   */\n  /*              This is an array with one entry for each axis.           */\n  /*                                                                       */\n  /*    strid  :: The entry in `name' table identifying this style.        */\n  /*                                                                       */\n  typedef struct  FT_Var_Named_Style_\n  {\n    FT_Fixed*  coords;\n    FT_UInt    strid;\n\n  } FT_Var_Named_Style;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_MM_Var                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model the axes and space of a Multiple Masters */\n  /*    or GX var distortable font.                                        */\n  /*                                                                       */\n  /*    Some fields are specific to one format and not to the other.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    num_axis        :: The number of axes.  The maximum value is 4 for */\n  /*                       MM; no limit in GX.                             */\n  /*                                                                       */\n  /*    num_designs     :: The number of designs; should be normally       */\n  /*                       2^num_axis for MM fonts.  Not meaningful for GX */\n  /*                       (where every glyph could have a different       */\n  /*                       number of designs).                             */\n  /*                                                                       */\n  /*    num_namedstyles :: The number of named styles; only meaningful for */\n  /*                       GX which allows certain design coordinates to   */\n  /*                       have a string ID (in the `name' table)          */\n  /*                       associated with them.  The font can tell the    */\n  /*                       user that, for example, Weight=1.5 is `Bold'.   */\n  /*                                                                       */\n  /*    axis            :: A table of axis descriptors.                    */\n  /*                       GX fonts contain slightly more data than MM.    */\n  /*                                                                       */\n  /*    namedstyles     :: A table of named styles.                        */\n  /*                       Only meaningful with GX.                        */\n  /*                                                                       */\n  typedef struct  FT_MM_Var_\n  {\n    FT_UInt              num_axis;\n    FT_UInt              num_designs;\n    FT_UInt              num_namedstyles;\n    FT_Var_Axis*         axis;\n    FT_Var_Named_Style*  namedstyle;\n\n  } FT_MM_Var;\n\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Multi_Master                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieves the Multiple Master descriptor of a given font.          */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters descriptor.                        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Multi_Master( FT_Face           face,\n                       FT_Multi_Master  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_MM_Var                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieves the Multiple Master/GX var descriptor of a given font.   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face    :: A handle to the source face.                            */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    amaster :: The Multiple Masters descriptor.                        */\n  /*               Allocates a data structure, which the user must free    */\n  /*               (a single call to FT_FREE will do it).                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_MM_Var( FT_Face      face,\n                 FT_MM_Var*  *amaster );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Design_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters fonts, choose an interpolated font design     */\n  /*    through design coordinates.                                        */\n  /*                                                                       */\n  /*    This function can't be used with GX fonts.                         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Design_Coordinates( FT_Face   face,\n                                FT_UInt   num_coords,\n                                FT_Long*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Design_Coordinates                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Master or GX Var fonts, choose an interpolated font   */\n  /*    design through design coordinates.                                 */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: An array of design coordinates.                      */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Design_Coordinates( FT_Face    face,\n                                 FT_UInt    num_coords,\n                                 FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_MM_Blend_Coordinates                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    For Multiple Masters and GX var fonts, choose an interpolated font */\n  /*    design through normalized blend coordinates.                       */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    face       :: A handle to the source face.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    num_coords :: The number of design coordinates (must be equal to   */\n  /*                  the number of axes in the font).                     */\n  /*                                                                       */\n  /*    coords     :: The design coordinates array (each element must be   */\n  /*                  between 0 and 1.0).                                  */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_MM_Blend_Coordinates( FT_Face    face,\n                               FT_UInt    num_coords,\n                               FT_Fixed*  coords );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Var_Blend_Coordinates                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is another name of @FT_Set_MM_Blend_Coordinates.              */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Var_Blend_Coordinates( FT_Face    face,\n                                FT_UInt    num_coords,\n                                FT_Fixed*  coords );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftmodapi.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmodapi.h                                                             */\n/*                                                                         */\n/*    FreeType modules public interface (specification).                   */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTMODAPI_H__\n#define __FTMODAPI_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Module Management                                                  */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    How to add, upgrade, and remove modules from FreeType.             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The definitions below are used to manage modules within FreeType.  */\n  /*    Modules can be added, upgraded, and removed at runtime.            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* module bit flags */\n#define FT_MODULE_FONT_DRIVER         1  /* this module is a font driver  */\n#define FT_MODULE_RENDERER            2  /* this module is a renderer     */\n#define FT_MODULE_HINTER              4  /* this module is a glyph hinter */\n#define FT_MODULE_STYLER              8  /* this module is a styler       */\n\n#define FT_MODULE_DRIVER_SCALABLE     0x100   /* the driver supports      */\n                                              /* scalable fonts           */\n#define FT_MODULE_DRIVER_NO_OUTLINES  0x200   /* the driver does not      */\n                                              /* support vector outlines  */\n#define FT_MODULE_DRIVER_HAS_HINTER   0x400   /* the driver provides its  */\n                                              /* own hinter               */\n\n\n  /* deprecated values */\n#define ft_module_font_driver         FT_MODULE_FONT_DRIVER\n#define ft_module_renderer            FT_MODULE_RENDERER\n#define ft_module_hinter              FT_MODULE_HINTER\n#define ft_module_styler              FT_MODULE_STYLER\n\n#define ft_module_driver_scalable     FT_MODULE_DRIVER_SCALABLE\n#define ft_module_driver_no_outlines  FT_MODULE_DRIVER_NO_OUTLINES\n#define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER\n\n\n  typedef FT_Pointer  FT_Module_Interface;\n\n  typedef FT_Error\n  (*FT_Module_Constructor)( FT_Module  module );\n\n  typedef void\n  (*FT_Module_Destructor)( FT_Module  module );\n\n  typedef FT_Module_Interface\n  (*FT_Module_Requester)( FT_Module    module,\n                          const char*  name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Module_Class                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The module class descriptor.                                       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    module_flags    :: Bit flags describing the module.                */\n  /*                                                                       */\n  /*    module_size     :: The size of one module object/instance in       */\n  /*                       bytes.                                          */\n  /*                                                                       */\n  /*    module_name     :: The name of the module.                         */\n  /*                                                                       */\n  /*    module_version  :: The version, as a 16.16 fixed number            */\n  /*                       (major.minor).                                  */\n  /*                                                                       */\n  /*    module_requires :: The version of FreeType this module requires,   */\n  /*                       as a 16.16 fixed number (major.minor).  Starts  */\n  /*                       at version 2.0, i.e., 0x20000.                  */\n  /*                                                                       */\n  /*    module_init     :: A function used to initialize (not create) a    */\n  /*                       new module object.                              */\n  /*                                                                       */\n  /*    module_done     :: A function used to finalize (not destroy) a     */\n  /*                       given module object                             */\n  /*                                                                       */\n  /*    get_interface   :: Queries a given module for a specific           */\n  /*                       interface by name.                              */\n  /*                                                                       */\n  typedef struct  FT_Module_Class_\n  {\n    FT_ULong               module_flags;\n    FT_Long                module_size;\n    const FT_String*       module_name;\n    FT_Fixed               module_version;\n    FT_Fixed               module_requires;\n\n    const void*            module_interface;\n\n    FT_Module_Constructor  module_init;\n    FT_Module_Destructor   module_done;\n    FT_Module_Requester    get_interface;\n\n  } FT_Module_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Adds a new module to a given library instance.                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    clazz   :: A pointer to class descriptor for the module.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Add_Module( FT_Library              library,\n                 const FT_Module_Class*  clazz );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Module                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Finds a module by its name.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object.                     */\n  /*                                                                       */\n  /*    module_name :: The module's name (as an ASCII string).             */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A module handle.  0 if none was found.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    FreeType's internal modules aren't documented very well, and you   */\n  /*    should look up the source code for details.                        */\n  /*                                                                       */\n  FT_EXPORT( FT_Module )\n  FT_Get_Module( FT_Library   library,\n                 const char*  module_name );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Remove_Module                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Removes a given module from a library instance.                    */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a library object.                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    module  :: A handle to a module object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The module object is destroyed by the function in case of success. */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Remove_Module( FT_Library  library,\n                    FT_Module   module );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Library                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This function is used to create a new FreeType library instance    */\n  /*    from a given memory object.  It is thus possible to use libraries  */\n  /*    with distinct memory allocators within the same program.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    memory   :: A handle to the original memory object.                */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    alibrary :: A pointer to handle of a new library object.           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Library( FT_Memory    memory,\n                  FT_Library  *alibrary );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Library                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discards a given library object.  This closes all drivers and      */\n  /*    discards all resource objects.                                     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the target library.                         */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Library( FT_Library  library );\n\n/* */\n\n  typedef void\n  (*FT_DebugHook_Func)( void*  arg );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Debug_Hook                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Sets a debug hook function for debugging the interpreter of a font */\n  /*    format.                                                            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    hook_index :: The index of the debug hook.  You should use the     */\n  /*                  values defined in `ftobjs.h', e.g.,                  */\n  /*                  `FT_DEBUG_HOOK_TRUETYPE'.                            */\n  /*                                                                       */\n  /*    debug_hook :: The function used to debug the interpreter.          */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Currently, four debug hook slots are available, but only two (for  */\n  /*    the TrueType and the Type 1 interpreter) are defined.              */\n  /*                                                                       */\n  /*    Since the internal headers of FreeType are no longer installed,    */\n  /*    the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly.      */\n  /*    This is a bug and will be fixed in a forthcoming release.          */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Set_Debug_Hook( FT_Library         library,\n                     FT_UInt            hook_index,\n                     FT_DebugHook_Func  debug_hook );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Add_Default_Modules                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Adds the set of default drivers to a given library object.         */\n  /*    This is only useful when you create a library object with          */\n  /*    @FT_New_Library (usually to plug a custom memory manager).         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library :: A handle to a new library object.                       */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Add_Default_Modules( FT_Library  library );\n\n\n\n  /**************************************************************************\n   *\n   * @section:\n   *   truetype_engine\n   *\n   * @title:\n   *   The TrueType Engine\n   *\n   * @abstract:\n   *   TrueType bytecode support.\n   *\n   * @description:\n   *   This section contains a function used to query the level of TrueType\n   *   bytecode support compiled in this version of the library.\n   *\n   */\n\n\n  /**************************************************************************\n   *\n   *  @enum:\n   *     FT_TrueTypeEngineType\n   *\n   *  @description:\n   *     A list of values describing which kind of TrueType bytecode\n   *     engine is implemented in a given FT_Library instance.  It is used\n   *     by the @FT_Get_TrueType_Engine_Type function.\n   *\n   *  @values:\n   *     FT_TRUETYPE_ENGINE_TYPE_NONE ::\n   *       The library doesn't implement any kind of bytecode interpreter.\n   *\n   *     FT_TRUETYPE_ENGINE_TYPE_UNPATENTED ::\n   *       The library implements a bytecode interpreter that doesn't\n   *       support the patented operations of the TrueType virtual machine.\n   *\n   *       Its main use is to load certain Asian fonts which position and\n   *       scale glyph components with bytecode instructions.  It produces\n   *       bad output for most other fonts.\n   *\n   *    FT_TRUETYPE_ENGINE_TYPE_PATENTED ::\n   *       The library implements a bytecode interpreter that covers\n   *       the full instruction set of the TrueType virtual machine.\n   *       See the file `docs/PATENTS' for legal aspects.\n   *\n   *  @since:\n   *       2.2\n   *\n   */\n  typedef enum\n  {\n    FT_TRUETYPE_ENGINE_TYPE_NONE = 0,\n    FT_TRUETYPE_ENGINE_TYPE_UNPATENTED,\n    FT_TRUETYPE_ENGINE_TYPE_PATENTED\n\n  } FT_TrueTypeEngineType;\n\n\n  /**************************************************************************\n   *\n   *  @func:\n   *     FT_Get_TrueType_Engine_Type\n   *\n   *  @description:\n   *     Return a @FT_TrueTypeEngineType value to indicate which level of\n   *     the TrueType virtual machine a given library instance supports.\n   *\n   *  @input:\n   *     library ::\n   *       A library instance.\n   *\n   *  @return:\n   *     A value indicating which level is supported.\n   *\n   *  @since:\n   *     2.2\n   *\n   */\n  FT_EXPORT( FT_TrueTypeEngineType )\n  FT_Get_TrueType_Engine_Type( FT_Library  library );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTMODAPI_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftmoderr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftmoderr.h                                                             */\n/*                                                                         */\n/*    FreeType module error offsets (specification).                       */\n/*                                                                         */\n/*  Copyright 2001, 2002, 2003, 2004, 2005 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* This file is used to define the FreeType module error offsets.        */\n  /*                                                                       */\n  /* The lower byte gives the error code, the higher byte gives the        */\n  /* module.  The base module has error offset 0.  For example, the error  */\n  /* `FT_Err_Invalid_File_Format' has value 0x003, the error               */\n  /* `TT_Err_Invalid_File_Format' has value 0x1103, the error              */\n  /* `T1_Err_Invalid_File_Format' has value 0x1203, etc.                   */\n  /*                                                                       */\n  /* Undefine the macro FT_CONFIG_OPTION_USE_MODULE_ERRORS in ftoption.h   */\n  /* to make the higher byte always zero (disabling the module error       */\n  /* mechanism).                                                           */\n  /*                                                                       */\n  /* It can also be used to create a module error message table easily     */\n  /* with something like                                                   */\n  /*                                                                       */\n  /*   {                                                                   */\n  /*     #undef __FTMODERR_H__                                             */\n  /*     #define FT_MODERRDEF( e, v, s )  { FT_Mod_Err_ ## e, s },         */\n  /*     #define FT_MODERR_START_LIST     {                                */\n  /*     #define FT_MODERR_END_LIST       { 0, 0 } };                      */\n  /*                                                                       */\n  /*     const struct                                                      */\n  /*     {                                                                 */\n  /*       int          mod_err_offset;                                    */\n  /*       const char*  mod_err_msg                                        */\n  /*     } ft_mod_errors[] =                                               */\n  /*                                                                       */\n  /*     #include FT_MODULE_ERRORS_H                                       */\n  /*   }                                                                   */\n  /*                                                                       */\n  /* To use such a table, all errors must be ANDed with 0xFF00 to remove   */\n  /* the error code.                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTMODERR_H__\n#define __FTMODERR_H__\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                       SETUP MACROS                      *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#undef  FT_NEED_EXTERN_C\n\n#ifndef FT_MODERRDEF\n\n#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = v,\n#else\n#define FT_MODERRDEF( e, v, s )  FT_Mod_Err_ ## e = 0,\n#endif\n\n#define FT_MODERR_START_LIST  enum {\n#define FT_MODERR_END_LIST    FT_Mod_Err_Max };\n\n#ifdef __cplusplus\n#define FT_NEED_EXTERN_C\n  extern \"C\" {\n#endif\n\n#endif /* !FT_MODERRDEF */\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****               LIST MODULE ERROR BASES                   *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_MODERR_START_LIST\n  FT_MODERR_START_LIST\n#endif\n\n\n  FT_MODERRDEF( Base,      0x000, \"base module\" )\n  FT_MODERRDEF( Autofit,   0x100, \"autofitter module\" )\n  FT_MODERRDEF( BDF,       0x200, \"BDF module\" )\n  FT_MODERRDEF( Cache,     0x300, \"cache module\" )\n  FT_MODERRDEF( CFF,       0x400, \"CFF module\" )\n  FT_MODERRDEF( CID,       0x500, \"CID module\" )\n  FT_MODERRDEF( Gzip,      0x600, \"Gzip module\" )\n  FT_MODERRDEF( LZW,       0x700, \"LZW module\" )\n  FT_MODERRDEF( OTvalid,   0x800, \"OpenType validation module\" )\n  FT_MODERRDEF( PCF,       0x900, \"PCF module\" )\n  FT_MODERRDEF( PFR,       0xA00, \"PFR module\" )\n  FT_MODERRDEF( PSaux,     0xB00, \"PS auxiliary module\" )\n  FT_MODERRDEF( PShinter,  0xC00, \"PS hinter module\" )\n  FT_MODERRDEF( PSnames,   0xD00, \"PS names module\" )\n  FT_MODERRDEF( Raster,    0xE00, \"raster module\" )\n  FT_MODERRDEF( SFNT,      0xF00, \"SFNT module\" )\n  FT_MODERRDEF( Smooth,   0x1000, \"smooth raster module\" )\n  FT_MODERRDEF( TrueType, 0x1100, \"TrueType module\" )\n  FT_MODERRDEF( Type1,    0x1200, \"Type 1 module\" )\n  FT_MODERRDEF( Type42,   0x1300, \"Type 42 module\" )\n  FT_MODERRDEF( Winfonts, 0x1400, \"Windows FON/FNT module\" )\n\n\n#ifdef FT_MODERR_END_LIST\n  FT_MODERR_END_LIST\n#endif\n\n\n  /*******************************************************************/\n  /*******************************************************************/\n  /*****                                                         *****/\n  /*****                      CLEANUP                            *****/\n  /*****                                                         *****/\n  /*******************************************************************/\n  /*******************************************************************/\n\n\n#ifdef FT_NEED_EXTERN_C\n  }\n#endif\n\n#undef FT_MODERR_START_LIST\n#undef FT_MODERR_END_LIST\n#undef FT_MODERRDEF\n#undef FT_NEED_EXTERN_C\n\n\n#endif /* __FTMODERR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftotval.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftotval.h                                                              */\n/*                                                                         */\n/*    FreeType API for validating OpenType tables (specification).         */\n/*                                                                         */\n/*  Copyright 2004, 2005, 2006 by                                          */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n/***************************************************************************/\n/*                                                                         */\n/*                                                                         */\n/* Warning: This module might be moved to a different library in the       */\n/*          future to avoid a tight dependency between FreeType and the    */\n/*          OpenType specification.                                        */\n/*                                                                         */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOTVAL_H__\n#define __FTOTVAL_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    ot_validation                                                      */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    OpenType Validation                                                */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    An API to validate OpenType tables.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of functions to validate     */\n  /*    some OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF).               */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @enum:\n  *    FT_VALIDATE_OTXXX\n  *\n  * @description:\n  *    A list of bit-field constants used with @FT_OpenType_Validate to\n  *    indicate which OpenType tables should be validated.\n  *\n  * @values:\n  *    FT_VALIDATE_BASE ::\n  *      Validate BASE table.\n  *\n  *    FT_VALIDATE_GDEF ::\n  *      Validate GDEF table.\n  *\n  *    FT_VALIDATE_GPOS ::\n  *      Validate GPOS table.\n  *\n  *    FT_VALIDATE_GSUB ::\n  *      Validate GSUB table.\n  *\n  *    FT_VALIDATE_JSTF ::\n  *      Validate JSTF table.\n  *\n  *    FT_VALIDATE_OT ::\n  *      Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF).\n  *\n  */\n#define FT_VALIDATE_BASE  0x0100\n#define FT_VALIDATE_GDEF  0x0200\n#define FT_VALIDATE_GPOS  0x0400\n#define FT_VALIDATE_GSUB  0x0800\n#define FT_VALIDATE_JSTF  0x1000\n\n#define FT_VALIDATE_OT  FT_VALIDATE_BASE | \\\n                        FT_VALIDATE_GDEF | \\\n                        FT_VALIDATE_GPOS | \\\n                        FT_VALIDATE_GSUB | \\\n                        FT_VALIDATE_JSTF\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Validate\n  *\n  * @description:\n  *    Validate various OpenType tables to assure that all offsets and\n  *    indices are valid.  The idea is that a higher-level library which\n  *    actually does the text layout can access those tables without\n  *    error checking (which can be quite time consuming).\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    validation_flags ::\n  *       A bit field which specifies the tables to be validated.  See\n  *       @FT_VALIDATE_OTXXX for possible values.\n  *\n  * @output:\n  *    BASE_table ::\n  *       A pointer to the BASE table.\n  *\n  *    GDEF_table ::\n  *       A pointer to the GDEF table.\n  *\n  *    GPOS_table ::\n  *       A pointer to the GPOS table.\n  *\n  *    GSUB_table ::\n  *       A pointer to the GSUB table.\n  *\n  *    JSTF_table ::\n  *       A pointer to the JSTF table.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   This function only works with OpenType fonts, returning an error\n  *   otherwise.\n  *\n  *   After use, the application should deallocate the five tables with\n  *   @FT_OpenType_Free.  A NULL value indicates that the table either\n  *   doesn't exist in the font, or the application hasn't asked for\n  *   validation.\n  */\n  FT_EXPORT( FT_Error )\n  FT_OpenType_Validate( FT_Face    face,\n                        FT_UInt    validation_flags,\n                        FT_Bytes  *BASE_table,\n                        FT_Bytes  *GDEF_table,\n                        FT_Bytes  *GPOS_table,\n                        FT_Bytes  *GSUB_table,\n                        FT_Bytes  *JSTF_table );\n\n  /* */\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_OpenType_Free\n  *\n  * @description:\n  *    Free the buffer allocated by OpenType validator.\n  *\n  * @input:\n  *    face ::\n  *       A handle to the input face.\n  *\n  *    table ::\n  *       The pointer to the buffer that is allocated by\n  *       @FT_OpenType_Validate.\n  *\n  * @note:\n  *   This function must be used to free the buffer allocated by\n  *   @FT_OpenType_Validate only.\n  */\n  FT_EXPORT( void )\n  FT_OpenType_Free( FT_Face   face,\n                    FT_Bytes  table );\n\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOTVAL_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftoutln.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftoutln.h                                                              */\n/*                                                                         */\n/*    Support for the FT_Outline type used to store glyph shapes of        */\n/*    most scalable font formats (specification).                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2005, 2006, 2007 by                   */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTOUTLN_H__\n#define __FTOUTLN_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    outline_processing                                                 */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Outline Processing                                                 */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Functions to create, transform, and render vectorial glyph images. */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains routines used to create and destroy scalable */\n  /*    glyph images known as `outlines'.  These can also be measured,     */\n  /*    transformed, and converted into bitmaps and pixmaps.               */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Outline                                                         */\n  /*    FT_OUTLINE_FLAGS                                                   */\n  /*    FT_Outline_New                                                     */\n  /*    FT_Outline_Done                                                    */\n  /*    FT_Outline_Copy                                                    */\n  /*    FT_Outline_Translate                                               */\n  /*    FT_Outline_Transform                                               */\n  /*    FT_Outline_Embolden                                                */\n  /*    FT_Outline_Reverse                                                 */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /*    FT_Outline_Get_CBox                                                */\n  /*    FT_Outline_Get_BBox                                                */\n  /*                                                                       */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /*    FT_Outline_Decompose                                               */\n  /*    FT_Outline_Funcs                                                   */\n  /*    FT_Outline_MoveTo_Func                                             */\n  /*    FT_Outline_LineTo_Func                                             */\n  /*    FT_Outline_ConicTo_Func                                            */\n  /*    FT_Outline_CubicTo_Func                                            */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Decompose                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Walks over an outline's structure to decompose it into individual  */\n  /*    segments and Bézier arcs.  This function is also able to emit      */\n  /*    `move to' and `close to' operations to indicate the start and end  */\n  /*    of new contours in the outline.                                    */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline        :: A pointer to the source target.                  */\n  /*                                                                       */\n  /*    func_interface :: A table of `emitters', i.e,. function pointers   */\n  /*                      called during decomposition to indicate path     */\n  /*                      operations.                                      */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    user           :: A typeless pointer which is passed to each       */\n  /*                      emitter during the decomposition.  It can be     */\n  /*                      used to store the state during the               */\n  /*                      decomposition.                                   */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Decompose( FT_Outline*              outline,\n                        const FT_Outline_Funcs*  func_interface,\n                        void*                    user );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_New                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Creates a new outline of a given size.                             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library     :: A handle to the library object from where the       */\n  /*                   outline is allocated.  Note however that the new    */\n  /*                   outline will *not* necessarily be *freed*, when     */\n  /*                   destroying the library, by @FT_Done_FreeType.       */\n  /*                                                                       */\n  /*    numPoints   :: The maximal number of points within the outline.    */\n  /*                                                                       */\n  /*    numContours :: The maximal number of contours within the outline.  */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    anoutline   :: A handle to the new outline.  NULL in case of       */\n  /*                   error.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The reason why this function takes a `library' parameter is simply */\n  /*    to use the library's memory allocator.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_New( FT_Library   library,\n                  FT_UInt      numPoints,\n                  FT_Int       numContours,\n                  FT_Outline  *anoutline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_New_Internal( FT_Memory    memory,\n                           FT_UInt      numPoints,\n                           FT_Int       numContours,\n                           FT_Outline  *anoutline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Done                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Destroys an outline created with @FT_Outline_New.                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle of the library object used to allocate the     */\n  /*               outline.                                                */\n  /*                                                                       */\n  /*    outline :: A pointer to the outline object to be discarded.        */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If the outline's `owner' field is not set, only the outline        */\n  /*    descriptor will be released.                                       */\n  /*                                                                       */\n  /*    The reason why this function takes an `library' parameter is       */\n  /*    simply to use ft_mem_free().                                       */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done( FT_Library   library,\n                   FT_Outline*  outline );\n\n\n  FT_EXPORT( FT_Error )\n  FT_Outline_Done_Internal( FT_Memory    memory,\n                            FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Check                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Check the contents of an outline descriptor.                       */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A handle to a source outline.                           */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Check( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_CBox                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Returns an outline's `control box'.  The control box encloses all  */\n  /*    the outline's points, including Bézier control points.  Though it  */\n  /*    coincides with the exact bounding box for most glyphs, it can be   */\n  /*    slightly larger in some situations (like when rotating an outline  */\n  /*    which contains Bézier outside arcs).                               */\n  /*                                                                       */\n  /*    Computing the control box is very fast, while getting the bounding */\n  /*    box can take much more time as it needs to walk over all segments  */\n  /*    and arcs in the outline.  To get the latter, you can use the       */\n  /*    `ftbbox' component which is dedicated to this single task.         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    acbox   :: The outline's control box.                              */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Get_CBox( const FT_Outline*  outline,\n                       FT_BBox           *acbox );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Translate                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Applies a simple translation to the points of an outline.          */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    xOffset :: The horizontal offset.                                  */\n  /*                                                                       */\n  /*    yOffset :: The vertical offset.                                    */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Translate( const FT_Outline*  outline,\n                        FT_Pos             xOffset,\n                        FT_Pos             yOffset );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Copy                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Copies an outline into another one.  Both objects must have the    */\n  /*    same sizes (number of points & number of contours) when this       */\n  /*    function is called.                                                */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    source :: A handle to the source outline.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    target :: A handle to the target outline.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Copy( const FT_Outline*  source,\n                   FT_Outline        *target );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Transform                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Applies a simple 2x2 matrix to all of an outline's points.  Useful */\n  /*    for applying rotations, slanting, flipping, etc.                   */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    matrix  :: A pointer to the transformation matrix.                 */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You can use @FT_Outline_Translate if you need to translate the     */\n  /*    outline's points.                                                  */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Transform( const FT_Outline*  outline,\n                        const FT_Matrix*   matrix );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Embolden                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Emboldens an outline.  The new outline will be at most 4 times     */\n  /*    `strength' pixels wider and higher.  You may think of the left and */\n  /*    bottom borders as unchanged.                                       */\n  /*                                                                       */\n  /*    Negative `strength' values to reduce the outline thickness are     */\n  /*    possible also.                                                     */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline  :: A handle to the target outline.                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    strength :: How strong the glyph is emboldened.  Expressed in      */\n  /*                26.6 pixel format.                                     */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The used algorithm to increase or decrease the thickness of the    */\n  /*    glyph doesn't change the number of points; this means that certain */\n  /*    situations like acute angles or intersections are sometimes        */\n  /*    handled incorrectly.                                               */\n  /*                                                                       */\n  /*    Example call:                                                      */\n  /*                                                                       */\n  /*    {                                                                  */\n  /*      FT_Load_Glyph( face, index, FT_LOAD_DEFAULT );                   */\n  /*      if ( face->slot->format == FT_GLYPH_FORMAT_OUTLINE )             */\n  /*        FT_Outline_Embolden( &face->slot->outline, strength );         */\n  /*    }                                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Embolden( FT_Outline*  outline,\n                       FT_Pos       strength );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Reverse                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Reverses the drawing direction of an outline.  This is used to     */\n  /*    ensure consistent fill conventions for mirrored glyphs.            */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    outline :: A pointer to the target outline descriptor.             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This functions toggles the bit flag @FT_OUTLINE_REVERSE_FILL in    */\n  /*    the outline's `flags' field.                                       */\n  /*                                                                       */\n  /*    It shouldn't be used by a normal client application, unless it     */\n  /*    knows what it is doing.                                            */\n  /*                                                                       */\n  FT_EXPORT( void )\n  FT_Outline_Reverse( FT_Outline*  outline );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Get_Bitmap                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Renders an outline within a bitmap.  The outline's image is simply */\n  /*    OR-ed to the target bitmap.                                        */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    abitmap :: A pointer to the target bitmap descriptor.              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This function does NOT CREATE the bitmap, it only renders an       */\n  /*    outline image within the one you pass to it!                       */\n  /*                                                                       */\n  /*    It will use the raster corresponding to the default glyph format.  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Get_Bitmap( FT_Library        library,\n                         FT_Outline*       outline,\n                         const FT_Bitmap  *abitmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Outline_Render                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Renders an outline within a bitmap using the current scan-convert. */\n  /*    This functions uses an @FT_Raster_Params structure as an argument, */\n  /*    allowing advanced features like direct composition, translucency,  */\n  /*    etc.                                                               */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to a FreeType library object.                  */\n  /*                                                                       */\n  /*    outline :: A pointer to the source outline descriptor.             */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    params  :: A pointer to an @FT_Raster_Params structure used to     */\n  /*               describe the rendering operation.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You should know what you are doing and how @FT_Raster_Params works */\n  /*    to use this function.                                              */\n  /*                                                                       */\n  /*    The field `params.source' will be set to `outline' before the scan */\n  /*    converter is called, which means that the value you give to it is  */\n  /*    actually ignored.                                                  */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Outline_Render( FT_Library         library,\n                     FT_Outline*        outline,\n                     FT_Raster_Params*  params );\n\n\n /**************************************************************************\n  *\n  * @enum:\n  *   FT_Orientation\n  *\n  * @description:\n  *   A list of values used to describe an outline's contour orientation.\n  *\n  *   The TrueType and Postscript specifications use different conventions\n  *   to determine whether outline contours should be filled or unfilled.\n  *\n  * @values:\n  *   FT_ORIENTATION_TRUETYPE ::\n  *     According to the TrueType specification, clockwise contours must\n  *     be filled, and counter-clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_POSTSCRIPT ::\n  *     According to the Postscript specification, counter-clockwise contours\n  *     must be filled, and clockwise ones must be unfilled.\n  *\n  *   FT_ORIENTATION_FILL_RIGHT ::\n  *     This is identical to @FT_ORIENTATION_TRUETYPE, but is used to\n  *     remember that in TrueType, everything that is to the right of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_FILL_LEFT ::\n  *     This is identical to @FT_ORIENTATION_POSTSCRIPT, but is used to\n  *     remember that in Postscript, everything that is to the left of\n  *     the drawing direction of a contour must be filled.\n  *\n  *   FT_ORIENTATION_NONE ::\n  *     The orientation cannot be determined.  That is, different parts of\n  *     the glyph have different orientation.\n  *\n  */\n  typedef enum\n  {\n    FT_ORIENTATION_TRUETYPE   = 0,\n    FT_ORIENTATION_POSTSCRIPT = 1,\n    FT_ORIENTATION_FILL_RIGHT = FT_ORIENTATION_TRUETYPE,\n    FT_ORIENTATION_FILL_LEFT  = FT_ORIENTATION_POSTSCRIPT,\n    FT_ORIENTATION_NONE\n\n  } FT_Orientation;\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Outline_Get_Orientation\n  *\n  * @description:\n  *   This function analyzes a glyph outline and tries to compute its\n  *   fill orientation (see @FT_Orientation).  This is done by computing\n  *   the direction of each global horizontal and/or vertical extrema\n  *   within the outline.\n  *\n  *   Note that this will return @FT_ORIENTATION_TRUETYPE for empty\n  *   outlines.\n  *\n  * @input:\n  *   outline ::\n  *     A handle to the source outline.\n  *\n  * @return:\n  *   The orientation.\n  *\n  */\n  FT_EXPORT( FT_Orientation )\n  FT_Outline_Get_Orientation( FT_Outline*  outline );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTOUTLN_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftpfr.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftpfr.h                                                                */\n/*                                                                         */\n/*    FreeType API for accessing PFR-specific data (specification only).   */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTPFR_H__\n#define __FTPFR_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    pfr_fonts                                                          */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    PFR Fonts                                                          */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    PFR/TrueDoc specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of PFR-specific functions.   */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Metrics\n  *\n  * @description:\n  *    Return the outline and metrics resolutions of a given PFR face.\n  *\n  * @input:\n  *    face :: Handle to the input face.  It can be a non-PFR face.\n  *\n  * @output:\n  *    aoutline_resolution ::\n  *      Outline resolution.  This is equivalent to `face->units_per_EM'.\n  *      Optional (parameter can be NULL).\n  *\n  *    ametrics_resolution ::\n  *      Metrics resolution.  This is equivalent to `outline_resolution'\n  *      for non-PFR fonts.  Optional (parameter can be NULL).\n  *\n  *    ametrics_x_scale ::\n  *      A 16.16 fixed-point number used to scale distance expressed\n  *      in metrics units to device sub-pixels.  This is equivalent to\n  *      `face->size->x_scale', but for metrics only.  Optional (parameter\n  *      can be NULL)\n  *\n  *    ametrics_y_scale ::\n  *      Same as `ametrics_x_scale' but for the vertical direction.\n  *      optional (parameter can be NULL)\n  *\n  * @return:\n  *    FreeType error code.  0 means success.\n  *\n  * @note:\n  *   If the input face is not a PFR, this function will return an error.\n  *   However, in all cases, it will return valid values.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Metrics( FT_Face    face,\n                      FT_UInt   *aoutline_resolution,\n                      FT_UInt   *ametrics_resolution,\n                      FT_Fixed  *ametrics_x_scale,\n                      FT_Fixed  *ametrics_y_scale );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Kerning\n  *\n  * @description:\n  *    Return the kerning pair corresponding to two glyphs in a PFR face.\n  *    The distance is expressed in metrics units, unlike the result of\n  *    @FT_Get_Kerning.\n  *\n  * @input:\n  *    face  :: A handle to the input face.\n  *\n  *    left  :: Index of the left glyph.\n  *\n  *    right :: Index of the right glyph.\n  *\n  * @output:\n  *    avector :: A kerning vector.\n  *\n  * @return:\n  *    FreeType error code.  0 means success.\n  *\n  * @note:\n  *    This function always return distances in original PFR metrics\n  *    units.  This is unlike @FT_Get_Kerning with the @FT_KERNING_UNSCALED\n  *    mode, which always returns distances converted to outline units.\n  *\n  *    You can use the value of the `x_scale' and `y_scale' parameters\n  *    returned by @FT_Get_PFR_Metrics to scale these to device sub-pixels.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Kerning( FT_Face     face,\n                      FT_UInt     left,\n                      FT_UInt     right,\n                      FT_Vector  *avector );\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_PFR_Advance\n  *\n  * @description:\n  *    Return a given glyph advance, expressed in original metrics units,\n  *    from a PFR font.\n  *\n  * @input:\n  *    face   :: A handle to the input face.\n  *\n  *    gindex :: The glyph index.\n  *\n  * @output:\n  *    aadvance :: The glyph advance in metrics units.\n  *\n  * @return:\n  *    FreeType error code.  0 means success.\n  *\n  * @note:\n  *    You can use the `x_scale' or `y_scale' results of @FT_Get_PFR_Metrics\n  *    to convert the advance to device sub-pixels (i.e., 1/64th of pixels).\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PFR_Advance( FT_Face   face,\n                      FT_UInt   gindex,\n                      FT_Pos   *aadvance );\n\n /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTPFR_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftrender.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftrender.h                                                             */\n/*                                                                         */\n/*    FreeType renderer modules public interface (specification).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2005, 2006 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTRENDER_H__\n#define __FTRENDER_H__\n\n\n#include <ft2build.h>\n#include FT_MODULE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    module_management                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* create a new glyph object */\n  typedef FT_Error\n  (*FT_Glyph_InitFunc)( FT_Glyph      glyph,\n                        FT_GlyphSlot  slot );\n\n  /* destroys a given glyph object */\n  typedef void\n  (*FT_Glyph_DoneFunc)( FT_Glyph  glyph );\n\n  typedef void\n  (*FT_Glyph_TransformFunc)( FT_Glyph          glyph,\n                             const FT_Matrix*  matrix,\n                             const FT_Vector*  delta );\n\n  typedef void\n  (*FT_Glyph_GetBBoxFunc)( FT_Glyph  glyph,\n                           FT_BBox*  abbox );\n\n  typedef FT_Error\n  (*FT_Glyph_CopyFunc)( FT_Glyph   source,\n                        FT_Glyph   target );\n\n  typedef FT_Error\n  (*FT_Glyph_PrepareFunc)( FT_Glyph      glyph,\n                           FT_GlyphSlot  slot );\n\n/* deprecated */\n#define FT_Glyph_Init_Func       FT_Glyph_InitFunc\n#define FT_Glyph_Done_Func       FT_Glyph_DoneFunc\n#define FT_Glyph_Transform_Func  FT_Glyph_TransformFunc\n#define FT_Glyph_BBox_Func       FT_Glyph_GetBBoxFunc\n#define FT_Glyph_Copy_Func       FT_Glyph_CopyFunc\n#define FT_Glyph_Prepare_Func    FT_Glyph_PrepareFunc\n\n\n  struct  FT_Glyph_Class_\n  {\n    FT_Long                 glyph_size;\n    FT_Glyph_Format         glyph_format;\n    FT_Glyph_InitFunc       glyph_init;\n    FT_Glyph_DoneFunc       glyph_done;\n    FT_Glyph_CopyFunc       glyph_copy;\n    FT_Glyph_TransformFunc  glyph_transform;\n    FT_Glyph_GetBBoxFunc    glyph_bbox;\n    FT_Glyph_PrepareFunc    glyph_prepare;\n  };\n\n\n  typedef FT_Error\n  (*FT_Renderer_RenderFunc)( FT_Renderer       renderer,\n                             FT_GlyphSlot      slot,\n                             FT_UInt           mode,\n                             const FT_Vector*  origin );\n\n  typedef FT_Error\n  (*FT_Renderer_TransformFunc)( FT_Renderer       renderer,\n                                FT_GlyphSlot      slot,\n                                const FT_Matrix*  matrix,\n                                const FT_Vector*  delta );\n\n\n  typedef void\n  (*FT_Renderer_GetCBoxFunc)( FT_Renderer   renderer,\n                              FT_GlyphSlot  slot,\n                              FT_BBox*      cbox );\n\n\n  typedef FT_Error\n  (*FT_Renderer_SetModeFunc)( FT_Renderer  renderer,\n                              FT_ULong     mode_tag,\n                              FT_Pointer   mode_ptr );\n\n/* deprecated identifiers */\n#define FTRenderer_render  FT_Renderer_RenderFunc\n#define FTRenderer_transform  FT_Renderer_TransformFunc\n#define FTRenderer_getCBox  FT_Renderer_GetCBoxFunc\n#define FTRenderer_setMode  FT_Renderer_SetModeFunc\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Renderer_Class                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The renderer module class descriptor.                              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    root         :: The root @FT_Module_Class fields.                  */\n  /*                                                                       */\n  /*    glyph_format :: The glyph image format this renderer handles.      */\n  /*                                                                       */\n  /*    render_glyph :: A method used to render the image that is in a     */\n  /*                    given glyph slot into a bitmap.                    */\n  /*                                                                       */\n  /*    set_mode     :: A method used to pass additional parameters.       */\n  /*                                                                       */\n  /*    raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.  This */\n  /*                    is a pointer to its raster's class.                */\n  /*                                                                       */\n  /*    raster       :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.  This */\n  /*                    is a pointer to the corresponding raster object,   */\n  /*                    if any.                                            */\n  /*                                                                       */\n  typedef struct  FT_Renderer_Class_\n  {\n    FT_Module_Class       root;\n\n    FT_Glyph_Format       glyph_format;\n\n    FT_Renderer_RenderFunc     render_glyph;\n    FT_Renderer_TransformFunc  transform_glyph;\n    FT_Renderer_GetCBoxFunc    get_glyph_cbox;\n    FT_Renderer_SetModeFunc    set_mode;\n\n    FT_Raster_Funcs*           raster_class;\n\n  } FT_Renderer_Class;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieves the current renderer for a given glyph format.           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    library :: A handle to the library object.                         */\n  /*                                                                       */\n  /*    format  :: The glyph format.                                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A renderer handle.  0 if none found.                               */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    An error will be returned if a module already exists by that name, */\n  /*    or if the module requires a version of FreeType that is too great. */\n  /*                                                                       */\n  /*    To add a new renderer, simply use @FT_Add_Module.  To retrieve a   */\n  /*    renderer by its name, use @FT_Get_Module.                          */\n  /*                                                                       */\n  FT_EXPORT( FT_Renderer )\n  FT_Get_Renderer( FT_Library       library,\n                   FT_Glyph_Format  format );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Set_Renderer                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Sets the current renderer to use, and set additional mode.         */\n  /*                                                                       */\n  /* <InOut>                                                               */\n  /*    library    :: A handle to the library object.                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    renderer   :: A handle to the renderer object.                     */\n  /*                                                                       */\n  /*    num_params :: The number of additional parameters.                 */\n  /*                                                                       */\n  /*    parameters :: Additional parameters.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    In case of success, the renderer will be used to convert glyph     */\n  /*    images in the renderer's known format into bitmaps.                */\n  /*                                                                       */\n  /*    This doesn't change the current renderer for other formats.        */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Set_Renderer( FT_Library     library,\n                   FT_Renderer    renderer,\n                   FT_UInt        num_params,\n                   FT_Parameter*  parameters );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTRENDER_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftsizes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsizes.h                                                              */\n/*                                                                         */\n/*    FreeType size objects management (specification).                    */\n/*                                                                         */\n/*  Copyright 1996-2001, 2003, 2004, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Typical application would normally not need to use these functions.   */\n  /* However, they have been placed in a public API for the rare cases     */\n  /* where they are needed.                                                */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n#ifndef __FTSIZES_H__\n#define __FTSIZES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sizes_management                                                   */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Size Management                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Managing multiple sizes per face.                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    When creating a new face object (e.g., with @FT_New_Face), an      */\n  /*    @FT_Size object is automatically created and used to store all     */\n  /*    pixel-size dependent information, available in the `face->size'    */\n  /*    field.                                                             */\n  /*                                                                       */\n  /*    It is however possible to create more sizes for a given face,      */\n  /*    mostly in order to manage several character pixel sizes of the     */\n  /*    same font family and style.  See @FT_New_Size and @FT_Done_Size.   */\n  /*                                                                       */\n  /*    Note that @FT_Set_Pixel_Sizes and @FT_Set_Char_Size only           */\n  /*    modify the contents of the current `active' size; you thus need    */\n  /*    to use @FT_Activate_Size to change it.                             */\n  /*                                                                       */\n  /*    99% of applications won't need the functions provided here,        */\n  /*    especially if they use the caching sub-system, so be cautious      */\n  /*    when using these.                                                  */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_New_Size                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Create a new size object from a given face object.                 */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to a parent face object.                          */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    asize :: A handle to a new size object.                            */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    You need to call @FT_Activate_Size in order to select the new size */\n  /*    for upcoming calls to @FT_Set_Pixel_Sizes, @FT_Set_Char_Size,      */\n  /*    @FT_Load_Glyph, @FT_Load_Char, etc.                                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_New_Size( FT_Face   face,\n               FT_Size*  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Done_Size                                                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Discard a given size object.  Note that @FT_Done_Face              */\n  /*    automatically discards all size objects allocated with             */\n  /*    @FT_New_Size.                                                      */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Done_Size( FT_Size  size );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Activate_Size                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Even though it is possible to create several size objects for a    */\n  /*    given face (see @FT_New_Size for details), functions like          */\n  /*    @FT_Load_Glyph or @FT_Load_Char only use the last-created one to   */\n  /*    determine the `current character pixel size'.                      */\n  /*                                                                       */\n  /*    This function can be used to `activate' a previously created size  */\n  /*    object.                                                            */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    size :: A handle to a target size object.                          */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    If `face' is the size's parent face object, this function changes  */\n  /*    the value of `face->size' to the input size handle.                */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Activate_Size( FT_Size  size );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSIZES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftsnames.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsnames.h                                                             */\n/*                                                                         */\n/*    Simple interface to access SFNT name tables (which are used          */\n/*    to hold font names, copyright info, notices, etc.) (specification).  */\n/*                                                                         */\n/*    This is _not_ used to retrieve glyph names!                          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2006 by                               */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_SFNT_NAMES_H__\n#define __FT_SFNT_NAMES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    sfnt_names                                                         */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    SFNT Names                                                         */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Access the names embedded in TrueType and OpenType files.          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The TrueType and OpenType specification allow the inclusion of     */\n  /*    a special `names table' in font files.  This table contains        */\n  /*    textual (and internationalized) information regarding the font,    */\n  /*    like family name, copyright, version, etc.                         */\n  /*                                                                       */\n  /*    The definitions below are used to access them if available.        */\n  /*                                                                       */\n  /*    Note that this has nothing to do with glyph names!                 */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_SfntName                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model an SFNT `name' table entry.              */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    platform_id :: The platform ID for `string'.                       */\n  /*                                                                       */\n  /*    encoding_id :: The encoding ID for `string'.                       */\n  /*                                                                       */\n  /*    language_id :: The language ID for `string'.                       */\n  /*                                                                       */\n  /*    name_id     :: An identifier for `string'.                         */\n  /*                                                                       */\n  /*    string      :: The `name' string.  Note that its format differs    */\n  /*                   depending on the (platform,encoding) pair.  It can  */\n  /*                   be a Pascal String, a UTF-16 one, etc.              */\n  /*                                                                       */\n  /*                   Generally speaking, the string is not               */\n  /*                   zero-terminated.  Please refer to the TrueType      */\n  /*                   specification for details.                          */\n  /*                                                                       */\n  /*    string_len  :: The length of `string' in bytes.                    */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    Possible values for `platform_id', `encoding_id', `language_id',   */\n  /*    and `name_id' are given in the file `ttnameid.h'.  For details     */\n  /*    please refer to the TrueType or OpenType specification.            */\n  /*                                                                       */\n  /*    See also @TT_PLATFORM_XXX, @TT_APPLE_ID_XXX, @TT_MAC_ID_XXX,       */\n  /*    @TT_ISO_ID_XXX, and @TT_MS_ID_XXX.                                 */\n  /*                                                                       */\n  typedef struct  FT_SfntName_\n  {\n    FT_UShort  platform_id;\n    FT_UShort  encoding_id;\n    FT_UShort  language_id;\n    FT_UShort  name_id;\n\n    FT_Byte*   string;      /* this string is *not* null-terminated! */\n    FT_UInt    string_len;  /* in bytes */\n\n  } FT_SfntName;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name_Count                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieves the number of name strings in the SFNT `name' table.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source face.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The number of strings in the `name' table.                         */\n  /*                                                                       */\n  FT_EXPORT( FT_UInt )\n  FT_Get_Sfnt_Name_Count( FT_Face  face );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Name                                                   */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Retrieves a string of the SFNT `name' table for a given index.     */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face  :: A handle to the source face.                              */\n  /*                                                                       */\n  /*    idx   :: The index of the `name' string.                           */\n  /*                                                                       */\n  /* <Output>                                                              */\n  /*    aname :: The indexed @FT_SfntName structure.                       */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    FreeType error code.  0 means success.                             */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The `string' array returned in the `aname' structure is not        */\n  /*    null-terminated.                                                   */\n  /*                                                                       */\n  /*    Use @FT_Get_Sfnt_Name_Count to get the total number of available   */\n  /*    `name' table entries, then do a loop until you get the right       */\n  /*    platform, encoding, and name ID.                                   */\n  /*                                                                       */\n  FT_EXPORT( FT_Error )\n  FT_Get_Sfnt_Name( FT_Face       face,\n                    FT_UInt       idx,\n                    FT_SfntName  *aname );\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FT_SFNT_NAMES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftstroke.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftstroke.h                                                             */\n/*                                                                         */\n/*    FreeType path stroker (specification).                               */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2005, 2006 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FT_STROKE_H__\n#define __FT_STROKE_H__\n\n#include <ft2build.h>\n#include FT_OUTLINE_H\n#include FT_GLYPH_H\n\n\nFT_BEGIN_HEADER\n\n\n /************************************************************************\n  *\n  * @section:\n  *    glyph_stroker\n  *\n  * @title:\n  *    Glyph Stroker\n  *\n  * @abstract:\n  *    Generating bordered and stroked glyphs.\n  *\n  * @description:\n  *    This component generates stroked outlines of a given vectorial\n  *    glyph.  It also allows you to retrieve the `outside' and/or the\n  *    `inside' borders of the stroke.\n  *\n  *    This can be useful to generate `bordered' glyph, i.e., glyphs\n  *    displayed with a coloured (and anti-aliased) border around their\n  *    shape.\n  */\n\n\n /**************************************************************\n  *\n  * @type:\n  *   FT_Stroker\n  *\n  * @description:\n  *   Opaque handler to a path stroker object.\n  */\n  typedef struct FT_StrokerRec_*  FT_Stroker;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineJoin\n   *\n   * @description:\n   *   These values determine how two joining lines are rendered\n   *   in a stroker.\n   *\n   * @values:\n   *   FT_STROKER_LINEJOIN_ROUND ::\n   *     Used to render rounded line joins.  Circular arcs are used\n   *     to join two lines smoothly.\n   *\n   *   FT_STROKER_LINEJOIN_BEVEL ::\n   *     Used to render beveled line joins; i.e., the two joining lines\n   *     are extended until they intersect.\n   *\n   *   FT_STROKER_LINEJOIN_MITER ::\n   *     Same as beveled rendering, except that an additional line\n   *     break is added if the angle between the two joining lines\n   *     is too closed (this is useful to avoid unpleasant spikes\n   *     in beveled rendering).\n   */\n  typedef enum\n  {\n    FT_STROKER_LINEJOIN_ROUND = 0,\n    FT_STROKER_LINEJOIN_BEVEL,\n    FT_STROKER_LINEJOIN_MITER\n\n  } FT_Stroker_LineJoin;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_Stroker_LineCap\n   *\n   * @description:\n   *   These values determine how the end of opened sub-paths are\n   *   rendered in a stroke.\n   *\n   * @values:\n   *   FT_STROKER_LINECAP_BUTT ::\n   *     The end of lines is rendered as a full stop on the last\n   *     point itself.\n   *\n   *   FT_STROKER_LINECAP_ROUND ::\n   *     The end of lines is rendered as a half-circle around the\n   *     last point.\n   *\n   *   FT_STROKER_LINECAP_SQUARE ::\n   *     The end of lines is rendered as a square around the\n   *     last point.\n   */\n  typedef enum\n  {\n    FT_STROKER_LINECAP_BUTT = 0,\n    FT_STROKER_LINECAP_ROUND,\n    FT_STROKER_LINECAP_SQUARE\n\n  } FT_Stroker_LineCap;\n\n\n  /**************************************************************\n   *\n   * @enum:\n   *   FT_StrokerBorder\n   *\n   * @description:\n   *   These values are used to select a given stroke border\n   *   in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.\n   *\n   * @values:\n   *   FT_STROKER_BORDER_LEFT ::\n   *     Select the left border, relative to the drawing direction.\n   *\n   *   FT_STROKER_BORDER_RIGHT ::\n   *     Select the right border, relative to the drawing direction.\n   *\n   * @note:\n   *   Applications are generally interested in the `inside' and `outside'\n   *   borders.  However, there is no direct mapping between these and the\n   *   `left' and `right' ones, since this really depends on the glyph's\n   *   drawing orientation, which varies between font formats.\n   *\n   *   You can however use @FT_Outline_GetInsideBorder and\n   *   @FT_Outline_GetOutsideBorder to get these.\n   */\n  typedef enum\n  {\n    FT_STROKER_BORDER_LEFT = 0,\n    FT_STROKER_BORDER_RIGHT\n\n  } FT_StrokerBorder;\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetInsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `inside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetInsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Outline_GetOutsideBorder\n   *\n   * @description:\n   *   Retrieve the @FT_StrokerBorder value corresponding to the\n   *   `outside' borders of a given outline.\n   *\n   * @input:\n   *   outline ::\n   *     The source outline handle.\n   *\n   * @return:\n   *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid\n   *   outlines.\n   */\n  FT_EXPORT( FT_StrokerBorder )\n  FT_Outline_GetOutsideBorder( FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_New\n   *\n   * @description:\n   *   Create a new stroker object.\n   *\n   * @input:\n   *   library ::\n   *     FreeType library handle.\n   *\n   * @output:\n   *   astroker ::\n   *     A new stroker object handle.  NULL in case of error.\n   *\n   * @return:\n   *    FreeType error code.  0 means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_New( FT_Library   library,\n                  FT_Stroker  *astroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Set\n   *\n   * @description:\n   *   Reset a stroker object's attributes.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   radius ::\n   *     The border radius.\n   *\n   *   line_cap ::\n   *     The line cap style.\n   *\n   *   line_join ::\n   *     The line join style.\n   *\n   *   miter_limit ::\n   *     The miter limit for the FT_STROKER_LINEJOIN_MITER style,\n   *     expressed as 16.16 fixed point value.\n   *\n   * @note:\n   *   The radius is expressed in the same units that the outline\n   *   coordinates.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Set( FT_Stroker           stroker,\n                  FT_Fixed             radius,\n                  FT_Stroker_LineCap   line_cap,\n                  FT_Stroker_LineJoin  line_join,\n                  FT_Fixed             miter_limit );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Rewind\n   *\n   * @description:\n   *   Reset a stroker object without changing its attributes.\n   *   You should call this function before beginning a new\n   *   series of calls to @FT_Stroker_BeginSubPath or\n   *   @FT_Stroker_EndSubPath.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Rewind( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ParseOutline\n   *\n   * @description:\n   *   A convenience function used to parse a whole outline with\n   *   the stroker.  The resulting outline(s) can be retrieved\n   *   later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The source outline.\n   *\n   *   opened ::\n   *     A boolean.  If 1, the outline is treated as an open path instead\n   *     of a closed one.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   If `opened' is 0 (the default), the outline is treated as a closed\n   *   path, and the stroker will generate two distinct `border' outlines.\n   *\n   *   If `opened' is 1, the outline is processed as an open path, and the\n   *   stroker will generate a single `stroke' outline.\n   *\n   *   This function calls @FT_Stroker_Rewind automatically.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ParseOutline( FT_Stroker   stroker,\n                           FT_Outline*  outline,\n                           FT_Bool      opened );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_BeginSubPath\n   *\n   * @description:\n   *   Start a new sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the start vector.\n   *\n   *   open ::\n   *     A boolean.  If 1, the sub-path is treated as an open one.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   This function is useful when you need to stroke a path that is\n   *   not stored as an @FT_Outline object.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_BeginSubPath( FT_Stroker  stroker,\n                           FT_Vector*  to,\n                           FT_Bool     open );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_EndSubPath\n   *\n   * @description:\n   *   Close the current sub-path in the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   You should call this function after @FT_Stroker_BeginSubPath.\n   *   If the subpath was not `opened', this function will `draw' a\n   *   single line segment to the start position when needed.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_EndSubPath( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_LineTo\n   *\n   * @description:\n   *   `Draw' a single line segment in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_LineTo( FT_Stroker  stroker,\n                     FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ConicTo\n   *\n   * @description:\n   *   `Draw' a single quadratic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control ::\n   *     A pointer to a Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_ConicTo( FT_Stroker  stroker,\n                      FT_Vector*  control,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_CubicTo\n   *\n   * @description:\n   *   `Draw' a single cubic Bézier in the stroker's current sub-path,\n   *   from the last position.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   control1 ::\n   *     A pointer to the first Bézier control point.\n   *\n   *   control2 ::\n   *     A pointer to second Bézier control point.\n   *\n   *   to ::\n   *     A pointer to the destination point.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   You should call this function between @FT_Stroker_BeginSubPath and\n   *   @FT_Stroker_EndSubPath.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_CubicTo( FT_Stroker  stroker,\n                      FT_Vector*  control1,\n                      FT_Vector*  control2,\n                      FT_Vector*  to );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetBorderCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It will return the number of points and\n   *   contours necessary to export one of the `border' or `stroke'\n   *   outlines generated by the stroker.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   *\n   * @note:\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'.\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps.  The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_GetCounts instead if you want to\n   *   retrieve the counts associated to both borders.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,\n                              FT_StrokerBorder  border,\n                              FT_UInt          *anum_points,\n                              FT_UInt          *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_ExportBorder\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export the corresponding border to your own @FT_Outline\n   *   structure.\n   *\n   *   Note that this function will append the border points and\n   *   contours to your outline, but will not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   border ::\n   *     The border index.\n   *\n   *   outline ::\n   *     The target outline handle.\n   *\n   * @note:\n   *   Always call this function after @FT_Stroker_GetBorderCounts to\n   *   get sure that there is enough room in your @FT_Outline object to\n   *   receive all new data.\n   *\n   *   When an outline, or a sub-path, is `closed', the stroker generates\n   *   two independent `border' outlines, named `left' and `right'\n   *\n   *   When the outline, or a sub-path, is `opened', the stroker merges\n   *   the `border' outlines with caps. The `left' border receives all\n   *   points, while the `right' border becomes empty.\n   *\n   *   Use the function @FT_Stroker_Export instead if you want to\n   *   retrieve all borders at once.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_ExportBorder( FT_Stroker        stroker,\n                           FT_StrokerBorder  border,\n                           FT_Outline*       outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_GetCounts\n   *\n   * @description:\n   *   Call this function once you have finished parsing your paths\n   *   with the stroker.  It returns the number of points and\n   *   contours necessary to export all points/borders from the stroked\n   *   outline/path.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   * @output:\n   *   anum_points ::\n   *     The number of points.\n   *\n   *   anum_contours ::\n   *     The number of contours.\n   *\n   * @return:\n   *   FreeType error code.  0 means success.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Stroker_GetCounts( FT_Stroker  stroker,\n                        FT_UInt    *anum_points,\n                        FT_UInt    *anum_contours );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Export\n   *\n   * @description:\n   *   Call this function after @FT_Stroker_GetBorderCounts to\n   *   export the all borders to your own @FT_Outline structure.\n   *\n   *   Note that this function will append the border points and\n   *   contours to your outline, but will not try to resize its\n   *   arrays.\n   *\n   * @input:\n   *   stroker ::\n   *     The target stroker handle.\n   *\n   *   outline ::\n   *     The target outline handle.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Export( FT_Stroker   stroker,\n                     FT_Outline*  outline );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Stroker_Done\n   *\n   * @description:\n   *   Destroy a stroker object.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.  Can be NULL.\n   */\n  FT_EXPORT( void )\n  FT_Stroker_Done( FT_Stroker  stroker );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_Stroke\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   destroy ::\n   *     A Boolean.  If 1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_Stroke( FT_Glyph    *pglyph,\n                   FT_Stroker   stroker,\n                   FT_Bool      destroy );\n\n\n  /**************************************************************\n   *\n   * @function:\n   *   FT_Glyph_StrokeBorder\n   *\n   * @description:\n   *   Stroke a given outline glyph object with a given stroker, but\n   *   only return either its inside or outside border.\n   *\n   * @inout:\n   *   pglyph ::\n   *     Source glyph handle on input, new glyph handle on output.\n   *\n   * @input:\n   *   stroker ::\n   *     A stroker handle.\n   *\n   *   inside ::\n   *     A Boolean.  If 1, return the inside border, otherwise\n   *     the outside border.\n   *\n   *   destroy ::\n   *     A Boolean.  If 1, the source glyph object is destroyed\n   *     on success.\n   *\n   * @return:\n   *    FreeType error code.  0 means success.\n   *\n   * @note:\n   *   The source glyph is untouched in case of error.\n   */\n  FT_EXPORT( FT_Error )\n  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,\n                         FT_Stroker   stroker,\n                         FT_Bool      inside,\n                         FT_Bool      destroy );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FT_STROKE_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftsynth.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsynth.h                                                              */\n/*                                                                         */\n/*    FreeType synthesizing code for emboldening and slanting              */\n/*    (specification).                                                     */\n/*                                                                         */\n/*  Copyright 2000-2001, 2003, 2006 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*********                                                       *********/\n  /*********        WARNING, THIS IS ALPHA CODE, THIS API          *********/\n  /*********    IS DUE TO CHANGE UNTIL STRICTLY NOTIFIED BY THE    *********/\n  /*********            FREETYPE DEVELOPMENT TEAM                  *********/\n  /*********                                                       *********/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n#ifndef __FTSYNTH_H__\n#define __FTSYNTH_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /* Make sure slot owns slot->bitmap. */\n  FT_EXPORT( FT_Error )\n  FT_GlyphSlot_Own_Bitmap( FT_GlyphSlot  slot );\n\n  /* Do not use this function directly!  Copy the code to */\n  /* your application and modify it to suit your need.    */\n  FT_EXPORT( void )\n  FT_GlyphSlot_Embolden( FT_GlyphSlot  slot );\n\n\n  FT_EXPORT( void )\n  FT_GlyphSlot_Oblique( FT_GlyphSlot  slot );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTSYNTH_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftsystem.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftsystem.h                                                             */\n/*                                                                         */\n/*    FreeType low-level system interface definition (specification).      */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2005 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTSYSTEM_H__\n#define __FTSYSTEM_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   system_interface                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   System Interface                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   How FreeType manages memory and i/o.                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This section contains various definitions related to memory         */\n  /*   management and i/o access.  You need to understand this             */\n  /*   information if you want to use a custom memory manager or you own   */\n  /*   i/o streams.                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                  M E M O R Y   M A N A G E M E N T                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Memory\n   *\n   * @description:\n   *   A handle to a given memory manager object, defined with an\n   *   @FT_MemoryRec structure.\n   *\n   */\n  typedef struct FT_MemoryRec_*  FT_Memory;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Alloc_Func\n   *\n   * @description:\n   *   A function used to allocate `size' bytes from `memory'.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   size ::\n   *     The size in bytes to allocate.\n   *\n   * @return:\n   *   Address of new memory block.  0 in case of failure.\n   *\n   */\n  typedef void*\n  (*FT_Alloc_Func)( FT_Memory  memory,\n                    long       size );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Free_Func\n   *\n   * @description:\n   *   A function used to release a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   block ::\n   *     The address of the target memory block.\n   *\n   */\n  typedef void\n  (*FT_Free_Func)( FT_Memory  memory,\n                   void*      block );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Realloc_Func\n   *\n   * @description:\n   *   A function used to re-allocate a given block of memory.\n   *\n   * @input:\n   *   memory ::\n   *     A handle to the source memory manager.\n   *\n   *   cur_size ::\n   *     The block's current size in bytes.\n   *\n   *   new_size ::\n   *     The block's requested new size.\n   *\n   *   block ::\n   *     The block's current address.\n   *\n   * @return:\n   *   New block address.  0 in case of memory shortage.\n   *\n   * @note:\n   *   In case of error, the old block must still be available.\n   *\n   */\n  typedef void*\n  (*FT_Realloc_Func)( FT_Memory  memory,\n                      long       cur_size,\n                      long       new_size,\n                      void*      block );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_MemoryRec\n   *\n   * @description:\n   *   A structure used to describe a given memory manager to FreeType 2.\n   *\n   * @fields:\n   *   user ::\n   *     A generic typeless pointer for user data.\n   *\n   *   alloc ::\n   *     A pointer type to an allocation function.\n   *\n   *   free ::\n   *     A pointer type to an memory freeing function.\n   *\n   *   realloc ::\n   *     A pointer type to a reallocation function.\n   *\n   */\n  struct  FT_MemoryRec_\n  {\n    void*            user;\n    FT_Alloc_Func    alloc;\n    FT_Free_Func     free;\n    FT_Realloc_Func  realloc;\n  };\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /*                       I / O   M A N A G E M E N T                     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Stream\n   *\n   * @description:\n   *   A handle to an input stream.\n   *\n   */\n  typedef struct FT_StreamRec_*  FT_Stream;\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamDesc\n   *\n   * @description:\n   *   A union type used to store either a long or a pointer.  This is used\n   *   to store a file descriptor or a `FILE*' in an input stream.\n   *\n   */\n  typedef union  FT_StreamDesc_\n  {\n    long   value;\n    void*  pointer;\n\n  } FT_StreamDesc;\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_IoFunc\n   *\n   * @description:\n   *   A function used to seek and read data from a given input stream.\n   *\n   * @input:\n   *   stream ::\n   *     A handle to the source stream.\n   *\n   *   offset ::\n   *     The offset of read in stream (always from start).\n   *\n   *   buffer ::\n   *     The address of the read buffer.\n   *\n   *   count ::\n   *     The number of bytes to read from the stream.\n   *\n   * @return:\n   *   The number of bytes effectively read by the stream.\n   *\n   * @note:\n   *   This function might be called to perform a seek or skip operation\n   *   with a `count' of 0.\n   *\n   */\n  typedef unsigned long\n  (*FT_Stream_IoFunc)( FT_Stream       stream,\n                       unsigned long   offset,\n                       unsigned char*  buffer,\n                       unsigned long   count );\n\n\n  /*************************************************************************\n   *\n   * @functype:\n   *   FT_Stream_CloseFunc\n   *\n   * @description:\n   *   A function used to close a given input stream.\n   *\n   * @input:\n   *  stream ::\n   *     A handle to the target stream.\n   *\n   */\n  typedef void\n  (*FT_Stream_CloseFunc)( FT_Stream  stream );\n\n\n  /*************************************************************************\n   *\n   * @struct:\n   *   FT_StreamRec\n   *\n   * @description:\n   *   A structure used to describe an input stream.\n   *\n   * @input:\n   *   base ::\n   *     For memory-based streams, this is the address of the first stream\n   *     byte in memory.  This field should always be set to NULL for\n   *     disk-based streams.\n   *\n   *   size ::\n   *     The stream size in bytes.\n   *\n   *   pos ::\n   *     The current position within the stream.\n   *\n   *   descriptor ::\n   *     This field is a union that can hold an integer or a pointer.  It is\n   *     used by stream implementations to store file descriptors or `FILE*'\n   *     pointers.\n   *\n   *   pathname ::\n   *     This field is completely ignored by FreeType.  However, it is often\n   *     useful during debugging to use it to store the stream's filename\n   *     (where available).\n   *\n   *   read ::\n   *     The stream's input function.\n   *\n   *   close ::\n   *     The stream;s close function.\n   *\n   *   memory ::\n   *     The memory manager to use to preload frames.  This is set\n   *     internally by FreeType and shouldn't be touched by stream\n   *     implementations.\n   *\n   *   cursor ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   *   limit ::\n   *     This field is set and used internally by FreeType when parsing\n   *     frames.\n   *\n   */\n  typedef struct  FT_StreamRec_\n  {\n    unsigned char*       base;\n    unsigned long        size;\n    unsigned long        pos;\n\n    FT_StreamDesc        descriptor;\n    FT_StreamDesc        pathname;\n    FT_Stream_IoFunc     read;\n    FT_Stream_CloseFunc  close;\n\n    FT_Memory            memory;\n    unsigned char*       cursor;\n    unsigned char*       limit;\n\n  } FT_StreamRec;\n\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTSYSTEM_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/fttrigon.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttrigon.h                                                             */\n/*                                                                         */\n/*    FreeType trigonometric functions (specification).                    */\n/*                                                                         */\n/*  Copyright 2001, 2003, 2005, 2007 by                                    */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTRIGON_H__\n#define __FTTRIGON_H__\n\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   computations                                                        */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @type:\n   *   FT_Angle\n   *\n   * @description:\n   *   This type is used to model angle values in FreeType.  Note that the\n   *   angle is a 16.16 fixed float value expressed in degrees.\n   *\n   */\n  typedef FT_Fixed  FT_Angle;\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI\n   *\n   * @description:\n   *   The angle pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI  ( 180L << 16 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_2PI\n   *\n   * @description:\n   *   The angle 2*pi expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_2PI  ( FT_ANGLE_PI * 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI2\n   *\n   * @description:\n   *   The angle pi/2 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI2  ( FT_ANGLE_PI / 2 )\n\n\n  /*************************************************************************\n   *\n   * @macro:\n   *   FT_ANGLE_PI4\n   *\n   * @description:\n   *   The angle pi/4 expressed in @FT_Angle units.\n   *\n   */\n#define FT_ANGLE_PI4  ( FT_ANGLE_PI / 4 )\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Sin\n   *\n   * @description:\n   *   Return the sinus of a given angle in fixed point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The sinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Sin( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Cos\n   *\n   * @description:\n   *   Return the cosinus of a given angle in fixed point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The cosinus value.\n   *\n   * @note:\n   *   If you need both the sinus and cosinus for a given angle, use the\n   *   function @FT_Vector_Unit.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Cos( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Tan\n   *\n   * @description:\n   *   Return the tangent of a given angle in fixed point format.\n   *\n   * @input:\n   *   angle ::\n   *     The input angle.\n   *\n   * @return:\n   *   The tangent value.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Tan( FT_Angle  angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Atan2\n   *\n   * @description:\n   *   Return the arc-tangent corresponding to a given vector (x,y) in\n   *   the 2d plane.\n   *\n   * @input:\n   *   x ::\n   *     The horizontal vector coordinate.\n   *\n   *   y ::\n   *     The vertical vector coordinate.\n   *\n   * @return:\n   *   The arc-tangent value (i.e. angle).\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Atan2( FT_Fixed  x,\n            FT_Fixed  y );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Angle_Diff\n   *\n   * @description:\n   *   Return the difference between two angles.  The result is always\n   *   constrained to the ]-PI..PI] interval.\n   *\n   * @input:\n   *   angle1 ::\n   *     First angle.\n   *\n   *   angle2 ::\n   *     Second angle.\n   *\n   * @return:\n   *   Constrained value of `value2-value1'.\n   *\n   */\n  FT_EXPORT( FT_Angle )\n  FT_Angle_Diff( FT_Angle  angle1,\n                 FT_Angle  angle2 );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Unit\n   *\n   * @description:\n   *   Return the unit vector corresponding to a given angle.  After the\n   *   call, the value of `vec.x' will be `sin(angle)', and the value of\n   *   `vec.y' will be `cos(angle)'.\n   *\n   *   This function is useful to retrieve both the sinus and cosinus of a\n   *   given angle quickly.\n   *\n   * @output:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Unit( FT_Vector*  vec,\n                  FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Rotate\n   *\n   * @description:\n   *   Rotate a vector by a given angle.\n   *\n   * @inout:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @input:\n   *   angle ::\n   *     The address of angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Rotate( FT_Vector*  vec,\n                    FT_Angle    angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Length\n   *\n   * @description:\n   *   Return the length of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of target vector.\n   *\n   * @return:\n   *   The vector length, expressed in the same units that the original\n   *   vector coordinates.\n   *\n   */\n  FT_EXPORT( FT_Fixed )\n  FT_Vector_Length( FT_Vector*  vec );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_Polarize\n   *\n   * @description:\n   *   Compute both the length and angle of a given vector.\n   *\n   * @input:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @output:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_Polarize( FT_Vector*  vec,\n                      FT_Fixed   *length,\n                      FT_Angle   *angle );\n\n\n  /*************************************************************************\n   *\n   * @function:\n   *   FT_Vector_From_Polar\n   *\n   * @description:\n   *   Compute vector coordinates from a length and angle.\n   *\n   * @output:\n   *   vec ::\n   *     The address of source vector.\n   *\n   * @input:\n   *   length ::\n   *     The vector length.\n   *\n   *   angle ::\n   *     The vector angle.\n   *\n   */\n  FT_EXPORT( void )\n  FT_Vector_From_Polar( FT_Vector*  vec,\n                        FT_Fixed    length,\n                        FT_Angle    angle );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __FTTRIGON_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/fttypes.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  fttypes.h                                                              */\n/*                                                                         */\n/*    FreeType simple types definitions (specification only).              */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2004, 2006, 2007 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTTYPES_H__\n#define __FTTYPES_H__\n\n\n#include <ft2build.h>\n#include FT_CONFIG_CONFIG_H\n#include FT_SYSTEM_H\n#include FT_IMAGE_H\n\n#include <stddef.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    basic_types                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Basic Data Types                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    The basic data types defined by the library.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the basic data types defined by FreeType 2,  */\n  /*    ranging from simple scalar types to bitmap descriptors.  More      */\n  /*    font-specific structures are defined in a different section.       */\n  /*                                                                       */\n  /* <Order>                                                               */\n  /*    FT_Byte                                                            */\n  /*    FT_Bytes                                                           */\n  /*    FT_Char                                                            */\n  /*    FT_Int                                                             */\n  /*    FT_UInt                                                            */\n  /*    FT_Short                                                           */\n  /*    FT_UShort                                                          */\n  /*    FT_Long                                                            */\n  /*    FT_ULong                                                           */\n  /*    FT_Bool                                                            */\n  /*    FT_Offset                                                          */\n  /*    FT_PtrDist                                                         */\n  /*    FT_String                                                          */\n  /*    FT_Tag                                                             */\n  /*    FT_Error                                                           */\n  /*    FT_Fixed                                                           */\n  /*    FT_Pointer                                                         */\n  /*    FT_Pos                                                             */\n  /*    FT_Vector                                                          */\n  /*    FT_BBox                                                            */\n  /*    FT_Matrix                                                          */\n  /*    FT_FWord                                                           */\n  /*    FT_UFWord                                                          */\n  /*    FT_F2Dot14                                                         */\n  /*    FT_UnitVector                                                      */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /*                                                                       */\n  /*    FT_Generic                                                         */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /*    FT_Bitmap                                                          */\n  /*    FT_Pixel_Mode                                                      */\n  /*    FT_Palette_Mode                                                    */\n  /*    FT_Glyph_Format                                                    */\n  /*    FT_IMAGE_TAG                                                       */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bool                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef of unsigned char, used for simple booleans.  As usual,   */\n  /*    values 1 and 0 represent true and false, respectively.             */\n  /*                                                                       */\n  typedef unsigned char  FT_Bool;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_FWord                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 16-bit integer used to store a distance in original font  */\n  /*    units.                                                             */\n  /*                                                                       */\n  typedef signed short  FT_FWord;   /* distance in FUnits */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UFWord                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An unsigned 16-bit integer used to store a distance in original    */\n  /*    font units.                                                        */\n  /*                                                                       */\n  typedef unsigned short  FT_UFWord;  /* unsigned distance */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Char                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _signed_ char type.                       */\n  /*                                                                       */\n  typedef signed char  FT_Char;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Byte                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the _unsigned_ char type.                     */\n  /*                                                                       */\n  typedef unsigned char  FT_Byte;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Bytes                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for constant memory areas.                               */\n  /*                                                                       */\n  typedef const FT_Byte*  FT_Bytes;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Tag                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for 32bit tags (as used in the SFNT format).             */\n  /*                                                                       */\n  typedef FT_UInt32  FT_Tag;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_String                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for the char type, usually used for strings.      */\n  /*                                                                       */\n  typedef char  FT_String;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Short                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed short.                                        */\n  /*                                                                       */\n  typedef signed short  FT_Short;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UShort                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned short.                                      */\n  /*                                                                       */\n  typedef unsigned short  FT_UShort;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Int                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the int type.                                        */\n  /*                                                                       */\n  typedef signed int  FT_Int;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_UInt                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for the unsigned int type.                               */\n  /*                                                                       */\n  typedef unsigned int  FT_UInt;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Long                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for signed long.                                         */\n  /*                                                                       */\n  typedef signed long  FT_Long;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ULong                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A typedef for unsigned long.                                       */\n  /*                                                                       */\n  typedef unsigned long  FT_ULong;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F2Dot14                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 2.14 fixed float type used for unit vectors.              */\n  /*                                                                       */\n  typedef signed short  FT_F2Dot14;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_F26Dot6                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A signed 26.6 fixed float type used for vectorial pixel            */\n  /*    coordinates.                                                       */\n  /*                                                                       */\n  typedef signed long  FT_F26Dot6;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Fixed                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is used to store 16.16 fixed float values, like scaling  */\n  /*    values or matrix coefficients.                                     */\n  /*                                                                       */\n  typedef signed long  FT_Fixed;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Error                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The FreeType error code type.  A value of 0 is always interpreted  */\n  /*    as a successful operation.                                         */\n  /*                                                                       */\n  typedef int  FT_Error;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Pointer                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple typedef for a typeless pointer.                           */\n  /*                                                                       */\n  typedef void*  FT_Pointer;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_Offset                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI C `size_t' type, i.e., the largest  */\n  /*    _unsigned_ integer type used to express a file size or position,   */\n  /*    or a memory block size.                                            */\n  /*                                                                       */\n  typedef size_t  FT_Offset;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_PtrDist                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This is equivalent to the ANSI C `ptrdiff_t' type, i.e., the       */\n  /*    largest _signed_ integer type used to express the distance         */\n  /*    between two pointers.                                              */\n  /*                                                                       */\n  typedef ft_ptrdiff_t  FT_PtrDist;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_UnitVector                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2D vector unit vector.  Uses    */\n  /*    FT_F2Dot14 types.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    x :: Horizontal coordinate.                                        */\n  /*                                                                       */\n  /*    y :: Vertical coordinate.                                          */\n  /*                                                                       */\n  typedef struct  FT_UnitVector_\n  {\n    FT_F2Dot14  x;\n    FT_F2Dot14  y;\n\n  } FT_UnitVector;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Matrix                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A simple structure used to store a 2x2 matrix.  Coefficients are   */\n  /*    in 16.16 fixed float format.  The computation performed is:        */\n  /*                                                                       */\n  /*       {                                                               */\n  /*          x' = x*xx + y*xy                                             */\n  /*          y' = x*yx + y*yy                                             */\n  /*       }                                                               */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    xx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    xy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yx :: Matrix coefficient.                                          */\n  /*                                                                       */\n  /*    yy :: Matrix coefficient.                                          */\n  /*                                                                       */\n  typedef struct  FT_Matrix_\n  {\n    FT_Fixed  xx, xy;\n    FT_Fixed  yx, yy;\n\n  } FT_Matrix;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Data                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Read-only binary data represented as a pointer and a length.       */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    pointer :: The data.                                               */\n  /*                                                                       */\n  /*    length  :: The length of the data in bytes.                        */\n  /*                                                                       */\n  typedef struct  FT_Data_\n  {\n    const FT_Byte*  pointer;\n    FT_Int          length;\n\n  } FT_Data;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <FuncType>                                                            */\n  /*    FT_Generic_Finalizer                                               */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Describes a function used to destroy the `client' data of any      */\n  /*    FreeType object.  See the description of the @FT_Generic type for  */\n  /*    details of usage.                                                  */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    The address of the FreeType object which is under finalization.    */\n  /*    Its client data is accessed through its `generic' field.           */\n  /*                                                                       */\n  typedef void  (*FT_Generic_Finalizer)(void*  object);\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_Generic                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Client applications often need to associate their own data to a    */\n  /*    variety of FreeType core objects.  For example, a text layout API  */\n  /*    might want to associate a glyph cache to a given size object.      */\n  /*                                                                       */\n  /*    Most FreeType object contains a `generic' field, of type           */\n  /*    FT_Generic, which usage is left to client applications and font    */\n  /*    servers.                                                           */\n  /*                                                                       */\n  /*    It can be used to store a pointer to client-specific data, as well */\n  /*    as the address of a `finalizer' function, which will be called by  */\n  /*    FreeType when the object is destroyed (for example, the previous   */\n  /*    client example would put the address of the glyph cache destructor */\n  /*    in the `finalizer' field).                                         */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    data      :: A typeless pointer to any client-specified data. This */\n  /*                 field is completely ignored by the FreeType library.  */\n  /*                                                                       */\n  /*    finalizer :: A pointer to a `generic finalizer' function, which    */\n  /*                 will be called when the object is destroyed.  If this */\n  /*                 field is set to NULL, no code will be called.         */\n  /*                                                                       */\n  typedef struct  FT_Generic_\n  {\n    void*                 data;\n    FT_Generic_Finalizer  finalizer;\n\n  } FT_Generic;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Macro>                                                               */\n  /*    FT_MAKE_TAG                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This macro converts four-letter tags which are used to label       */\n  /*    TrueType tables into an unsigned long to be used within FreeType.  */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The produced values *must* be 32bit integers.  Don't redefine this */\n  /*    macro.                                                             */\n  /*                                                                       */\n#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \\\n          ( ( (FT_ULong)_x1 << 24 ) |     \\\n            ( (FT_ULong)_x2 << 16 ) |     \\\n            ( (FT_ULong)_x3 <<  8 ) |     \\\n              (FT_ULong)_x4         )\n\n\n  /*************************************************************************/\n  /*************************************************************************/\n  /*                                                                       */\n  /*                    L I S T   M A N A G E M E N T                      */\n  /*                                                                       */\n  /*************************************************************************/\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    list_processing                                                    */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_ListNode                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*     Many elements and objects in FreeType are listed through an       */\n  /*     @FT_List record (see @FT_ListRec).  As its name suggests, an      */\n  /*     FT_ListNode is a handle to a single list element.                 */\n  /*                                                                       */\n  typedef struct FT_ListNodeRec_*  FT_ListNode;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Type>                                                                */\n  /*    FT_List                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A handle to a list record (see @FT_ListRec).                       */\n  /*                                                                       */\n  typedef struct FT_ListRec_*  FT_List;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListNodeRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a single list element.                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    prev :: The previous element in the list.  NULL if first.          */\n  /*                                                                       */\n  /*    next :: The next element in the list.  NULL if last.               */\n  /*                                                                       */\n  /*    data :: A typeless pointer to the listed object.                   */\n  /*                                                                       */\n  typedef struct  FT_ListNodeRec_\n  {\n    FT_ListNode  prev;\n    FT_ListNode  next;\n    void*        data;\n\n  } FT_ListNodeRec;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_ListRec                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to hold a simple doubly-linked list.  These are   */\n  /*    used in many parts of FreeType.                                    */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    head :: The head (first element) of doubly-linked list.            */\n  /*                                                                       */\n  /*    tail :: The tail (last element) of doubly-linked list.             */\n  /*                                                                       */\n  typedef struct  FT_ListRec_\n  {\n    FT_ListNode  head;\n    FT_ListNode  tail;\n\n  } FT_ListRec;\n\n\n  /* */\n\n#define FT_IS_EMPTY( list )  ( (list).head == 0 )\n\n  /* return base error code (without module-specific prefix) */\n#define FT_ERROR_BASE( x )    ( (x) & 0xFF )\n\n  /* return module error code */\n#define FT_ERROR_MODULE( x )  ( (x) & 0xFF00U )\n\n#define FT_BOOL( x )  ( (FT_Bool)( x ) )\n\nFT_END_HEADER\n\n#endif /* __FTTYPES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftwinfnt.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftwinfnt.h                                                             */\n/*                                                                         */\n/*    FreeType API for accessing Windows fnt-specific data.                */\n/*                                                                         */\n/*  Copyright 2003, 2004 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTWINFNT_H__\n#define __FTWINFNT_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    winfnt_fonts                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Window FNT Files                                                   */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Windows FNT specific API.                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the declaration of Windows FNT specific      */\n  /*    functions.                                                         */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************\n   *\n   * @enum:\n   *   FT_WinFNT_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `charset' byte in\n   *   @FT_WinFNT_HeaderRec.  Exact mapping tables for the various cpXXXX\n   *   encodings (except for cp1361) can be found at ftp://ftp.unicode.org\n   *   in the MAPPINGS/VENDORS/MICSFT/WINDOWS subdirectory.  cp1361 is\n   *   roughly a superset of MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT.\n   *\n   * @values:\n   *   FT_WinFNT_ID_DEFAULT ::\n   *     This is used for font enumeration and font creation as a\n   *     `don't care' value.  Valid font files don't contain this value.\n   *     When querying for information about the character set of the font\n   *     that is currently selected into a specified device context, this\n   *     return value (of the related Windows API) simply denotes failure.\n   *\n   *   FT_WinFNT_ID_SYMBOL ::\n   *     There is no known mapping table available.\n   *\n   *   FT_WinFNT_ID_MAC ::\n   *     Mac Roman encoding.\n   *\n   *   FT_WinFNT_ID_OEM ::\n   *     From Michael Pöttgen <michael@poettgen.de>:\n   *\n   *       The `Windows Font Mapping' article says that FT_WinFNT_ID_OEM\n   *       is used for the charset of vector fonts, like `modern.fon',\n   *       `roman.fon', and `script.fon' on Windows.\n   *\n   *       The `CreateFont' documentation says: The FT_WinFNT_ID_OEM value\n   *       specifies a character set that is operating-system dependent.\n   *\n   *       The `IFIMETRICS' documentation from the `Windows Driver\n   *       Development Kit' says: This font supports an OEM-specific\n   *       character set.  The OEM character set is system dependent.\n   *\n   *       In general OEM, as opposed to ANSI (i.e., cp1252), denotes the\n   *       second default codepage that most international versions of\n   *       Windows have.  It is one of the OEM codepages from\n   *\n   *         http://www.microsoft.com/globaldev/reference/cphome.mspx,\n   *\n   *       and is used for the `DOS boxes', to support legacy applications.\n   *       A German Windows version for example usually uses ANSI codepage\n   *       1252 and OEM codepage 850.\n   *\n   *   FT_WinFNT_ID_CP874 ::\n   *     A superset of Thai TIS 620 and ISO 8859-11.\n   *\n   *   FT_WinFNT_ID_CP932 ::\n   *     A superset of Japanese Shift-JIS (with minor deviations).\n   *\n   *   FT_WinFNT_ID_CP936 ::\n   *     A superset of simplified Chinese GB 2312-1980 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP949 ::\n   *     A superset of Korean Hangul KS C 5601-1987 (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP950 ::\n   *     A superset of traditional Chinese Big 5 ETen (with different\n   *     ordering and minor deviations).\n   *\n   *   FT_WinFNT_ID_CP1250 ::\n   *     A superset of East European ISO 8859-2 (with slightly different\n   *     ordering).\n   *\n   *   FT_WinFNT_ID_CP1251 ::\n   *     A superset of Russian ISO 8859-5 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1252 ::\n   *     ANSI encoding.  A superset of ISO 8859-1.\n   *\n   *   FT_WinFNT_ID_CP1253 ::\n   *     A superset of Greek ISO 8859-7 (with minor modifications).\n   *\n   *   FT_WinFNT_ID_CP1254 ::\n   *     A superset of Turkish ISO 8859-9.\n   *\n   *   FT_WinFNT_ID_CP1255 ::\n   *     A superset of Hebrew ISO 8859-8 (with some modifications).\n   *\n   *   FT_WinFNT_ID_CP1256 ::\n   *     A superset of Arabic ISO 8859-6 (with different ordering).\n   *\n   *   FT_WinFNT_ID_CP1257 ::\n   *     A superset of Baltic ISO 8859-13 (with some deviations).\n   *\n   *   FT_WinFNT_ID_CP1258 ::\n   *     For Vietnamese.  This encoding doesn't cover all necessary\n   *     characters.\n   *\n   *   FT_WinFNT_ID_CP1361 ::\n   *     Korean (Johab).\n   */\n\n#define FT_WinFNT_ID_CP1252    0\n#define FT_WinFNT_ID_DEFAULT   1\n#define FT_WinFNT_ID_SYMBOL    2\n#define FT_WinFNT_ID_MAC      77\n#define FT_WinFNT_ID_CP932   128\n#define FT_WinFNT_ID_CP949   129\n#define FT_WinFNT_ID_CP1361  130\n#define FT_WinFNT_ID_CP936   134\n#define FT_WinFNT_ID_CP950   136\n#define FT_WinFNT_ID_CP1253  161\n#define FT_WinFNT_ID_CP1254  162\n#define FT_WinFNT_ID_CP1258  163\n#define FT_WinFNT_ID_CP1255  177\n#define FT_WinFNT_ID_CP1256  178\n#define FT_WinFNT_ID_CP1257  186\n#define FT_WinFNT_ID_CP1251  204\n#define FT_WinFNT_ID_CP874   222\n#define FT_WinFNT_ID_CP1250  238\n#define FT_WinFNT_ID_OEM     255\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    FT_WinFNT_HeaderRec                                                */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Windows FNT Header info.                                           */\n  /*                                                                       */\n  typedef struct  FT_WinFNT_HeaderRec_\n  {\n    FT_UShort  version;\n    FT_ULong   file_size;\n    FT_Byte    copyright[60];\n    FT_UShort  file_type;\n    FT_UShort  nominal_point_size;\n    FT_UShort  vertical_resolution;\n    FT_UShort  horizontal_resolution;\n    FT_UShort  ascent;\n    FT_UShort  internal_leading;\n    FT_UShort  external_leading;\n    FT_Byte    italic;\n    FT_Byte    underline;\n    FT_Byte    strike_out;\n    FT_UShort  weight;\n    FT_Byte    charset;\n    FT_UShort  pixel_width;\n    FT_UShort  pixel_height;\n    FT_Byte    pitch_and_family;\n    FT_UShort  avg_width;\n    FT_UShort  max_width;\n    FT_Byte    first_char;\n    FT_Byte    last_char;\n    FT_Byte    default_char;\n    FT_Byte    break_char;\n    FT_UShort  bytes_per_row;\n    FT_ULong   device_offset;\n    FT_ULong   face_name_offset;\n    FT_ULong   bits_pointer;\n    FT_ULong   bits_offset;\n    FT_Byte    reserved;\n    FT_ULong   flags;\n    FT_UShort  A_space;\n    FT_UShort  B_space;\n    FT_UShort  C_space;\n    FT_UShort  color_table_offset;\n    FT_ULong   reserved1[4];\n\n  } FT_WinFNT_HeaderRec, *FT_WinFNT_Header;\n\n\n /**********************************************************************\n  *\n  * @function:\n  *    FT_Get_WinFNT_Header\n  *\n  * @description:\n  *    Retrieve a Windows FNT font info header.\n  *\n  * @input:\n  *    face    :: A handle to the input face.\n  *\n  * @output:\n  *    aheader :: The WinFNT header.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   This function only works with Windows FNT faces, returning an error\n  *   otherwise.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_WinFNT_Header( FT_Face               face,\n                        FT_WinFNT_HeaderRec  *aheader );\n\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTWINFNT_H__ */\n\n\n/* END */\n\n\n/* Local Variables: */\n/* coding: utf-8    */\n/* End:             */\n"
  },
  {
    "path": "libIGraph/include/freetype/ftxf86.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ftxf86.h                                                               */\n/*                                                                         */\n/*    Support functions for X11.                                           */\n/*                                                                         */\n/*  Copyright 2002, 2003, 2004, 2006, 2007 by                              */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __FTXF86_H__\n#define __FTXF86_H__\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*   font_formats                                                        */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*   Font Formats                                                        */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*   Getting the font format.                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   The single function in this section can be used to get the font     */\n  /*   format.  Note that this information is not needed normally;         */\n  /*   however, there are special cases (like in PDF devices) where it is  */\n  /*   important to differentiate, in spite of FreeType's uniform API.     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*   FT_Get_X11_Font_Format                                              */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   Return a string describing the format of a given face, using values */\n  /*   which can be used as an X11 FONT_PROPERTY.  Possible values are     */\n  /*   `TrueType', `Type 1', `BDF', `PCF', `Type 42', `CID Type 1', `CFF', */\n  /*   `PFR', and `Windows FNT'.                                           */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*   face ::                                                             */\n  /*     Input face handle.                                                */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*   Font format string.  NULL in case of error.                         */\n  /*                                                                       */\n  FT_EXPORT( const char* )\n  FT_Get_X11_Font_Format( FT_Face  face );\n\n /* */\n\nFT_END_HEADER\n\n#endif /* __FTXF86_H__ */\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/autohint.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  autohint.h                                                             */\r\n/*                                                                         */\r\n/*    High-level `autohint' module-specific interface (specification).     */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2007 by                                     */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* The auto-hinter is used to load and automatically hint glyphs if a    */\r\n  /* format-specific hinter isn't available.                               */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n\r\n#ifndef __AUTOHINT_H__\r\n#define __AUTOHINT_H__\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* A small technical note regarding automatic hinting in order to        */\r\n  /* clarify this module interface.                                        */\r\n  /*                                                                       */\r\n  /* An automatic hinter might compute two kinds of data for a given face: */\r\n  /*                                                                       */\r\n  /* - global hints: Usually some metrics that describe global properties  */\r\n  /*                 of the face.  It is computed by scanning more or less */\r\n  /*                 aggressively the glyphs in the face, and thus can be  */\r\n  /*                 very slow to compute (even if the size of global      */\r\n  /*                 hints is really small).                               */\r\n  /*                                                                       */\r\n  /* - glyph hints:  These describe some important features of the glyph   */\r\n  /*                 outline, as well as how to align them.  They are      */\r\n  /*                 generally much faster to compute than global hints.   */\r\n  /*                                                                       */\r\n  /* The current FreeType auto-hinter does a pretty good job while         */\r\n  /* performing fast computations for both global and glyph hints.         */\r\n  /* However, we might be interested in introducing more complex and       */\r\n  /* powerful algorithms in the future, like the one described in the John */\r\n  /* D. Hobby paper, which unfortunately requires a lot more horsepower.   */\r\n  /*                                                                       */\r\n  /* Because a sufficiently sophisticated font management system would     */\r\n  /* typically implement an LRU cache of opened face objects to reduce     */\r\n  /* memory usage, it is a good idea to be able to avoid recomputing       */\r\n  /* global hints every time the same face is re-opened.                   */\r\n  /*                                                                       */\r\n  /* We thus provide the ability to cache global hints outside of the face */\r\n  /* object, in order to speed up font re-opening time.  Of course, this   */\r\n  /* feature is purely optional, so most client programs won't even notice */\r\n  /* it.                                                                   */\r\n  /*                                                                       */\r\n  /* I initially thought that it would be a good idea to cache the glyph   */\r\n  /* hints too.  However, my general idea now is that if you really need   */\r\n  /* to cache these too, you are simply in need of a new font format,      */\r\n  /* where all this information could be stored within the font file and   */\r\n  /* decoded on the fly.                                                   */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_FREETYPE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  typedef struct FT_AutoHinterRec_  *FT_AutoHinter;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    FT_AutoHinter_GlobalGetFunc                                        */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Retrieves the global hints computed for a given face object the    */\r\n  /*    resulting data is dissociated from the face and will survive a     */\r\n  /*    call to FT_Done_Face().  It must be discarded through the API      */\r\n  /*    FT_AutoHinter_GlobalDoneFunc().                                    */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    hinter        :: A handle to the source auto-hinter.               */\r\n  /*                                                                       */\r\n  /*    face          :: A handle to the source face object.               */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    global_hints  :: A typeless pointer to the global hints.           */\r\n  /*                                                                       */\r\n  /*    global_len    :: The size in bytes of the global hints.            */\r\n  /*                                                                       */\r\n  typedef void\r\n  (*FT_AutoHinter_GlobalGetFunc)( FT_AutoHinter  hinter,\r\n                                  FT_Face        face,\r\n                                  void**         global_hints,\r\n                                  long*          global_len );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    FT_AutoHinter_GlobalDoneFunc                                       */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Discards the global hints retrieved through                        */\r\n  /*    FT_AutoHinter_GlobalGetFunc().  This is the only way these hints   */\r\n  /*    are freed from memory.                                             */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    hinter :: A handle to the auto-hinter module.                      */\r\n  /*                                                                       */\r\n  /*    global :: A pointer to retrieved global hints to discard.          */\r\n  /*                                                                       */\r\n  typedef void\r\n  (*FT_AutoHinter_GlobalDoneFunc)( FT_AutoHinter  hinter,\r\n                                   void*          global );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    FT_AutoHinter_GlobalResetFunc                                      */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    This function is used to recompute the global metrics in a given   */\r\n  /*    font.  This is useful when global font data changes (e.g. Multiple */\r\n  /*    Masters fonts where blend coordinates change).                     */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    hinter :: A handle to the source auto-hinter.                      */\r\n  /*                                                                       */\r\n  /*    face   :: A handle to the face.                                    */\r\n  /*                                                                       */\r\n  typedef void\r\n  (*FT_AutoHinter_GlobalResetFunc)( FT_AutoHinter  hinter,\r\n                                    FT_Face        face );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    FT_AutoHinter_GlyphLoadFunc                                        */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    This function is used to load, scale, and automatically hint a     */\r\n  /*    glyph from a given face.                                           */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face        :: A handle to the face.                               */\r\n  /*                                                                       */\r\n  /*    glyph_index :: The glyph index.                                    */\r\n  /*                                                                       */\r\n  /*    load_flags  :: The load flags.                                     */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    This function is capable of loading composite glyphs by hinting    */\r\n  /*    each sub-glyph independently (which improves quality).             */\r\n  /*                                                                       */\r\n  /*    It will call the font driver with FT_Load_Glyph(), with            */\r\n  /*    FT_LOAD_NO_SCALE set.                                              */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*FT_AutoHinter_GlyphLoadFunc)( FT_AutoHinter  hinter,\r\n                                  FT_GlyphSlot   slot,\r\n                                  FT_Size        size,\r\n                                  FT_UInt        glyph_index,\r\n                                  FT_Int32       load_flags );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    FT_AutoHinter_ServiceRec                                           */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    The auto-hinter module's interface.                                */\r\n  /*                                                                       */\r\n  typedef struct  FT_AutoHinter_ServiceRec_\r\n  {\r\n    FT_AutoHinter_GlobalResetFunc  reset_face;\r\n    FT_AutoHinter_GlobalGetFunc    get_global_hints;\r\n    FT_AutoHinter_GlobalDoneFunc   done_global_hints;\r\n    FT_AutoHinter_GlyphLoadFunc    load_glyph;\r\n\r\n  } FT_AutoHinter_ServiceRec, *FT_AutoHinter_Service;\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __AUTOHINT_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftcalc.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftcalc.h                                                               */\r\n/*                                                                         */\r\n/*    Arithmetic computations (specification).                             */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __FTCALC_H__\r\n#define __FTCALC_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_FREETYPE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_FixedSqrt                                                       */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Computes the square root of a 16.16 fixed point value.             */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    x :: The value to compute the root for.                            */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    The result of `sqrt(x)'.                                           */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    This function is not very fast.                                    */\r\n  /*                                                                       */\r\n  FT_BASE( FT_Int32 )\r\n  FT_SqrtFixed( FT_Int32  x );\r\n\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_Sqrt32                                                          */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Computes the square root of an Int32 integer (which will be        */\r\n  /*    handled as an unsigned long value).                                */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    x :: The value to compute the root for.                            */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    The result of `sqrt(x)'.                                           */\r\n  /*                                                                       */\r\n  FT_EXPORT( FT_Int32 )\r\n  FT_Sqrt32( FT_Int32  x );\r\n\r\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* FT_MulDiv() and FT_MulFix() are declared in freetype.h.               */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n\r\n#ifdef TT_USE_BYTECODE_INTERPRETER\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_MulDiv_No_Round                                                 */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A very simple function used to perform the computation `(a*b)/c'   */\r\n  /*    (without rounding) with maximal accuracy (it uses a 64-bit         */\r\n  /*    intermediate integer whenever necessary).                          */\r\n  /*                                                                       */\r\n  /*    This function isn't necessarily as fast as some processor specific */\r\n  /*    operations, but is at least completely portable.                   */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    a :: The first multiplier.                                         */\r\n  /*    b :: The second multiplier.                                        */\r\n  /*    c :: The divisor.                                                  */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    The result of `(a*b)/c'.  This function never traps when trying to */\r\n  /*    divide by zero; it simply returns `MaxInt' or `MinInt' depending   */\r\n  /*    on the signs of `a' and `b'.                                       */\r\n  /*                                                                       */\r\n  FT_BASE( FT_Long )\r\n  FT_MulDiv_No_Round( FT_Long  a,\r\n                      FT_Long  b,\r\n                      FT_Long  c );\r\n\r\n#endif /* TT_USE_BYTECODE_INTERPRETER */\r\n\r\n\r\n  /*\r\n   *  Return -1, 0, or +1, depending on the orientation of a given corner.\r\n   *  We use the Cartesian coordinate system, with positive vertical values\r\n   *  going upwards.  The function returns +1 if the corner turns to the\r\n   *  left, -1 to the right, and 0 for undecidable cases.\r\n   */\r\n  FT_BASE( FT_Int )\r\n  ft_corner_orientation( FT_Pos  in_x,\r\n                         FT_Pos  in_y,\r\n                         FT_Pos  out_x,\r\n                         FT_Pos  out_y );\r\n\r\n  /*\r\n   *  Return TRUE if a corner is flat or nearly flat.  This is equivalent to\r\n   *  saying that the angle difference between the `in' and `out' vectors is\r\n   *  very small.\r\n   */\r\n  FT_BASE( FT_Int )\r\n  ft_corner_is_flat( FT_Pos  in_x,\r\n                     FT_Pos  in_y,\r\n                     FT_Pos  out_x,\r\n                     FT_Pos  out_y );\r\n\r\n\r\n#define INT_TO_F26DOT6( x )    ( (FT_Long)(x) << 6  )\r\n#define INT_TO_F2DOT14( x )    ( (FT_Long)(x) << 14 )\r\n#define INT_TO_FIXED( x )      ( (FT_Long)(x) << 16 )\r\n#define F2DOT14_TO_FIXED( x )  ( (FT_Long)(x) << 2  )\r\n#define FLOAT_TO_FIXED( x )    ( (FT_Long)( x * 65536.0 ) )\r\n\r\n#define ROUND_F26DOT6( x )     ( x >= 0 ? (    ( (x) + 32 ) & -64 )     \\\r\n                                        : ( -( ( 32 - (x) ) & -64 ) ) )\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTCALC_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftdebug.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftdebug.h                                                              */\r\n/*                                                                         */\r\n/*    Debugging and logging component (specification).                     */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2004, 2006, 2007 by                         */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/*                                                                         */\r\n/*  IMPORTANT: A description of FreeType's debugging support can be        */\r\n/*             found in `docs/DEBUG.TXT'.  Read it if you need to use or   */\r\n/*             understand this code.                                       */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __FTDEBUG_H__\r\n#define __FTDEBUG_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_CONFIG_CONFIG_H\r\n#include FT_FREETYPE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */\r\n  /* is already defined; this simplifies the following #ifdefs            */\r\n  /*                                                                      */\r\n#ifdef FT_DEBUG_LEVEL_TRACE\r\n#undef  FT_DEBUG_LEVEL_ERROR\r\n#define FT_DEBUG_LEVEL_ERROR\r\n#endif\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* Define the trace enums as well as the trace levels array when they    */\r\n  /* are needed.                                                           */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n#ifdef FT_DEBUG_LEVEL_TRACE\r\n\r\n#define FT_TRACE_DEF( x )  trace_ ## x ,\r\n\r\n  /* defining the enumeration */\r\n  typedef enum\r\n  {\r\n#include FT_INTERNAL_TRACE_H\r\n    trace_count\r\n\r\n  } FT_Trace;\r\n\r\n\r\n  /* defining the array of trace levels, provided by `src/base/ftdebug.c' */\r\n  extern int  ft_trace_levels[trace_count];\r\n\r\n#undef FT_TRACE_DEF\r\n\r\n#endif /* FT_DEBUG_LEVEL_TRACE */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* Define the FT_TRACE macro                                             */\r\n  /*                                                                       */\r\n  /* IMPORTANT!                                                            */\r\n  /*                                                                       */\r\n  /* Each component must define the macro FT_COMPONENT to a valid FT_Trace */\r\n  /* value before using any TRACE macro.                                   */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n#ifdef FT_DEBUG_LEVEL_TRACE\r\n\r\n#define FT_TRACE( level, varformat )                      \\\r\n          do                                              \\\r\n          {                                               \\\r\n            if ( ft_trace_levels[FT_COMPONENT] >= level ) \\\r\n              FT_Message varformat;                       \\\r\n          } while ( 0 )\r\n\r\n#else /* !FT_DEBUG_LEVEL_TRACE */\r\n\r\n#define FT_TRACE( level, varformat )  do ; while ( 0 )      /* nothing */\r\n\r\n#endif /* !FT_DEBUG_LEVEL_TRACE */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_Trace_Get_Count                                                 */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Return the number of available trace components.                   */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    The number of trace components.  0 if FreeType 2 is not built with */\r\n  /*    FT_DEBUG_LEVEL_TRACE definition.                                   */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    This function may be useful if you want to access elements of      */\r\n  /*    the internal `ft_trace_levels' array by an index.                  */\r\n  /*                                                                       */\r\n  FT_BASE( FT_Int )\r\n  FT_Trace_Get_Count( void );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_Trace_Get_Name                                                  */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Return the name of a trace component.                              */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    The index of the trace component.                                  */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    The name of the trace component.  This is a statically allocated   */\r\n  /*    C string, so do not free it after use.  NULL if FreeType 2 is not  */\r\n  /*    built with FT_DEBUG_LEVEL_TRACE definition.                        */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    Use @FT_Trace_Get_Count to get the number of available trace       */\r\n  /*    components.                                                        */\r\n  /*                                                                       */\r\n  /*    This function may be useful if you want to control FreeType 2's    */\r\n  /*    debug level in your application.                                   */\r\n  /*                                                                       */\r\n  FT_BASE( const char * )\r\n  FT_Trace_Get_Name( FT_Int  idx );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* You need two opening resp. closing parentheses!                       */\r\n  /*                                                                       */\r\n  /* Example: FT_TRACE0(( \"Value is %i\", foo ))                            */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n#define FT_TRACE0( varformat )  FT_TRACE( 0, varformat )\r\n#define FT_TRACE1( varformat )  FT_TRACE( 1, varformat )\r\n#define FT_TRACE2( varformat )  FT_TRACE( 2, varformat )\r\n#define FT_TRACE3( varformat )  FT_TRACE( 3, varformat )\r\n#define FT_TRACE4( varformat )  FT_TRACE( 4, varformat )\r\n#define FT_TRACE5( varformat )  FT_TRACE( 5, varformat )\r\n#define FT_TRACE6( varformat )  FT_TRACE( 6, varformat )\r\n#define FT_TRACE7( varformat )  FT_TRACE( 7, varformat )\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /*  Define the FT_ERROR macro                                            */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n#ifdef FT_DEBUG_LEVEL_ERROR\r\n\r\n#define FT_ERROR( varformat )  FT_Message  varformat\r\n\r\n#else  /* !FT_DEBUG_LEVEL_ERROR */\r\n\r\n#define FT_ERROR( varformat )  do ; while ( 0 )      /* nothing */\r\n\r\n#endif /* !FT_DEBUG_LEVEL_ERROR */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* Define the FT_ASSERT macro                                            */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n#ifdef FT_DEBUG_LEVEL_ERROR\r\n\r\n#define FT_ASSERT( condition )                                      \\\r\n          do                                                        \\\r\n          {                                                         \\\r\n            if ( !( condition ) )                                   \\\r\n              FT_Panic( \"assertion failed on line %d of file %s\\n\", \\\r\n                        __LINE__, __FILE__ );                       \\\r\n          } while ( 0 )\r\n\r\n#else /* !FT_DEBUG_LEVEL_ERROR */\r\n\r\n#define FT_ASSERT( condition )  do ; while ( 0 )\r\n\r\n#endif /* !FT_DEBUG_LEVEL_ERROR */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /*  Define `FT_Message' and `FT_Panic' when needed                       */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n#ifdef FT_DEBUG_LEVEL_ERROR\r\n\r\n#include \"stdio.h\"  /* for vprintf() */\r\n\r\n  /* print a message */\r\n  FT_BASE( void )\r\n  FT_Message( const char*  fmt, ... );\r\n\r\n  /* print a message and exit */\r\n  FT_BASE( void )\r\n  FT_Panic( const char*  fmt, ... );\r\n\r\n#endif /* FT_DEBUG_LEVEL_ERROR */\r\n\r\n\r\n  FT_BASE( void )\r\n  ft_debug_init( void );\r\n\r\n\r\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\r\n\r\n  /* we disable the warning `conditional expression is constant' here */\r\n  /* in order to compile cleanly with the maximum level of warnings   */\r\n#pragma warning( disable : 4127 )\r\n\r\n#endif /* _MSC_VER */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTDEBUG_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftdriver.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftdriver.h                                                             */\r\n/*                                                                         */\r\n/*    FreeType font driver interface (specification).                      */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2003, 2006 by                               */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __FTDRIVER_H__\r\n#define __FTDRIVER_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_MODULE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_Face_InitFunc)( FT_Stream      stream,\r\n                       FT_Face        face,\r\n                       FT_Int         typeface_index,\r\n                       FT_Int         num_params,\r\n                       FT_Parameter*  parameters );\r\n\r\n  typedef void\r\n  (*FT_Face_DoneFunc)( FT_Face  face );\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_Size_InitFunc)( FT_Size  size );\r\n\r\n  typedef void\r\n  (*FT_Size_DoneFunc)( FT_Size  size );\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_Slot_InitFunc)( FT_GlyphSlot  slot );\r\n\r\n  typedef void\r\n  (*FT_Slot_DoneFunc)( FT_GlyphSlot  slot );\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_Size_RequestFunc)( FT_Size          size,\r\n                          FT_Size_Request  req );\r\n\r\n  typedef FT_Error\r\n  (*FT_Size_SelectFunc)( FT_Size   size,\r\n                         FT_ULong  size_index );\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n\r\n  typedef FT_Error\r\n  (*FT_Size_ResetPointsFunc)( FT_Size     size,\r\n                              FT_F26Dot6  char_width,\r\n                              FT_F26Dot6  char_height,\r\n                              FT_UInt     horz_resolution,\r\n                              FT_UInt     vert_resolution );\r\n\r\n  typedef FT_Error\r\n  (*FT_Size_ResetPixelsFunc)( FT_Size  size,\r\n                              FT_UInt  pixel_width,\r\n                              FT_UInt  pixel_height );\r\n\r\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\r\n\r\n  typedef FT_Error\r\n  (*FT_Slot_LoadFunc)( FT_GlyphSlot  slot,\r\n                       FT_Size       size,\r\n                       FT_UInt       glyph_index,\r\n                       FT_Int32      load_flags );\r\n\r\n\r\n  typedef FT_UInt\r\n  (*FT_CharMap_CharIndexFunc)( FT_CharMap  charmap,\r\n                               FT_Long     charcode );\r\n\r\n  typedef FT_Long\r\n  (*FT_CharMap_CharNextFunc)( FT_CharMap  charmap,\r\n                              FT_Long     charcode );\r\n\r\n  typedef FT_Error\r\n  (*FT_Face_GetKerningFunc)( FT_Face     face,\r\n                             FT_UInt     left_glyph,\r\n                             FT_UInt     right_glyph,\r\n                             FT_Vector*  kerning );\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_Face_AttachFunc)( FT_Face    face,\r\n                         FT_Stream  stream );\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_Face_GetAdvancesFunc)( FT_Face     face,\r\n                              FT_UInt     first,\r\n                              FT_UInt     count,\r\n                              FT_Bool     vertical,\r\n                              FT_UShort*  advances );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    FT_Driver_ClassRec                                                 */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    The font driver class.  This structure mostly contains pointers to */\r\n  /*    driver methods.                                                    */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    root             :: The parent module.                             */\r\n  /*                                                                       */\r\n  /*    face_object_size :: The size of a face object in bytes.            */\r\n  /*                                                                       */\r\n  /*    size_object_size :: The size of a size object in bytes.            */\r\n  /*                                                                       */\r\n  /*    slot_object_size :: The size of a glyph object in bytes.           */\r\n  /*                                                                       */\r\n  /*    init_face        :: The format-specific face constructor.          */\r\n  /*                                                                       */\r\n  /*    done_face        :: The format-specific face destructor.           */\r\n  /*                                                                       */\r\n  /*    init_size        :: The format-specific size constructor.          */\r\n  /*                                                                       */\r\n  /*    done_size        :: The format-specific size destructor.           */\r\n  /*                                                                       */\r\n  /*    init_slot        :: The format-specific slot constructor.          */\r\n  /*                                                                       */\r\n  /*    done_slot        :: The format-specific slot destructor.           */\r\n  /*                                                                       */\r\n  /*                                                                       */\r\n  /*    load_glyph       :: A function handle to load a glyph to a slot.   */\r\n  /*                        This field is mandatory!                       */\r\n  /*                                                                       */\r\n  /*    get_char_index   :: A function handle to return the glyph index of */\r\n  /*                        a given character for a given charmap.  This   */\r\n  /*                        field is mandatory!                            */\r\n  /*                                                                       */\r\n  /*    get_kerning      :: A function handle to return the unscaled       */\r\n  /*                        kerning for a given pair of glyphs.  Can be    */\r\n  /*                        set to 0 if the format doesn't support         */\r\n  /*                        kerning.                                       */\r\n  /*                                                                       */\r\n  /*    attach_file      :: This function handle is used to read           */\r\n  /*                        additional data for a face from another        */\r\n  /*                        file/stream.  For example, this can be used to */\r\n  /*                        add data from AFM or PFM files on a Type 1     */\r\n  /*                        face, or a CIDMap on a CID-keyed face.         */\r\n  /*                                                                       */\r\n  /*    get_advances     :: A function handle used to return advance       */\r\n  /*                        widths of `count' glyphs (in font units),      */\r\n  /*                        starting at `first'.  The `vertical' flag must */\r\n  /*                        be set to get vertical advance heights.  The   */\r\n  /*                        `advances' buffer is caller-allocated.         */\r\n  /*                        Currently not implemented.  The idea of this   */\r\n  /*                        function is to be able to perform              */\r\n  /*                        device-independent text layout without loading */\r\n  /*                        a single glyph image.                          */\r\n  /*                                                                       */\r\n  /*    request_size     :: A handle to a function used to request the new */\r\n  /*                        character size.  Can be set to 0 if the        */\r\n  /*                        scaling done in the base layer suffices.       */\r\n  /*                                                                       */\r\n  /*    select_size      :: A handle to a function used to select a new    */\r\n  /*                        fixed size.  It is used only if                */\r\n  /*                        @FT_FACE_FLAG_FIXED_SIZES is set.  Can be set  */\r\n  /*                        to 0 if the scaling done in the base layer     */\r\n  /*                        suffices.                                      */\r\n  /* <Note>                                                                */\r\n  /*    Most function pointers, with the exception of `load_glyph' and     */\r\n  /*    `get_char_index' can be set to 0 to indicate a default behaviour.  */\r\n  /*                                                                       */\r\n  typedef struct  FT_Driver_ClassRec_\r\n  {\r\n    FT_Module_Class           root;\r\n\r\n    FT_Long                   face_object_size;\r\n    FT_Long                   size_object_size;\r\n    FT_Long                   slot_object_size;\r\n\r\n    FT_Face_InitFunc          init_face;\r\n    FT_Face_DoneFunc          done_face;\r\n\r\n    FT_Size_InitFunc          init_size;\r\n    FT_Size_DoneFunc          done_size;\r\n\r\n    FT_Slot_InitFunc          init_slot;\r\n    FT_Slot_DoneFunc          done_slot;\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n\r\n    FT_Size_ResetPointsFunc   set_char_sizes;\r\n    FT_Size_ResetPixelsFunc   set_pixel_sizes;\r\n\r\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\r\n\r\n    FT_Slot_LoadFunc          load_glyph;\r\n\r\n    FT_Face_GetKerningFunc    get_kerning;\r\n    FT_Face_AttachFunc        attach_file;\r\n    FT_Face_GetAdvancesFunc   get_advances;\r\n\r\n    /* since version 2.2 */\r\n    FT_Size_RequestFunc       request_size;\r\n    FT_Size_SelectFunc        select_size;\r\n\r\n  } FT_Driver_ClassRec, *FT_Driver_Class;\r\n\r\n\r\n  /*\r\n   *  The following functions are used as stubs for `set_char_sizes' and\r\n   *  `set_pixel_sizes'; the code uses `request_size' and `select_size'\r\n   *  functions instead.\r\n   *\r\n   *  Implementation is in `src/base/ftobjs.c'.\r\n   */\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n\r\n  FT_BASE( FT_Error )\r\n  ft_stub_set_char_sizes( FT_Size     size,\r\n                          FT_F26Dot6  width,\r\n                          FT_F26Dot6  height,\r\n                          FT_UInt     horz_res,\r\n                          FT_UInt     vert_res );\r\n\r\n  FT_BASE( FT_Error )\r\n  ft_stub_set_pixel_sizes( FT_Size  size,\r\n                           FT_UInt  width,\r\n                           FT_UInt  height );\r\n\r\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTDRIVER_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftgloadr.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftgloadr.h                                                             */\r\n/*                                                                         */\r\n/*    The FreeType glyph loader (specification).                           */\r\n/*                                                                         */\r\n/*  Copyright 2002, 2003, 2005, 2006 by                                    */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __FTGLOADR_H__\r\n#define __FTGLOADR_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_FREETYPE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    FT_GlyphLoader                                                     */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    The glyph loader is an internal object used to load several glyphs */\r\n  /*    together (for example, in the case of composites).                 */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    The glyph loader implementation is not part of the high-level API, */\r\n  /*    hence the forward structure declaration.                           */\r\n  /*                                                                       */\r\n  typedef struct FT_GlyphLoaderRec_*  FT_GlyphLoader ;\r\n\r\n\r\n#if 0  /* moved to freetype.h in version 2.2 */\r\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS          1\r\n#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES      2\r\n#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID        4\r\n#define FT_SUBGLYPH_FLAG_SCALE                   8\r\n#define FT_SUBGLYPH_FLAG_XY_SCALE             0x40\r\n#define FT_SUBGLYPH_FLAG_2X2                  0x80\r\n#define FT_SUBGLYPH_FLAG_USE_MY_METRICS      0x200\r\n#endif\r\n\r\n\r\n  typedef struct  FT_SubGlyphRec_\r\n  {\r\n    FT_Int     index;\r\n    FT_UShort  flags;\r\n    FT_Int     arg1;\r\n    FT_Int     arg2;\r\n    FT_Matrix  transform;\r\n\r\n  } FT_SubGlyphRec;\r\n\r\n\r\n  typedef struct  FT_GlyphLoadRec_\r\n  {\r\n    FT_Outline   outline;       /* outline             */\r\n    FT_Vector*   extra_points;  /* extra points table  */\r\n    FT_Vector*   extra_points2; /* second extra points table */\r\n    FT_UInt      num_subglyphs; /* number of subglyphs */\r\n    FT_SubGlyph  subglyphs;     /* subglyphs           */\r\n\r\n  } FT_GlyphLoadRec, *FT_GlyphLoad;\r\n\r\n\r\n  typedef struct  FT_GlyphLoaderRec_\r\n  {\r\n    FT_Memory        memory;\r\n    FT_UInt          max_points;\r\n    FT_UInt          max_contours;\r\n    FT_UInt          max_subglyphs;\r\n    FT_Bool          use_extra;\r\n\r\n    FT_GlyphLoadRec  base;\r\n    FT_GlyphLoadRec  current;\r\n\r\n    void*            other;            /* for possible future extension? */\r\n\r\n  } FT_GlyphLoaderRec;\r\n\r\n\r\n  /* create new empty glyph loader */\r\n  FT_BASE( FT_Error )\r\n  FT_GlyphLoader_New( FT_Memory        memory,\r\n                      FT_GlyphLoader  *aloader );\r\n\r\n  /* add an extra points table to a glyph loader */\r\n  FT_BASE( FT_Error )\r\n  FT_GlyphLoader_CreateExtra( FT_GlyphLoader  loader );\r\n\r\n  /* destroy a glyph loader */\r\n  FT_BASE( void )\r\n  FT_GlyphLoader_Done( FT_GlyphLoader  loader );\r\n\r\n  /* reset a glyph loader (frees everything int it) */\r\n  FT_BASE( void )\r\n  FT_GlyphLoader_Reset( FT_GlyphLoader  loader );\r\n\r\n  /* rewind a glyph loader */\r\n  FT_BASE( void )\r\n  FT_GlyphLoader_Rewind( FT_GlyphLoader  loader );\r\n\r\n  /* check that there is enough space to add `n_points' and `n_contours' */\r\n  /* to the glyph loader                                                 */\r\n  FT_BASE( FT_Error )\r\n  FT_GlyphLoader_CheckPoints( FT_GlyphLoader  loader,\r\n                              FT_UInt         n_points,\r\n                              FT_UInt         n_contours );\r\n\r\n\r\n#define FT_GLYPHLOADER_CHECK_P( _loader, _count )                    \\\r\n   ( (_count) == 0 || (int)((_loader)->base.outline.n_points    +    \\\r\n                            (_loader)->current.outline.n_points +    \\\r\n                            (_count)) <= (int)(_loader)->max_points )\r\n\r\n#define FT_GLYPHLOADER_CHECK_C( _loader, _count )                     \\\r\n  ( (_count) == 0 || (int)((_loader)->base.outline.n_contours    +    \\\r\n                           (_loader)->current.outline.n_contours +    \\\r\n                           (_count)) <= (int)(_loader)->max_contours )\r\n\r\n#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours )      \\\r\n  ( ( FT_GLYPHLOADER_CHECK_P( _loader, _points )   &&                  \\\r\n      FT_GLYPHLOADER_CHECK_C( _loader, _contours ) )                   \\\r\n    ? 0                                                                \\\r\n    : FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )\r\n\r\n\r\n  /* check that there is enough space to add `n_subs' sub-glyphs to */\r\n  /* a glyph loader                                                 */\r\n  FT_BASE( FT_Error )\r\n  FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader  loader,\r\n                                 FT_UInt         n_subs );\r\n\r\n  /* prepare a glyph loader, i.e. empty the current glyph */\r\n  FT_BASE( void )\r\n  FT_GlyphLoader_Prepare( FT_GlyphLoader  loader );\r\n\r\n  /* add the current glyph to the base glyph */\r\n  FT_BASE( void )\r\n  FT_GlyphLoader_Add( FT_GlyphLoader  loader );\r\n\r\n  /* copy points from one glyph loader to another */\r\n  FT_BASE( FT_Error )\r\n  FT_GlyphLoader_CopyPoints( FT_GlyphLoader  target,\r\n                             FT_GlyphLoader  source );\r\n\r\n /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTGLOADR_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftmemory.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftmemory.h                                                             */\r\n/*                                                                         */\r\n/*    The FreeType memory management macros (specification).               */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007 by                   */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg                       */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __FTMEMORY_H__\r\n#define __FTMEMORY_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_CONFIG_CONFIG_H\r\n#include FT_TYPES_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Macro>                                                               */\r\n  /*    FT_SET_ERROR                                                       */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    This macro is used to set an implicit `error' variable to a given  */\r\n  /*    expression's value (usually a function call), and convert it to a  */\r\n  /*    boolean which is set whenever the value is != 0.                   */\r\n  /*                                                                       */\r\n#undef  FT_SET_ERROR\r\n#define FT_SET_ERROR( expression ) \\\r\n          ( ( error = (expression) ) != 0 )\r\n\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /****                           M E M O R Y                           ****/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /*\r\n   *  C++ refuses to handle statements like p = (void*)anything; where `p'\r\n   *  is a typed pointer.  Since we don't have a `typeof' operator in\r\n   *  standard C++, we have to use ugly casts.\r\n   */\r\n\r\n#ifdef __cplusplus\r\n#define FT_ASSIGNP( p, val )  *((void**)&(p)) = (val)\r\n#else\r\n#define FT_ASSIGNP( p, val )  (p) = (val)\r\n#endif\r\n\r\n\r\n\r\n#ifdef FT_DEBUG_MEMORY\r\n\r\n  FT_BASE( const char* )  _ft_debug_file;\r\n  FT_BASE( long )         _ft_debug_lineno;\r\n\r\n#define FT_DEBUG_INNER( exp )  ( _ft_debug_file   = __FILE__, \\\r\n                                 _ft_debug_lineno = __LINE__, \\\r\n                                 (exp) )\r\n\r\n#define FT_ASSIGNP_INNER( p, exp )  ( _ft_debug_file   = __FILE__, \\\r\n                                      _ft_debug_lineno = __LINE__, \\\r\n                                      FT_ASSIGNP( p, exp ) )\r\n\r\n#else /* !FT_DEBUG_MEMORY */\r\n\r\n#define FT_DEBUG_INNER( exp )       (exp)\r\n#define FT_ASSIGNP_INNER( p, exp )  FT_ASSIGNP( p, exp )\r\n\r\n#endif /* !FT_DEBUG_MEMORY */\r\n\r\n\r\n  /*\r\n   *  The allocation functions return a pointer, and the error code\r\n   *  is written to through the `p_error' parameter.  See below for\r\n   *  for documentation.\r\n   */\r\n\r\n  FT_BASE( FT_Pointer )\r\n  ft_mem_alloc( FT_Memory  memory,\r\n                FT_Long    size,\r\n                FT_Error  *p_error );\r\n\r\n  FT_BASE( FT_Pointer )\r\n  ft_mem_qalloc( FT_Memory  memory,\r\n                 FT_Long    size,\r\n                 FT_Error  *p_error );\r\n\r\n  FT_BASE( FT_Pointer )\r\n  ft_mem_realloc( FT_Memory  memory,\r\n                  FT_Long    item_size,\r\n                  FT_Long    cur_count,\r\n                  FT_Long    new_count,\r\n                  void*      block,\r\n                  FT_Error  *p_error );\r\n\r\n  FT_BASE( FT_Pointer )\r\n  ft_mem_qrealloc( FT_Memory  memory,\r\n                   FT_Long    item_size,\r\n                   FT_Long    cur_count,\r\n                   FT_Long    new_count,\r\n                   void*      block,\r\n                   FT_Error  *p_error );\r\n\r\n  FT_BASE( void )\r\n  ft_mem_free( FT_Memory    memory,\r\n               const void*  P );\r\n\r\n\r\n#define FT_MEM_ALLOC( ptr, size )                                         \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, (size), &error ) )\r\n\r\n#define FT_MEM_FREE( ptr )                \\\r\n          FT_BEGIN_STMNT                  \\\r\n            ft_mem_free( memory, (ptr) ); \\\r\n            (ptr) = NULL;                 \\\r\n          FT_END_STMNT\r\n\r\n#define FT_MEM_NEW( ptr )                        \\\r\n          FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )\r\n\r\n#define FT_MEM_REALLOC( ptr, cursz, newsz )                        \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, 1,        \\\r\n                                                 (cursz), (newsz), \\\r\n                                                 (ptr), &error ) )\r\n\r\n#define FT_MEM_QALLOC( ptr, size )                                         \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, (size), &error ) )\r\n\r\n#define FT_MEM_QNEW( ptr )                        \\\r\n          FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )\r\n\r\n#define FT_MEM_QREALLOC( ptr, cursz, newsz )                         \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, 1,        \\\r\n                                                  (cursz), (newsz), \\\r\n                                                  (ptr), &error ) )\r\n\r\n#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                             \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \\\r\n                                                  (cursz), (newsz),          \\\r\n                                                  (ptr), &error ) )\r\n\r\n#define FT_MEM_ALLOC_MULT( ptr, count, item_size )                    \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (item_size), \\\r\n                                                 0, (count),          \\\r\n                                                 NULL, &error ) )\r\n\r\n#define FT_MEM_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )            \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, (itmsz),    \\\r\n                                                 (oldcnt), (newcnt), \\\r\n                                                 (ptr), &error ) )\r\n\r\n#define FT_MEM_QALLOC_MULT( ptr, count, item_size )                    \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (item_size), \\\r\n                                                  0, (count),          \\\r\n                                                  NULL, &error ) )\r\n\r\n#define FT_MEM_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz)             \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, (itmsz),    \\\r\n                                                  (oldcnt), (newcnt), \\\r\n                                                  (ptr), &error ) )\r\n\r\n\r\n#define FT_MEM_SET_ERROR( cond )  ( (cond), error != 0 )\r\n\r\n\r\n#define FT_MEM_SET( dest, byte, count )     ft_memset( dest, byte, count )\r\n\r\n#define FT_MEM_COPY( dest, source, count )  ft_memcpy( dest, source, count )\r\n\r\n#define FT_MEM_MOVE( dest, source, count )  ft_memmove( dest, source, count )\r\n\r\n\r\n#define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )\r\n\r\n#define FT_ZERO( p )                FT_MEM_ZERO( p, sizeof ( *(p) ) )\r\n\r\n\r\n#define FT_ARRAY_ZERO( dest, count )                        \\\r\n          FT_MEM_ZERO( dest, (count) * sizeof ( *(dest) ) )\r\n\r\n#define FT_ARRAY_COPY( dest, source, count )                        \\\r\n          FT_MEM_COPY( dest, source, (count) * sizeof ( *(dest) ) )\r\n\r\n#define FT_ARRAY_MOVE( dest, source, count )                        \\\r\n          FT_MEM_MOVE( dest, source, (count) * sizeof ( *(dest) ) )\r\n\r\n\r\n  /*\r\n   *  Return the maximum number of addressable elements in an array.\r\n   *  We limit ourselves to INT_MAX, rather than UINT_MAX, to avoid\r\n   *  any problems.\r\n   */\r\n#define FT_ARRAY_MAX( ptr )           ( FT_INT_MAX / sizeof ( *(ptr) ) )\r\n\r\n#define FT_ARRAY_CHECK( ptr, count )  ( (count) <= FT_ARRAY_MAX( ptr ) )\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* The following functions macros expect that their pointer argument is  */\r\n  /* _typed_ in order to automatically compute array element sizes.        */\r\n  /*                                                                       */\r\n\r\n#define FT_MEM_NEW_ARRAY( ptr, count )                                      \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \\\r\n                                                 0, (count),                \\\r\n                                                 NULL, &error ) )\r\n\r\n#define FT_MEM_RENEW_ARRAY( ptr, cursz, newsz )                             \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, sizeof ( *(ptr) ), \\\r\n                                                 (cursz), (newsz),          \\\r\n                                                 (ptr), &error ) )\r\n\r\n#define FT_MEM_QNEW_ARRAY( ptr, count )                                      \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \\\r\n                                                  0, (count),                \\\r\n                                                  NULL, &error ) )\r\n\r\n#define FT_MEM_QRENEW_ARRAY( ptr, cursz, newsz )                             \\\r\n          FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, sizeof ( *(ptr) ), \\\r\n                                                  (cursz), (newsz),          \\\r\n                                                  (ptr), &error ) )\r\n\r\n\r\n#define FT_ALLOC( ptr, size )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )\r\n\r\n#define FT_REALLOC( ptr, cursz, newsz )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )\r\n\r\n#define FT_ALLOC_MULT( ptr, count, item_size )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )\r\n\r\n#define FT_REALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\r\n          FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt,      \\\r\n                                                 newcnt, itmsz ) )\r\n\r\n#define FT_QALLOC( ptr, size )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )\r\n\r\n#define FT_QREALLOC( ptr, cursz, newsz )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )\r\n\r\n#define FT_QALLOC_MULT( ptr, count, item_size )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )\r\n\r\n#define FT_QREALLOC_MULT( ptr, oldcnt, newcnt, itmsz )              \\\r\n          FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt,      \\\r\n                                                  newcnt, itmsz ) )\r\n\r\n#define FT_FREE( ptr )  FT_MEM_FREE( ptr )\r\n\r\n#define FT_NEW( ptr )  FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )\r\n\r\n#define FT_NEW_ARRAY( ptr, count )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\r\n\r\n#define FT_RENEW_ARRAY( ptr, curcnt, newcnt )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\r\n\r\n#define FT_QNEW( ptr )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )\r\n\r\n#define FT_QNEW_ARRAY( ptr, count )                          \\\r\n          FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )\r\n\r\n#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt )                          \\\r\n          FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )\r\n\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n\r\n  FT_BASE( FT_Error )\r\n  FT_Alloc( FT_Memory  memory,\r\n            FT_Long    size,\r\n            void*     *P );\r\n\r\n  FT_BASE( FT_Error )\r\n  FT_QAlloc( FT_Memory  memory,\r\n             FT_Long    size,\r\n             void*     *p );\r\n\r\n  FT_BASE( FT_Error )\r\n  FT_Realloc( FT_Memory  memory,\r\n              FT_Long    current,\r\n              FT_Long    size,\r\n              void*     *P );\r\n\r\n  FT_BASE( FT_Error )\r\n  FT_QRealloc( FT_Memory  memory,\r\n               FT_Long    current,\r\n               FT_Long    size,\r\n               void*     *p );\r\n\r\n  FT_BASE( void )\r\n  FT_Free( FT_Memory  memory,\r\n           void*     *P );\r\n\r\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\r\n\r\n\r\n  FT_BASE( FT_Pointer )\r\n  ft_mem_strdup( FT_Memory    memory,\r\n                 const char*  str,\r\n                 FT_Error    *p_error );\r\n\r\n  FT_BASE( FT_Pointer )\r\n  ft_mem_dup( FT_Memory    memory,\r\n              const void*  address,\r\n              FT_ULong     size,\r\n              FT_Error    *p_error );\r\n\r\n#define FT_MEM_STRDUP( dst, str )                                     \\\r\n          (dst) = ft_mem_strdup( memory, (const char*)(str), &error )\r\n\r\n#define FT_STRDUP( dst, str )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )\r\n\r\n#define FT_MEM_DUP( dst, address, size )                                    \\\r\n          (dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )\r\n\r\n#define FT_DUP( dst, address, size )                           \\\r\n          FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )\r\n\r\n\r\n  /* Return >= 1 if a truncation occurs.            */\r\n  /* Return 0 if the source string fits the buffer. */\r\n  /* This is *not* the same as strlcpy().           */\r\n  FT_BASE( FT_Int )\r\n  ft_mem_strcpyn( char*        dst,\r\n                  const char*  src,\r\n                  FT_ULong     size );\r\n\r\n#define FT_STRCPYN( dst, src, size )                                         \\\r\n          ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )\r\n\r\n /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTMEMORY_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftobjs.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftobjs.h                                                               */\r\n/*                                                                         */\r\n/*    The FreeType private base classes (specification).                   */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /*  This file contains the definition of all internal FreeType classes.  */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n\r\n#ifndef __FTOBJS_H__\r\n#define __FTOBJS_H__\r\n\r\n#include <ft2build.h>\r\n#include FT_RENDER_H\r\n#include FT_SIZES_H\r\n#include FT_LCD_FILTER_H\r\n#include FT_INTERNAL_MEMORY_H\r\n#include FT_INTERNAL_GLYPH_LOADER_H\r\n#include FT_INTERNAL_DRIVER_H\r\n#include FT_INTERNAL_AUTOHINT_H\r\n#include FT_INTERNAL_SERVICE_H\r\n\r\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\r\n#include FT_INCREMENTAL_H\r\n#endif\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* Some generic definitions.                                             */\r\n  /*                                                                       */\r\n#ifndef TRUE\r\n#define TRUE  1\r\n#endif\r\n\r\n#ifndef FALSE\r\n#define FALSE  0\r\n#endif\r\n\r\n#ifndef NULL\r\n#define NULL  (void*)0\r\n#endif\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* The min and max functions missing in C.  As usual, be careful not to  */\r\n  /* write things like FT_MIN( a++, b++ ) to avoid side effects.           */\r\n  /*                                                                       */\r\n#define FT_MIN( a, b )  ( (a) < (b) ? (a) : (b) )\r\n#define FT_MAX( a, b )  ( (a) > (b) ? (a) : (b) )\r\n\r\n#define FT_ABS( a )     ( (a) < 0 ? -(a) : (a) )\r\n\r\n\r\n#define FT_PAD_FLOOR( x, n )  ( (x) & ~((n)-1) )\r\n#define FT_PAD_ROUND( x, n )  FT_PAD_FLOOR( (x) + ((n)/2), n )\r\n#define FT_PAD_CEIL( x, n )   FT_PAD_FLOOR( (x) + ((n)-1), n )\r\n\r\n#define FT_PIX_FLOOR( x )     ( (x) & ~63 )\r\n#define FT_PIX_ROUND( x )     FT_PIX_FLOOR( (x) + 32 )\r\n#define FT_PIX_CEIL( x )      FT_PIX_FLOOR( (x) + 63 )\r\n\r\n\r\n  /*\r\n   *  Return the highest power of 2 that is <= value; this correspond to\r\n   *  the highest bit in a given 32-bit value.\r\n   */\r\n  FT_BASE( FT_UInt32 )\r\n  ft_highpow2( FT_UInt32  value );\r\n\r\n\r\n  /*\r\n   *  character classification functions -- since these are used to parse\r\n   *  font files, we must not use those in <ctypes.h> which are\r\n   *  locale-dependent\r\n   */\r\n#define  ft_isdigit( x )   ( ( (unsigned)(x) - '0' ) < 10U )\r\n\r\n#define  ft_isxdigit( x )  ( ( (unsigned)(x) - '0' ) < 10U || \\\r\n                             ( (unsigned)(x) - 'a' ) < 6U  || \\\r\n                             ( (unsigned)(x) - 'A' ) < 6U  )\r\n\r\n  /* the next two macros assume ASCII representation */\r\n#define  ft_isupper( x )  ( ( (unsigned)(x) - 'A' ) < 26U )\r\n#define  ft_islower( x )  ( ( (unsigned)(x) - 'a' ) < 26U )\r\n\r\n#define  ft_isalpha( x )  ( ft_isupper( x ) || ft_islower( x ) )\r\n#define  ft_isalnum( x )  ( ft_isdigit( x ) || ft_isalpha( x ) )\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /****                       C H A R M A P S                           ****/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  /* handle to internal charmap object */\r\n  typedef struct FT_CMapRec_*              FT_CMap;\r\n\r\n  /* handle to charmap class structure */\r\n  typedef const struct FT_CMap_ClassRec_*  FT_CMap_Class;\r\n\r\n  /* internal charmap object structure */\r\n  typedef struct  FT_CMapRec_\r\n  {\r\n    FT_CharMapRec  charmap;\r\n    FT_CMap_Class  clazz;\r\n\r\n  } FT_CMapRec;\r\n\r\n  /* typecase any pointer to a charmap handle */\r\n#define FT_CMAP( x )              ((FT_CMap)( x ))\r\n\r\n  /* obvious macros */\r\n#define FT_CMAP_PLATFORM_ID( x )  FT_CMAP( x )->charmap.platform_id\r\n#define FT_CMAP_ENCODING_ID( x )  FT_CMAP( x )->charmap.encoding_id\r\n#define FT_CMAP_ENCODING( x )     FT_CMAP( x )->charmap.encoding\r\n#define FT_CMAP_FACE( x )         FT_CMAP( x )->charmap.face\r\n\r\n\r\n  /* class method definitions */\r\n  typedef FT_Error\r\n  (*FT_CMap_InitFunc)( FT_CMap     cmap,\r\n                       FT_Pointer  init_data );\r\n\r\n  typedef void\r\n  (*FT_CMap_DoneFunc)( FT_CMap  cmap );\r\n\r\n  typedef FT_UInt\r\n  (*FT_CMap_CharIndexFunc)( FT_CMap    cmap,\r\n                            FT_UInt32  char_code );\r\n\r\n  typedef FT_UInt\r\n  (*FT_CMap_CharNextFunc)( FT_CMap     cmap,\r\n                           FT_UInt32  *achar_code );\r\n\r\n\r\n  typedef struct  FT_CMap_ClassRec_\r\n  {\r\n    FT_ULong               size;\r\n    FT_CMap_InitFunc       init;\r\n    FT_CMap_DoneFunc       done;\r\n    FT_CMap_CharIndexFunc  char_index;\r\n    FT_CMap_CharNextFunc   char_next;\r\n\r\n  } FT_CMap_ClassRec;\r\n\r\n\r\n  /* create a new charmap and add it to charmap->face */\r\n  FT_BASE( FT_Error )\r\n  FT_CMap_New( FT_CMap_Class  clazz,\r\n               FT_Pointer     init_data,\r\n               FT_CharMap     charmap,\r\n               FT_CMap       *acmap );\r\n\r\n  /* destroy a charmap and remove it from face's list */\r\n  FT_BASE( void )\r\n  FT_CMap_Done( FT_CMap  cmap );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    FT_Face_InternalRec                                                */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    This structure contains the internal fields of each FT_Face        */\r\n  /*    object.  These fields may change between different releases of     */\r\n  /*    FreeType.                                                          */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    max_points ::                                                      */\r\n  /*      The maximal number of points used to store the vectorial outline */\r\n  /*      of any glyph in this face.  If this value cannot be known in     */\r\n  /*      advance, or if the face isn't scalable, this should be set to 0. */\r\n  /*      Only relevant for scalable formats.                              */\r\n  /*                                                                       */\r\n  /*    max_contours ::                                                    */\r\n  /*      The maximal number of contours used to store the vectorial       */\r\n  /*      outline of any glyph in this face.  If this value cannot be      */\r\n  /*      known in advance, or if the face isn't scalable, this should be  */\r\n  /*      set to 0.  Only relevant for scalable formats.                   */\r\n  /*                                                                       */\r\n  /*    transform_matrix ::                                                */\r\n  /*      A 2x2 matrix of 16.16 coefficients used to transform glyph       */\r\n  /*      outlines after they are loaded from the font.  Only used by the  */\r\n  /*      convenience functions.                                           */\r\n  /*                                                                       */\r\n  /*    transform_delta ::                                                 */\r\n  /*      A translation vector used to transform glyph outlines after they */\r\n  /*      are loaded from the font.  Only used by the convenience          */\r\n  /*      functions.                                                       */\r\n  /*                                                                       */\r\n  /*    transform_flags ::                                                 */\r\n  /*      Some flags used to classify the transform.  Only used by the     */\r\n  /*      convenience functions.                                           */\r\n  /*                                                                       */\r\n  /*    services ::                                                        */\r\n  /*      A cache for frequently used services.  It should be only         */\r\n  /*      accessed with the macro `FT_FACE_LOOKUP_SERVICE'.                */\r\n  /*                                                                       */\r\n  /*    incremental_interface ::                                           */\r\n  /*      If non-null, the interface through which glyph data and metrics  */\r\n  /*      are loaded incrementally for faces that do not provide all of    */\r\n  /*      this data when first opened.  This field exists only if          */\r\n  /*      @FT_CONFIG_OPTION_INCREMENTAL is defined.                        */\r\n  /*                                                                       */\r\n  /*    ignore_unpatented_hinter ::                                        */\r\n  /*      This boolean flag instructs the glyph loader to ignore the       */\r\n  /*      native font hinter, if one is found.  This is exclusively used   */\r\n  /*      in the case when the unpatented hinter is compiled within the    */\r\n  /*      library.                                                         */\r\n  /*                                                                       */\r\n  typedef struct  FT_Face_InternalRec_\r\n  {\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    FT_UShort           reserved1;\r\n    FT_Short            reserved2;\r\n#endif\r\n    FT_Matrix           transform_matrix;\r\n    FT_Vector           transform_delta;\r\n    FT_Int              transform_flags;\r\n\r\n    FT_ServiceCacheRec  services;\r\n\r\n#ifdef FT_CONFIG_OPTION_INCREMENTAL\r\n    FT_Incremental_InterfaceRec*  incremental_interface;\r\n#endif\r\n\r\n    FT_Bool             ignore_unpatented_hinter;\r\n\r\n  } FT_Face_InternalRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    FT_Slot_InternalRec                                                */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    This structure contains the internal fields of each FT_GlyphSlot   */\r\n  /*    object.  These fields may change between different releases of     */\r\n  /*    FreeType.                                                          */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    loader            :: The glyph loader object used to load outlines */\r\n  /*                         into the glyph slot.                          */\r\n  /*                                                                       */\r\n  /*    flags             :: Possible values are zero or                   */\r\n  /*                         FT_GLYPH_OWN_BITMAP.  The latter indicates    */\r\n  /*                         that the FT_GlyphSlot structure owns the      */\r\n  /*                         bitmap buffer.                                */\r\n  /*                                                                       */\r\n  /*    glyph_transformed :: Boolean.  Set to TRUE when the loaded glyph   */\r\n  /*                         must be transformed through a specific        */\r\n  /*                         font transformation.  This is _not_ the same  */\r\n  /*                         as the face transform set through             */\r\n  /*                         FT_Set_Transform().                           */\r\n  /*                                                                       */\r\n  /*    glyph_matrix      :: The 2x2 matrix corresponding to the glyph     */\r\n  /*                         transformation, if necessary.                 */\r\n  /*                                                                       */\r\n  /*    glyph_delta       :: The 2d translation vector corresponding to    */\r\n  /*                         the glyph transformation, if necessary.       */\r\n  /*                                                                       */\r\n  /*    glyph_hints       :: Format-specific glyph hints management.       */\r\n  /*                                                                       */\r\n\r\n#define FT_GLYPH_OWN_BITMAP  0x1\r\n\r\n  typedef struct  FT_Slot_InternalRec_\r\n  {\r\n    FT_GlyphLoader  loader;\r\n    FT_UInt         flags;\r\n    FT_Bool         glyph_transformed;\r\n    FT_Matrix       glyph_matrix;\r\n    FT_Vector       glyph_delta;\r\n    void*           glyph_hints;\r\n\r\n  } FT_GlyphSlot_InternalRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /****                         M O D U L E S                           ****/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    FT_ModuleRec                                                       */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A module object instance.                                          */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    clazz   :: A pointer to the module's class.                        */\r\n  /*                                                                       */\r\n  /*    library :: A handle to the parent library object.                  */\r\n  /*                                                                       */\r\n  /*    memory  :: A handle to the memory manager.                         */\r\n  /*                                                                       */\r\n  /*    generic :: A generic structure for user-level extensibility (?).   */\r\n  /*                                                                       */\r\n  typedef struct  FT_ModuleRec_\r\n  {\r\n    FT_Module_Class*  clazz;\r\n    FT_Library        library;\r\n    FT_Memory         memory;\r\n    FT_Generic        generic;\r\n\r\n  } FT_ModuleRec;\r\n\r\n\r\n  /* typecast an object to a FT_Module */\r\n#define FT_MODULE( x )          ((FT_Module)( x ))\r\n#define FT_MODULE_CLASS( x )    FT_MODULE( x )->clazz\r\n#define FT_MODULE_LIBRARY( x )  FT_MODULE( x )->library\r\n#define FT_MODULE_MEMORY( x )   FT_MODULE( x )->memory\r\n\r\n\r\n#define FT_MODULE_IS_DRIVER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\r\n                                    FT_MODULE_FONT_DRIVER )\r\n\r\n#define FT_MODULE_IS_RENDERER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\r\n                                      FT_MODULE_RENDERER )\r\n\r\n#define FT_MODULE_IS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\r\n                                    FT_MODULE_HINTER )\r\n\r\n#define FT_MODULE_IS_STYLER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\r\n                                    FT_MODULE_STYLER )\r\n\r\n#define FT_DRIVER_IS_SCALABLE( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\r\n                                      FT_MODULE_DRIVER_SCALABLE )\r\n\r\n#define FT_DRIVER_USES_OUTLINES( x )  !( FT_MODULE_CLASS( x )->module_flags & \\\r\n                                         FT_MODULE_DRIVER_NO_OUTLINES )\r\n\r\n#define FT_DRIVER_HAS_HINTER( x )  ( FT_MODULE_CLASS( x )->module_flags & \\\r\n                                     FT_MODULE_DRIVER_HAS_HINTER )\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_Get_Module_Interface                                            */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Finds a module and returns its specific interface as a typeless    */\r\n  /*    pointer.                                                           */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    library     :: A handle to the library object.                     */\r\n  /*                                                                       */\r\n  /*    module_name :: The module's name (as an ASCII string).             */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    A module-specific interface if available, 0 otherwise.             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    You should better be familiar with FreeType internals to know      */\r\n  /*    which module to look for, and what its interface is :-)            */\r\n  /*                                                                       */\r\n  FT_BASE( const void* )\r\n  FT_Get_Module_Interface( FT_Library   library,\r\n                           const char*  mod_name );\r\n\r\n  FT_BASE( FT_Pointer )\r\n  ft_module_get_service( FT_Module    module,\r\n                         const char*  service_id );\r\n\r\n /* */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /****               FACE, SIZE & GLYPH SLOT OBJECTS                   ****/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  /* a few macros used to perform easy typecasts with minimal brain damage */\r\n\r\n#define FT_FACE( x )          ((FT_Face)(x))\r\n#define FT_SIZE( x )          ((FT_Size)(x))\r\n#define FT_SLOT( x )          ((FT_GlyphSlot)(x))\r\n\r\n#define FT_FACE_DRIVER( x )   FT_FACE( x )->driver\r\n#define FT_FACE_LIBRARY( x )  FT_FACE_DRIVER( x )->root.library\r\n#define FT_FACE_MEMORY( x )   FT_FACE( x )->memory\r\n#define FT_FACE_STREAM( x )   FT_FACE( x )->stream\r\n\r\n#define FT_SIZE_FACE( x )     FT_SIZE( x )->face\r\n#define FT_SLOT_FACE( x )     FT_SLOT( x )->face\r\n\r\n#define FT_FACE_SLOT( x )     FT_FACE( x )->glyph\r\n#define FT_FACE_SIZE( x )     FT_FACE( x )->size\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_New_GlyphSlot                                                   */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    It is sometimes useful to have more than one glyph slot for a      */\r\n  /*    given face object.  This function is used to create additional     */\r\n  /*    slots.  All of them are automatically discarded when the face is   */\r\n  /*    destroyed.                                                         */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face  :: A handle to a parent face object.                         */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    aslot :: A handle to a new glyph slot object.                      */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  FT_BASE( FT_Error )\r\n  FT_New_GlyphSlot( FT_Face        face,\r\n                    FT_GlyphSlot  *aslot );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_Done_GlyphSlot                                                  */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Destroys a given glyph slot.  Remember however that all slots are  */\r\n  /*    automatically destroyed with its parent.  Using this function is   */\r\n  /*    not always mandatory.                                              */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    slot :: A handle to a target glyph slot.                           */\r\n  /*                                                                       */\r\n  FT_BASE( void )\r\n  FT_Done_GlyphSlot( FT_GlyphSlot  slot );\r\n\r\n /* */\r\n\r\n#define FT_REQUEST_WIDTH( req )                                            \\\r\n          ( (req)->horiResolution                                          \\\r\n              ? (FT_Pos)( (req)->width * (req)->horiResolution + 36 ) / 72 \\\r\n              : (req)->width )\r\n\r\n#define FT_REQUEST_HEIGHT( req )                                            \\\r\n          ( (req)->vertResolution                                           \\\r\n              ? (FT_Pos)( (req)->height * (req)->vertResolution + 36 ) / 72 \\\r\n              : (req)->height )\r\n\r\n\r\n  /* Set the metrics according to a bitmap strike. */\r\n  FT_BASE( void )\r\n  FT_Select_Metrics( FT_Face   face,\r\n                     FT_ULong  strike_index );\r\n\r\n\r\n  /* Set the metrics according to a size request. */\r\n  FT_BASE( void )\r\n  FT_Request_Metrics( FT_Face          face,\r\n                      FT_Size_Request  req );\r\n\r\n\r\n  /* Match a size request against `available_sizes'. */\r\n  FT_BASE( FT_Error )\r\n  FT_Match_Size( FT_Face          face,\r\n                 FT_Size_Request  req,\r\n                 FT_Bool          ignore_width,\r\n                 FT_ULong*        size_index );\r\n\r\n\r\n  /* Use the horizontal metrics to synthesize the vertical metrics. */\r\n  /* If `advance' is zero, it is also synthesized.                  */\r\n  FT_BASE( void )\r\n  ft_synthesize_vertical_metrics( FT_Glyph_Metrics*  metrics,\r\n                                  FT_Pos             advance );\r\n\r\n\r\n  /* Free the bitmap of a given glyphslot when needed (i.e., only when it */\r\n  /* was allocated with ft_glyphslot_alloc_bitmap).                       */\r\n  FT_BASE( void )\r\n  ft_glyphslot_free_bitmap( FT_GlyphSlot  slot );\r\n\r\n\r\n  /* Allocate a new bitmap buffer in a glyph slot. */\r\n  FT_BASE( FT_Error )\r\n  ft_glyphslot_alloc_bitmap( FT_GlyphSlot  slot,\r\n                             FT_ULong      size );\r\n\r\n\r\n  /* Set the bitmap buffer in a glyph slot to a given pointer.  The buffer */\r\n  /* will not be freed by a later call to ft_glyphslot_free_bitmap.        */\r\n  FT_BASE( void )\r\n  ft_glyphslot_set_bitmap( FT_GlyphSlot  slot,\r\n                           FT_Byte*      buffer );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /****                        R E N D E R E R S                        ****/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n#define FT_RENDERER( x )      ((FT_Renderer)( x ))\r\n#define FT_GLYPH( x )         ((FT_Glyph)( x ))\r\n#define FT_BITMAP_GLYPH( x )  ((FT_BitmapGlyph)( x ))\r\n#define FT_OUTLINE_GLYPH( x ) ((FT_OutlineGlyph)( x ))\r\n\r\n\r\n  typedef struct  FT_RendererRec_\r\n  {\r\n    FT_ModuleRec            root;\r\n    FT_Renderer_Class*      clazz;\r\n    FT_Glyph_Format         glyph_format;\r\n    FT_Glyph_Class          glyph_class;\r\n\r\n    FT_Raster               raster;\r\n    FT_Raster_Render_Func   raster_render;\r\n    FT_Renderer_RenderFunc  render;\r\n\r\n  } FT_RendererRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /****                    F O N T   D R I V E R S                      ****/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /* typecast a module into a driver easily */\r\n#define FT_DRIVER( x )        ((FT_Driver)(x))\r\n\r\n  /* typecast a module as a driver, and get its driver class */\r\n#define FT_DRIVER_CLASS( x )  FT_DRIVER( x )->clazz\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    FT_DriverRec                                                       */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    The root font driver class.  A font driver is responsible for      */\r\n  /*    managing and loading font files of a given format.                 */\r\n  /*                                                                       */\r\n  /*  <Fields>                                                             */\r\n  /*     root         :: Contains the fields of the root module class.     */\r\n  /*                                                                       */\r\n  /*     clazz        :: A pointer to the font driver's class.  Note that  */\r\n  /*                     this is NOT root.clazz.  `class' wasn't used      */\r\n  /*                     as it is a reserved word in C++.                  */\r\n  /*                                                                       */\r\n  /*     faces_list   :: The list of faces currently opened by this        */\r\n  /*                     driver.                                           */\r\n  /*                                                                       */\r\n  /*     extensions   :: A typeless pointer to the driver's extensions     */\r\n  /*                     registry, if they are supported through the       */\r\n  /*                     configuration macro FT_CONFIG_OPTION_EXTENSIONS.  */\r\n  /*                                                                       */\r\n  /*     glyph_loader :: The glyph loader for all faces managed by this    */\r\n  /*                     driver.  This object isn't defined for unscalable */\r\n  /*                     formats.                                          */\r\n  /*                                                                       */\r\n  typedef struct  FT_DriverRec_\r\n  {\r\n    FT_ModuleRec     root;\r\n    FT_Driver_Class  clazz;\r\n\r\n    FT_ListRec       faces_list;\r\n    void*            extensions;\r\n\r\n    FT_GlyphLoader   glyph_loader;\r\n\r\n  } FT_DriverRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /****                       L I B R A R I E S                         ****/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /* This hook is used by the TrueType debugger.  It must be set to an */\r\n  /* alternate truetype bytecode interpreter function.                 */\r\n#define FT_DEBUG_HOOK_TRUETYPE            0\r\n\r\n\r\n  /* Set this debug hook to a non-null pointer to force unpatented hinting */\r\n  /* for all faces when both TT_USE_BYTECODE_INTERPRETER and               */\r\n  /* TT_CONFIG_OPTION_UNPATENTED_HINTING are defined.  This is only used   */\r\n  /* during debugging.                                                     */\r\n#define FT_DEBUG_HOOK_UNPATENTED_HINTING  1\r\n\r\n\r\n  typedef void  (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap*      bitmap,\r\n                                            FT_Render_Mode  render_mode,\r\n                                            FT_Library      library );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    FT_LibraryRec                                                      */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    The FreeType library class.  This is the root of all FreeType      */\r\n  /*    data.  Use FT_New_Library() to create a library object, and        */\r\n  /*    FT_Done_Library() to discard it and all child objects.             */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    memory           :: The library's memory object.  Manages memory   */\r\n  /*                        allocation.                                    */\r\n  /*                                                                       */\r\n  /*    generic          :: Client data variable.  Used to extend the      */\r\n  /*                        Library class by higher levels and clients.    */\r\n  /*                                                                       */\r\n  /*    version_major    :: The major version number of the library.       */\r\n  /*                                                                       */\r\n  /*    version_minor    :: The minor version number of the library.       */\r\n  /*                                                                       */\r\n  /*    version_patch    :: The current patch level of the library.        */\r\n  /*                                                                       */\r\n  /*    num_modules      :: The number of modules currently registered     */\r\n  /*                        within this library.  This is set to 0 for new */\r\n  /*                        libraries.  New modules are added through the  */\r\n  /*                        FT_Add_Module() API function.                  */\r\n  /*                                                                       */\r\n  /*    modules          :: A table used to store handles to the currently */\r\n  /*                        registered modules. Note that each font driver */\r\n  /*                        contains a list of its opened faces.           */\r\n  /*                                                                       */\r\n  /*    renderers        :: The list of renderers currently registered     */\r\n  /*                        within the library.                            */\r\n  /*                                                                       */\r\n  /*    cur_renderer     :: The current outline renderer.  This is a       */\r\n  /*                        shortcut used to avoid parsing the list on     */\r\n  /*                        each call to FT_Outline_Render().  It is a     */\r\n  /*                        handle to the current renderer for the         */\r\n  /*                        FT_GLYPH_FORMAT_OUTLINE format.                */\r\n  /*                                                                       */\r\n  /*    auto_hinter      :: XXX                                            */\r\n  /*                                                                       */\r\n  /*    raster_pool      :: The raster object's render pool.  This can     */\r\n  /*                        ideally be changed dynamically at run-time.    */\r\n  /*                                                                       */\r\n  /*    raster_pool_size :: The size of the render pool in bytes.          */\r\n  /*                                                                       */\r\n  /*    debug_hooks      :: XXX                                            */\r\n  /*                                                                       */\r\n  typedef struct  FT_LibraryRec_\r\n  {\r\n    FT_Memory          memory;           /* library's memory manager */\r\n\r\n    FT_Generic         generic;\r\n\r\n    FT_Int             version_major;\r\n    FT_Int             version_minor;\r\n    FT_Int             version_patch;\r\n\r\n    FT_UInt            num_modules;\r\n    FT_Module          modules[FT_MAX_MODULES];  /* module objects  */\r\n\r\n    FT_ListRec         renderers;        /* list of renderers        */\r\n    FT_Renderer        cur_renderer;     /* current outline renderer */\r\n    FT_Module          auto_hinter;\r\n\r\n    FT_Byte*           raster_pool;      /* scan-line conversion */\r\n                                         /* render pool          */\r\n    FT_ULong           raster_pool_size; /* size of render pool in bytes */\r\n\r\n    FT_DebugHook_Func  debug_hooks[4];\r\n\r\n#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING\r\n    FT_LcdFilter             lcd_filter;\r\n    FT_Int                   lcd_extra;        /* number of extra pixels */\r\n    FT_Byte                  lcd_weights[7];   /* filter weights, if any */\r\n    FT_Bitmap_LcdFilterFunc  lcd_filter_func;  /* filtering callback     */\r\n#endif\r\n\r\n  } FT_LibraryRec;\r\n\r\n\r\n  FT_BASE( FT_Renderer )\r\n  FT_Lookup_Renderer( FT_Library       library,\r\n                      FT_Glyph_Format  format,\r\n                      FT_ListNode*     node );\r\n\r\n  FT_BASE( FT_Error )\r\n  FT_Render_Glyph_Internal( FT_Library      library,\r\n                            FT_GlyphSlot    slot,\r\n                            FT_Render_Mode  render_mode );\r\n\r\n  typedef const char*\r\n  (*FT_Face_GetPostscriptNameFunc)( FT_Face  face );\r\n\r\n  typedef FT_Error\r\n  (*FT_Face_GetGlyphNameFunc)( FT_Face     face,\r\n                               FT_UInt     glyph_index,\r\n                               FT_Pointer  buffer,\r\n                               FT_UInt     buffer_max );\r\n\r\n  typedef FT_UInt\r\n  (*FT_Face_GetGlyphNameIndexFunc)( FT_Face     face,\r\n                                    FT_String*  glyph_name );\r\n\r\n\r\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_New_Memory                                                      */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Creates a new memory object.                                       */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    A pointer to the new memory object.  0 in case of error.           */\r\n  /*                                                                       */\r\n  FT_BASE( FT_Memory )\r\n  FT_New_Memory( void );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_Done_Memory                                                     */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Discards memory manager.                                           */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    memory :: A handle to the memory manager.                          */\r\n  /*                                                                       */\r\n  FT_BASE( void )\r\n  FT_Done_Memory( FT_Memory  memory );\r\n\r\n#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\r\n\r\n\r\n  /* Define default raster's interface.  The default raster is located in  */\r\n  /* `src/base/ftraster.c'.                                                */\r\n  /*                                                                       */\r\n  /* Client applications can register new rasters through the              */\r\n  /* FT_Set_Raster() API.                                                  */\r\n\r\n#ifndef FT_NO_DEFAULT_RASTER\r\n  FT_EXPORT_VAR( FT_Raster_Funcs )  ft_default_raster;\r\n#endif\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTOBJS_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftrfork.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftrfork.h                                                              */\r\n/*                                                                         */\r\n/*    Embedded resource forks accessor (specification).                    */\r\n/*                                                                         */\r\n/*  Copyright 2004, 2006 by                                                */\r\n/*  Masatake YAMATO and Redhat K.K.                                        */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n/***************************************************************************/\r\n/* Development of the code in this file is support of                      */\r\n/* Information-technology Promotion Agency, Japan.                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __FTRFORK_H__\r\n#define __FTRFORK_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_INTERNAL_OBJECTS_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /* Number of guessing rules supported in `FT_Raccess_Guess'.            */\r\n  /* Don't forget to increment the number if you add a new guessing rule. */\r\n#define FT_RACCESS_N_RULES  8\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_Raccess_Guess                                                   */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Guess a file name and offset where the actual resource fork is     */\r\n  /*    stored.  The macro FT_RACCESS_N_RULES holds the number of          */\r\n  /*    guessing rules;  the guessed result for the Nth rule is            */\r\n  /*    represented as a triplet: a new file name (new_names[N]), a file   */\r\n  /*    offset (offsets[N]), and an error code (errors[N]).                */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    library ::                                                         */\r\n  /*      A FreeType library instance.                                     */\r\n  /*                                                                       */\r\n  /*    stream ::                                                          */\r\n  /*      A file stream containing the resource fork.                      */\r\n  /*                                                                       */\r\n  /*    base_name ::                                                       */\r\n  /*      The (base) file name of the resource fork used for some          */\r\n  /*      guessing rules.                                                  */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    new_names ::                                                       */\r\n  /*      An array of guessed file names in which the resource forks may   */\r\n  /*      exist.  If `new_names[N]' is NULL, the guessed file name is      */\r\n  /*      equal to `base_name'.                                            */\r\n  /*                                                                       */\r\n  /*    offsets ::                                                         */\r\n  /*      An array of guessed file offsets.  `offsets[N]' holds the file   */\r\n  /*      offset of the possible start of the resource fork in file        */\r\n  /*      `new_names[N]'.                                                  */\r\n  /*                                                                       */\r\n  /*    errors ::                                                          */\r\n  /*      An array of FreeType error codes.  `errors[N]' is the error      */\r\n  /*      code of Nth guessing rule function.  If `errors[N]' is not       */\r\n  /*      FT_Err_Ok, `new_names[N]' and `offsets[N]' are meaningless.      */\r\n  /*                                                                       */\r\n  FT_BASE( void )\r\n  FT_Raccess_Guess( FT_Library  library,\r\n                    FT_Stream   stream,\r\n                    char*       base_name,\r\n                    char**      new_names,\r\n                    FT_Long*    offsets,\r\n                    FT_Error*   errors );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_Raccess_Get_HeaderInfo                                          */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Get the information from the header of resource fork.  The         */\r\n  /*    information includes the file offset where the resource map        */\r\n  /*    starts, and the file offset where the resource data starts.        */\r\n  /*    `FT_Raccess_Get_DataOffsets' requires these two data.              */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    library ::                                                         */\r\n  /*      A FreeType library instance.                                     */\r\n  /*                                                                       */\r\n  /*    stream ::                                                          */\r\n  /*      A file stream containing the resource fork.                      */\r\n  /*                                                                       */\r\n  /*    rfork_offset ::                                                    */\r\n  /*      The file offset where the resource fork starts.                  */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    map_offset ::                                                      */\r\n  /*      The file offset where the resource map starts.                   */\r\n  /*                                                                       */\r\n  /*    rdata_pos ::                                                       */\r\n  /*      The file offset where the resource data starts.                  */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\r\n  /*                                                                       */\r\n  FT_BASE( FT_Error )\r\n  FT_Raccess_Get_HeaderInfo( FT_Library  library,\r\n                             FT_Stream   stream,\r\n                             FT_Long     rfork_offset,\r\n                             FT_Long    *map_offset,\r\n                             FT_Long    *rdata_pos );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Function>                                                            */\r\n  /*    FT_Raccess_Get_DataOffsets                                         */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Get the data offsets for a tag in a resource fork.  Offsets are    */\r\n  /*    stored in an array because, in some cases, resources in a resource */\r\n  /*    fork have the same tag.                                            */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    library ::                                                         */\r\n  /*      A FreeType library instance.                                     */\r\n  /*                                                                       */\r\n  /*    stream ::                                                          */\r\n  /*      A file stream containing the resource fork.                      */\r\n  /*                                                                       */\r\n  /*    map_offset ::                                                      */\r\n  /*      The file offset where the resource map starts.                   */\r\n  /*                                                                       */\r\n  /*    rdata_pos ::                                                       */\r\n  /*      The file offset where the resource data starts.                  */\r\n  /*                                                                       */\r\n  /*    tag ::                                                             */\r\n  /*      The resource tag.                                                */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    offsets ::                                                         */\r\n  /*      The stream offsets for the resource data specified by `tag'.     */\r\n  /*      This array is allocated by the function, so you have to call     */\r\n  /*      @ft_mem_free after use.                                          */\r\n  /*                                                                       */\r\n  /*    count ::                                                           */\r\n  /*      The length of offsets array.                                     */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  FT_Err_Ok means success.                     */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    Normally you should use `FT_Raccess_Get_HeaderInfo' to get the     */\r\n  /*    value for `map_offset' and `rdata_pos'.                            */\r\n  /*                                                                       */\r\n  FT_BASE( FT_Error )\r\n  FT_Raccess_Get_DataOffsets( FT_Library  library,\r\n                              FT_Stream   stream,\r\n                              FT_Long     map_offset,\r\n                              FT_Long     rdata_pos,\r\n                              FT_Long     tag,\r\n                              FT_Long   **offsets,\r\n                              FT_Long    *count );\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTRFORK_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftserv.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftserv.h                                                               */\r\n/*                                                                         */\r\n/*    The FreeType services (specification only).                          */\r\n/*                                                                         */\r\n/*  Copyright 2003, 2004, 2005, 2006, 2007 by                              */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /*  Each module can export one or more `services'.  Each service is      */\r\n  /*  identified by a constant string and modeled by a pointer; the latter */\r\n  /*  generally corresponds to a structure containing function pointers.   */\r\n  /*                                                                       */\r\n  /*  Note that a service's data cannot be a mere function pointer because */\r\n  /*  in C it is possible that function pointers might be implemented      */\r\n  /*  differently than data pointers (e.g. 48 bits instead of 32).         */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n\r\n#ifndef __FTSERV_H__\r\n#define __FTSERV_H__\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n#if defined( _MSC_VER )      /* Visual C++ (and Intel C++) */\r\n\r\n  /* we disable the warning `conditional expression is constant' here */\r\n  /* in order to compile cleanly with the maximum level of warnings   */\r\n#pragma warning( disable : 4127 )\r\n\r\n#endif /* _MSC_VER */\r\n\r\n  /*\r\n   * @macro:\r\n   *   FT_FACE_FIND_SERVICE\r\n   *\r\n   * @description:\r\n   *   This macro is used to look up a service from a face's driver module.\r\n   *\r\n   * @input:\r\n   *   face ::\r\n   *     The source face handle.\r\n   *\r\n   *   id ::\r\n   *     A string describing the service as defined in the service's\r\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\r\n   *     `multi-masters').  It is automatically prefixed with\r\n   *     `FT_SERVICE_ID_'.\r\n   *\r\n   * @output:\r\n   *   ptr ::\r\n   *     A variable that receives the service pointer.  Will be NULL\r\n   *     if not found.\r\n   */\r\n#ifdef __cplusplus\r\n\r\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\r\n  FT_BEGIN_STMNT                                                            \\\r\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );             \\\r\n    FT_Pointer   _tmp_  = NULL;                                             \\\r\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                              \\\r\n                                                                            \\\r\n                                                                            \\\r\n    if ( module->clazz->get_interface )                                     \\\r\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\r\n    *_pptr_ = _tmp_;                                                        \\\r\n  FT_END_STMNT\r\n\r\n#else /* !C++ */\r\n\r\n#define FT_FACE_FIND_SERVICE( face, ptr, id )                               \\\r\n  FT_BEGIN_STMNT                                                            \\\r\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );              \\\r\n    FT_Pointer  _tmp_  = NULL;                                              \\\r\n                                                                            \\\r\n    if ( module->clazz->get_interface )                                     \\\r\n      _tmp_ = module->clazz->get_interface( module, FT_SERVICE_ID_ ## id ); \\\r\n    ptr = _tmp_;                                                            \\\r\n  FT_END_STMNT\r\n\r\n#endif /* !C++ */\r\n\r\n  /*\r\n   * @macro:\r\n   *   FT_FACE_FIND_GLOBAL_SERVICE\r\n   *\r\n   * @description:\r\n   *   This macro is used to look up a service from all modules.\r\n   *\r\n   * @input:\r\n   *   face ::\r\n   *     The source face handle.\r\n   *\r\n   *   id ::\r\n   *     A string describing the service as defined in the service's\r\n   *     header files (e.g. FT_SERVICE_ID_MULTI_MASTERS which expands to\r\n   *     `multi-masters').  It is automatically prefixed with\r\n   *     `FT_SERVICE_ID_'.\r\n   *\r\n   * @output:\r\n   *   ptr ::\r\n   *     A variable that receives the service pointer.  Will be NULL\r\n   *     if not found.\r\n   */\r\n#ifdef __cplusplus\r\n\r\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\r\n  FT_BEGIN_STMNT                                                   \\\r\n    FT_Module    module = FT_MODULE( FT_FACE( face )->driver );    \\\r\n    FT_Pointer   _tmp_;                                            \\\r\n    FT_Pointer*  _pptr_ = (FT_Pointer*)&(ptr);                     \\\r\n                                                                   \\\r\n                                                                   \\\r\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\r\n    *_pptr_ = _tmp_;                                               \\\r\n  FT_END_STMNT\r\n\r\n#else /* !C++ */\r\n\r\n#define FT_FACE_FIND_GLOBAL_SERVICE( face, ptr, id )               \\\r\n  FT_BEGIN_STMNT                                                   \\\r\n    FT_Module   module = FT_MODULE( FT_FACE( face )->driver );     \\\r\n    FT_Pointer  _tmp_;                                             \\\r\n                                                                   \\\r\n                                                                   \\\r\n    _tmp_ = ft_module_get_service( module, FT_SERVICE_ID_ ## id ); \\\r\n    ptr   = _tmp_;                                                 \\\r\n  FT_END_STMNT\r\n\r\n#endif /* !C++ */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****         S E R V I C E   D E S C R I P T O R S                 *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  /*\r\n   *  The following structure is used to _describe_ a given service\r\n   *  to the library.  This is useful to build simple static service lists.\r\n   */\r\n  typedef struct  FT_ServiceDescRec_\r\n  {\r\n    const char*  serv_id;     /* service name         */\r\n    const void*  serv_data;   /* service pointer/data */\r\n\r\n  } FT_ServiceDescRec;\r\n\r\n  typedef const FT_ServiceDescRec*  FT_ServiceDesc;\r\n\r\n\r\n  /*\r\n   *  Parse a list of FT_ServiceDescRec descriptors and look for\r\n   *  a specific service by ID.  Note that the last element in the\r\n   *  array must be { NULL, NULL }, and that the function should\r\n   *  return NULL if the service isn't available.\r\n   *\r\n   *  This function can be used by modules to implement their\r\n   *  `get_service' method.\r\n   */\r\n  FT_BASE( FT_Pointer )\r\n  ft_service_list_lookup( FT_ServiceDesc  service_descriptors,\r\n                          const char*     service_id );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****             S E R V I C E S   C A C H E                       *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  /*\r\n   *  This structure is used to store a cache for several frequently used\r\n   *  services.  It is the type of `face->internal->services'.  You\r\n   *  should only use FT_FACE_LOOKUP_SERVICE to access it.\r\n   *\r\n   *  All fields should have the type FT_Pointer to relax compilation\r\n   *  dependencies.  We assume the developer isn't completely stupid.\r\n   *\r\n   *  Each field must be named `service_XXXX' where `XXX' corresponds to\r\n   *  the correct FT_SERVICE_ID_XXXX macro.  See the definition of\r\n   *  FT_FACE_LOOKUP_SERVICE below how this is implemented.\r\n   *\r\n   */\r\n  typedef struct  FT_ServiceCacheRec_\r\n  {\r\n    FT_Pointer  service_POSTSCRIPT_FONT_NAME;\r\n    FT_Pointer  service_MULTI_MASTERS;\r\n    FT_Pointer  service_GLYPH_DICT;\r\n    FT_Pointer  service_PFR_METRICS;\r\n    FT_Pointer  service_WINFNT;\r\n\r\n  } FT_ServiceCacheRec, *FT_ServiceCache;\r\n\r\n\r\n  /*\r\n   *  A magic number used within the services cache.\r\n   */\r\n#define FT_SERVICE_UNAVAILABLE  ((FT_Pointer)-2)  /* magic number */\r\n\r\n\r\n  /*\r\n   * @macro:\r\n   *   FT_FACE_LOOKUP_SERVICE\r\n   *\r\n   * @description:\r\n   *   This macro is used to lookup a service from a face's driver module\r\n   *   using its cache.\r\n   *\r\n   * @input:\r\n   *   face::\r\n   *     The source face handle containing the cache.\r\n   *\r\n   *   field ::\r\n   *     The field name in the cache.\r\n   *\r\n   *   id ::\r\n   *     The service ID.\r\n   *\r\n   * @output:\r\n   *   ptr ::\r\n   *     A variable receiving the service data.  NULL if not available.\r\n   */\r\n#ifdef __cplusplus\r\n\r\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\r\n  FT_BEGIN_STMNT                                               \\\r\n    FT_Pointer   svc;                                          \\\r\n    FT_Pointer*  Pptr = (FT_Pointer*)&(ptr);                   \\\r\n                                                               \\\r\n                                                               \\\r\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\r\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\r\n      svc = NULL;                                              \\\r\n    else if ( svc == NULL )                                    \\\r\n    {                                                          \\\r\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\r\n                                                               \\\r\n      FT_FACE( face )->internal->services. service_ ## id =    \\\r\n        (FT_Pointer)( svc != NULL ? svc                        \\\r\n                                  : FT_SERVICE_UNAVAILABLE );  \\\r\n    }                                                          \\\r\n    *Pptr = svc;                                               \\\r\n  FT_END_STMNT\r\n\r\n#else /* !C++ */\r\n\r\n#define FT_FACE_LOOKUP_SERVICE( face, ptr, id )                \\\r\n  FT_BEGIN_STMNT                                               \\\r\n    FT_Pointer  svc;                                           \\\r\n                                                               \\\r\n                                                               \\\r\n    svc = FT_FACE( face )->internal->services. service_ ## id; \\\r\n    if ( svc == FT_SERVICE_UNAVAILABLE )                       \\\r\n      svc = NULL;                                              \\\r\n    else if ( svc == NULL )                                    \\\r\n    {                                                          \\\r\n      FT_FACE_FIND_SERVICE( face, svc, id );                   \\\r\n                                                               \\\r\n      FT_FACE( face )->internal->services. service_ ## id =    \\\r\n        (FT_Pointer)( svc != NULL ? svc                        \\\r\n                                  : FT_SERVICE_UNAVAILABLE );  \\\r\n    }                                                          \\\r\n    ptr = svc;                                                 \\\r\n  FT_END_STMNT\r\n\r\n#endif /* !C++ */\r\n\r\n  /*\r\n   *  A macro used to define new service structure types.\r\n   */\r\n\r\n#define FT_DEFINE_SERVICE( name )            \\\r\n  typedef struct FT_Service_ ## name ## Rec_ \\\r\n    FT_Service_ ## name ## Rec ;             \\\r\n  typedef struct FT_Service_ ## name ## Rec_ \\\r\n    const * FT_Service_ ## name ;            \\\r\n  struct FT_Service_ ## name ## Rec_\r\n\r\n  /* */\r\n\r\n  /*\r\n   *  The header files containing the services.\r\n   */\r\n\r\n#define FT_SERVICE_BDF_H                <freetype/internal/services/svbdf.h>\r\n#define FT_SERVICE_GLYPH_DICT_H         <freetype/internal/services/svgldict.h>\r\n#define FT_SERVICE_GX_VALIDATE_H        <freetype/internal/services/svgxval.h>\r\n#define FT_SERVICE_KERNING_H            <freetype/internal/services/svkern.h>\r\n#define FT_SERVICE_MULTIPLE_MASTERS_H   <freetype/internal/services/svmm.h>\r\n#define FT_SERVICE_OPENTYPE_VALIDATE_H  <freetype/internal/services/svotval.h>\r\n#define FT_SERVICE_PFR_H                <freetype/internal/services/svpfr.h>\r\n#define FT_SERVICE_POSTSCRIPT_CMAPS_H   <freetype/internal/services/svpscmap.h>\r\n#define FT_SERVICE_POSTSCRIPT_INFO_H    <freetype/internal/services/svpsinfo.h>\r\n#define FT_SERVICE_POSTSCRIPT_NAME_H    <freetype/internal/services/svpostnm.h>\r\n#define FT_SERVICE_SFNT_H               <freetype/internal/services/svsfnt.h>\r\n#define FT_SERVICE_TRUETYPE_ENGINE_H    <freetype/internal/services/svtteng.h>\r\n#define FT_SERVICE_TT_CMAP_H            <freetype/internal/services/svttcmap.h>\r\n#define FT_SERVICE_WINFNT_H             <freetype/internal/services/svwinfnt.h>\r\n#define FT_SERVICE_XFREE86_NAME_H       <freetype/internal/services/svxf86nm.h>\r\n#define FT_SERVICE_TRUETYPE_GLYF_H      <freetype/internal/services/svttglyf.h>\r\n\r\n /* */\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTSERV_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftstream.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftstream.h                                                             */\r\n/*                                                                         */\r\n/*    Stream handling (specification).                                     */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2004, 2005, 2006 by                         */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __FTSTREAM_H__\r\n#define __FTSTREAM_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_SYSTEM_H\r\n#include FT_INTERNAL_OBJECTS_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /* format of an 8-bit frame_op value:           */\r\n  /*                                              */\r\n  /* bit  76543210                                */\r\n  /*      xxxxxxes                                */\r\n  /*                                              */\r\n  /* s is set to 1 if the value is signed.        */\r\n  /* e is set to 1 if the value is little-endian. */\r\n  /* xxx is a command.                            */\r\n\r\n#define FT_FRAME_OP_SHIFT         2\r\n#define FT_FRAME_OP_SIGNED        1\r\n#define FT_FRAME_OP_LITTLE        2\r\n#define FT_FRAME_OP_COMMAND( x )  ( x >> FT_FRAME_OP_SHIFT )\r\n\r\n#define FT_MAKE_FRAME_OP( command, little, sign ) \\\r\n          ( ( command << FT_FRAME_OP_SHIFT ) | ( little << 1 ) | sign )\r\n\r\n#define FT_FRAME_OP_END    0\r\n#define FT_FRAME_OP_START  1  /* start a new frame     */\r\n#define FT_FRAME_OP_BYTE   2  /* read 1-byte value     */\r\n#define FT_FRAME_OP_SHORT  3  /* read 2-byte value     */\r\n#define FT_FRAME_OP_LONG   4  /* read 4-byte value     */\r\n#define FT_FRAME_OP_OFF3   5  /* read 3-byte value     */\r\n#define FT_FRAME_OP_BYTES  6  /* read a bytes sequence */\r\n\r\n\r\n  typedef enum  FT_Frame_Op_\r\n  {\r\n    ft_frame_end       = 0,\r\n    ft_frame_start     = FT_MAKE_FRAME_OP( FT_FRAME_OP_START, 0, 0 ),\r\n\r\n    ft_frame_byte      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 0 ),\r\n    ft_frame_schar     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTE,  0, 1 ),\r\n\r\n    ft_frame_ushort_be = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 0 ),\r\n    ft_frame_short_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 0, 1 ),\r\n    ft_frame_ushort_le = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 0 ),\r\n    ft_frame_short_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_SHORT, 1, 1 ),\r\n\r\n    ft_frame_ulong_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 0 ),\r\n    ft_frame_long_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 0, 1 ),\r\n    ft_frame_ulong_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 0 ),\r\n    ft_frame_long_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_LONG, 1, 1 ),\r\n\r\n    ft_frame_uoff3_be  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 0 ),\r\n    ft_frame_off3_be   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 0, 1 ),\r\n    ft_frame_uoff3_le  = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 0 ),\r\n    ft_frame_off3_le   = FT_MAKE_FRAME_OP( FT_FRAME_OP_OFF3, 1, 1 ),\r\n\r\n    ft_frame_bytes     = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 0 ),\r\n    ft_frame_skip      = FT_MAKE_FRAME_OP( FT_FRAME_OP_BYTES, 0, 1 )\r\n\r\n  } FT_Frame_Op;\r\n\r\n\r\n  typedef struct  FT_Frame_Field_\r\n  {\r\n    FT_Byte    value;\r\n    FT_Byte    size;\r\n    FT_UShort  offset;\r\n\r\n  } FT_Frame_Field;\r\n\r\n\r\n  /* Construct an FT_Frame_Field out of a structure type and a field name. */\r\n  /* The structure type must be set in the FT_STRUCTURE macro before       */\r\n  /* calling the FT_FRAME_START() macro.                                   */\r\n  /*                                                                       */\r\n#define FT_FIELD_SIZE( f ) \\\r\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f )\r\n\r\n#define FT_FIELD_SIZE_DELTA( f ) \\\r\n          (FT_Byte)sizeof ( ((FT_STRUCTURE*)0)->f[0] )\r\n\r\n#define FT_FIELD_OFFSET( f ) \\\r\n          (FT_UShort)( offsetof( FT_STRUCTURE, f ) )\r\n\r\n#define FT_FRAME_FIELD( frame_op, field ) \\\r\n          {                               \\\r\n            frame_op,                     \\\r\n            FT_FIELD_SIZE( field ),       \\\r\n            FT_FIELD_OFFSET( field )      \\\r\n          }\r\n\r\n#define FT_MAKE_EMPTY_FIELD( frame_op )  { frame_op, 0, 0 }\r\n\r\n#define FT_FRAME_START( size )   { ft_frame_start, 0, size }\r\n#define FT_FRAME_END             { ft_frame_end, 0, 0 }\r\n\r\n#define FT_FRAME_LONG( f )       FT_FRAME_FIELD( ft_frame_long_be, f )\r\n#define FT_FRAME_ULONG( f )      FT_FRAME_FIELD( ft_frame_ulong_be, f )\r\n#define FT_FRAME_SHORT( f )      FT_FRAME_FIELD( ft_frame_short_be, f )\r\n#define FT_FRAME_USHORT( f )     FT_FRAME_FIELD( ft_frame_ushort_be, f )\r\n#define FT_FRAME_OFF3( f )       FT_FRAME_FIELD( ft_frame_off3_be, f )\r\n#define FT_FRAME_UOFF3( f )      FT_FRAME_FIELD( ft_frame_uoff3_be, f )\r\n#define FT_FRAME_BYTE( f )       FT_FRAME_FIELD( ft_frame_byte, f )\r\n#define FT_FRAME_CHAR( f )       FT_FRAME_FIELD( ft_frame_schar, f )\r\n\r\n#define FT_FRAME_LONG_LE( f )    FT_FRAME_FIELD( ft_frame_long_le, f )\r\n#define FT_FRAME_ULONG_LE( f )   FT_FRAME_FIELD( ft_frame_ulong_le, f )\r\n#define FT_FRAME_SHORT_LE( f )   FT_FRAME_FIELD( ft_frame_short_le, f )\r\n#define FT_FRAME_USHORT_LE( f )  FT_FRAME_FIELD( ft_frame_ushort_le, f )\r\n#define FT_FRAME_OFF3_LE( f )    FT_FRAME_FIELD( ft_frame_off3_le, f )\r\n#define FT_FRAME_UOFF3_LE( f )   FT_FRAME_FIELD( ft_frame_uoff3_le, f )\r\n\r\n#define FT_FRAME_SKIP_LONG       { ft_frame_long_be, 0, 0 }\r\n#define FT_FRAME_SKIP_SHORT      { ft_frame_short_be, 0, 0 }\r\n#define FT_FRAME_SKIP_BYTE       { ft_frame_byte, 0, 0 }\r\n\r\n#define FT_FRAME_BYTES( field, count ) \\\r\n          {                            \\\r\n            ft_frame_bytes,            \\\r\n            count,                     \\\r\n            FT_FIELD_OFFSET( field )   \\\r\n          }\r\n\r\n#define FT_FRAME_SKIP_BYTES( count )  { ft_frame_skip, count, 0 }\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* Integer extraction macros -- the `buffer' parameter must ALWAYS be of */\r\n  /* type `char*' or equivalent (1-byte elements).                         */\r\n  /*                                                                       */\r\n\r\n#define FT_BYTE_( p, i )  ( ((const FT_Byte*)(p))[(i)] )\r\n#define FT_INT8_( p, i )  ( ((const FT_Char*)(p))[(i)] )\r\n\r\n#define FT_INT16( x )   ( (FT_Int16)(x)  )\r\n#define FT_UINT16( x )  ( (FT_UInt16)(x) )\r\n#define FT_INT32( x )   ( (FT_Int32)(x)  )\r\n#define FT_UINT32( x )  ( (FT_UInt32)(x) )\r\n\r\n#define FT_BYTE_I16( p, i, s )  ( FT_INT16(  FT_BYTE_( p, i ) ) << (s) )\r\n#define FT_BYTE_U16( p, i, s )  ( FT_UINT16( FT_BYTE_( p, i ) ) << (s) )\r\n#define FT_BYTE_I32( p, i, s )  ( FT_INT32(  FT_BYTE_( p, i ) ) << (s) )\r\n#define FT_BYTE_U32( p, i, s )  ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )\r\n\r\n#define FT_INT8_I16( p, i, s )  ( FT_INT16(  FT_INT8_( p, i ) ) << (s) )\r\n#define FT_INT8_U16( p, i, s )  ( FT_UINT16( FT_INT8_( p, i ) ) << (s) )\r\n#define FT_INT8_I32( p, i, s )  ( FT_INT32(  FT_INT8_( p, i ) ) << (s) )\r\n#define FT_INT8_U32( p, i, s )  ( FT_UINT32( FT_INT8_( p, i ) ) << (s) )\r\n\r\n\r\n#define FT_PEEK_SHORT( p )  FT_INT16( FT_INT8_I16( p, 0, 8) | \\\r\n                                      FT_BYTE_I16( p, 1, 0) )\r\n\r\n#define FT_PEEK_USHORT( p )  FT_UINT16( FT_BYTE_U16( p, 0, 8 ) | \\\r\n                                        FT_BYTE_U16( p, 1, 0 ) )\r\n\r\n#define FT_PEEK_LONG( p )  FT_INT32( FT_INT8_I32( p, 0, 24 ) | \\\r\n                                     FT_BYTE_I32( p, 1, 16 ) | \\\r\n                                     FT_BYTE_I32( p, 2,  8 ) | \\\r\n                                     FT_BYTE_I32( p, 3,  0 ) )\r\n\r\n#define FT_PEEK_ULONG( p )  FT_UINT32( FT_BYTE_U32( p, 0, 24 ) | \\\r\n                                       FT_BYTE_U32( p, 1, 16 ) | \\\r\n                                       FT_BYTE_U32( p, 2,  8 ) | \\\r\n                                       FT_BYTE_U32( p, 3,  0 ) )\r\n\r\n#define FT_PEEK_OFF3( p )  FT_INT32( FT_INT8_I32( p, 0, 16 ) | \\\r\n                                     FT_BYTE_I32( p, 1,  8 ) | \\\r\n                                     FT_BYTE_I32( p, 2,  0 ) )\r\n\r\n#define FT_PEEK_UOFF3( p )  FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \\\r\n                                       FT_BYTE_U32( p, 1,  8 ) | \\\r\n                                       FT_BYTE_U32( p, 2,  0 ) )\r\n\r\n#define FT_PEEK_SHORT_LE( p )  FT_INT16( FT_INT8_I16( p, 1, 8 ) | \\\r\n                                         FT_BYTE_I16( p, 0, 0 ) )\r\n\r\n#define FT_PEEK_USHORT_LE( p )  FT_UINT16( FT_BYTE_U16( p, 1, 8 ) |  \\\r\n                                           FT_BYTE_U16( p, 0, 0 ) )\r\n\r\n#define FT_PEEK_LONG_LE( p )  FT_INT32( FT_INT8_I32( p, 3, 24 ) | \\\r\n                                        FT_BYTE_I32( p, 2, 16 ) | \\\r\n                                        FT_BYTE_I32( p, 1,  8 ) | \\\r\n                                        FT_BYTE_I32( p, 0,  0 ) )\r\n\r\n#define FT_PEEK_ULONG_LE( p )  FT_UINT32( FT_BYTE_U32( p, 3, 24 ) | \\\r\n                                          FT_BYTE_U32( p, 2, 16 ) | \\\r\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\r\n                                          FT_BYTE_U32( p, 0,  0 ) )\r\n\r\n#define FT_PEEK_OFF3_LE( p )  FT_INT32( FT_INT8_I32( p, 2, 16 ) | \\\r\n                                        FT_BYTE_I32( p, 1,  8 ) | \\\r\n                                        FT_BYTE_I32( p, 0,  0 ) )\r\n\r\n#define FT_PEEK_UOFF3_LE( p )  FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \\\r\n                                          FT_BYTE_U32( p, 1,  8 ) | \\\r\n                                          FT_BYTE_U32( p, 0,  0 ) )\r\n\r\n\r\n#define FT_NEXT_CHAR( buffer )       \\\r\n          ( (signed char)*buffer++ )\r\n\r\n#define FT_NEXT_BYTE( buffer )         \\\r\n          ( (unsigned char)*buffer++ )\r\n\r\n#define FT_NEXT_SHORT( buffer )                                   \\\r\n          ( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )\r\n\r\n#define FT_NEXT_USHORT( buffer )                                            \\\r\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )\r\n\r\n#define FT_NEXT_OFF3( buffer )                                  \\\r\n          ( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )\r\n\r\n#define FT_NEXT_UOFF3( buffer )                                           \\\r\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )\r\n\r\n#define FT_NEXT_LONG( buffer )                                  \\\r\n          ( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )\r\n\r\n#define FT_NEXT_ULONG( buffer )                                           \\\r\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )\r\n\r\n\r\n#define FT_NEXT_SHORT_LE( buffer )                                   \\\r\n          ( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )\r\n\r\n#define FT_NEXT_USHORT_LE( buffer )                                            \\\r\n          ( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )\r\n\r\n#define FT_NEXT_OFF3_LE( buffer )                                  \\\r\n          ( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )\r\n\r\n#define FT_NEXT_UOFF3_LE( buffer )                                           \\\r\n          ( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )\r\n\r\n#define FT_NEXT_LONG_LE( buffer )                                  \\\r\n          ( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )\r\n\r\n#define FT_NEXT_ULONG_LE( buffer )                                           \\\r\n          ( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* Each GET_xxxx() macro uses an implicit `stream' variable.             */\r\n  /*                                                                       */\r\n#if 0\r\n#define FT_GET_MACRO( type )    FT_NEXT_ ## type ( stream->cursor )\r\n\r\n#define FT_GET_CHAR()       FT_GET_MACRO( CHAR )\r\n#define FT_GET_BYTE()       FT_GET_MACRO( BYTE )\r\n#define FT_GET_SHORT()      FT_GET_MACRO( SHORT )\r\n#define FT_GET_USHORT()     FT_GET_MACRO( USHORT )\r\n#define FT_GET_OFF3()       FT_GET_MACRO( OFF3 )\r\n#define FT_GET_UOFF3()      FT_GET_MACRO( UOFF3 )\r\n#define FT_GET_LONG()       FT_GET_MACRO( LONG )\r\n#define FT_GET_ULONG()      FT_GET_MACRO( ULONG )\r\n#define FT_GET_TAG4()       FT_GET_MACRO( ULONG )\r\n\r\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( SHORT_LE )\r\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( USHORT_LE )\r\n#define FT_GET_LONG_LE()    FT_GET_MACRO( LONG_LE )\r\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( ULONG_LE )\r\n\r\n#else\r\n#define FT_GET_MACRO( func, type )        ( (type)func( stream ) )\r\n\r\n#define FT_GET_CHAR()       FT_GET_MACRO( FT_Stream_GetChar, FT_Char )\r\n#define FT_GET_BYTE()       FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )\r\n#define FT_GET_SHORT()      FT_GET_MACRO( FT_Stream_GetShort, FT_Short )\r\n#define FT_GET_USHORT()     FT_GET_MACRO( FT_Stream_GetShort, FT_UShort )\r\n#define FT_GET_OFF3()       FT_GET_MACRO( FT_Stream_GetOffset, FT_Long )\r\n#define FT_GET_UOFF3()      FT_GET_MACRO( FT_Stream_GetOffset, FT_ULong )\r\n#define FT_GET_LONG()       FT_GET_MACRO( FT_Stream_GetLong, FT_Long )\r\n#define FT_GET_ULONG()      FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )\r\n#define FT_GET_TAG4()       FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )\r\n\r\n#define FT_GET_SHORT_LE()   FT_GET_MACRO( FT_Stream_GetShortLE, FT_Short )\r\n#define FT_GET_USHORT_LE()  FT_GET_MACRO( FT_Stream_GetShortLE, FT_UShort )\r\n#define FT_GET_LONG_LE()    FT_GET_MACRO( FT_Stream_GetLongLE, FT_Long )\r\n#define FT_GET_ULONG_LE()   FT_GET_MACRO( FT_Stream_GetLongLE, FT_ULong )\r\n#endif\r\n\r\n#define FT_READ_MACRO( func, type, var )        \\\r\n          ( var = (type)func( stream, &error ), \\\r\n            error != FT_Err_Ok )\r\n\r\n#define FT_READ_BYTE( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )\r\n#define FT_READ_CHAR( var )       FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )\r\n#define FT_READ_SHORT( var )      FT_READ_MACRO( FT_Stream_ReadShort, FT_Short, var )\r\n#define FT_READ_USHORT( var )     FT_READ_MACRO( FT_Stream_ReadShort, FT_UShort, var )\r\n#define FT_READ_OFF3( var )       FT_READ_MACRO( FT_Stream_ReadOffset, FT_Long, var )\r\n#define FT_READ_UOFF3( var )      FT_READ_MACRO( FT_Stream_ReadOffset, FT_ULong, var )\r\n#define FT_READ_LONG( var )       FT_READ_MACRO( FT_Stream_ReadLong, FT_Long, var )\r\n#define FT_READ_ULONG( var )      FT_READ_MACRO( FT_Stream_ReadLong, FT_ULong, var )\r\n\r\n#define FT_READ_SHORT_LE( var )   FT_READ_MACRO( FT_Stream_ReadShortLE, FT_Short, var )\r\n#define FT_READ_USHORT_LE( var )  FT_READ_MACRO( FT_Stream_ReadShortLE, FT_UShort, var )\r\n#define FT_READ_LONG_LE( var )    FT_READ_MACRO( FT_Stream_ReadLongLE, FT_Long, var )\r\n#define FT_READ_ULONG_LE( var )   FT_READ_MACRO( FT_Stream_ReadLongLE, FT_ULong, var )\r\n\r\n\r\n#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM\r\n\r\n  /* initialize a stream for reading a regular system stream */\r\n  FT_BASE( FT_Error )\r\n  FT_Stream_Open( FT_Stream    stream,\r\n                  const char*  filepathname );\r\n\r\n#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */\r\n\r\n\r\n  /* create a new (input) stream from an FT_Open_Args structure */\r\n  FT_BASE( FT_Error )\r\n  FT_Stream_New( FT_Library           library,\r\n                 const FT_Open_Args*  args,\r\n                 FT_Stream           *astream );\r\n\r\n  /* free a stream */\r\n  FT_BASE( void )\r\n  FT_Stream_Free( FT_Stream  stream,\r\n                  FT_Int     external );\r\n\r\n  /* initialize a stream for reading in-memory data */\r\n  FT_BASE( void )\r\n  FT_Stream_OpenMemory( FT_Stream       stream,\r\n                        const FT_Byte*  base,\r\n                        FT_ULong        size );\r\n\r\n  /* close a stream (does not destroy the stream structure) */\r\n  FT_BASE( void )\r\n  FT_Stream_Close( FT_Stream  stream );\r\n\r\n\r\n  /* seek within a stream. position is relative to start of stream */\r\n  FT_BASE( FT_Error )\r\n  FT_Stream_Seek( FT_Stream  stream,\r\n                  FT_ULong   pos );\r\n\r\n  /* skip bytes in a stream */\r\n  FT_BASE( FT_Error )\r\n  FT_Stream_Skip( FT_Stream  stream,\r\n                  FT_Long    distance );\r\n\r\n  /* return current stream position */\r\n  FT_BASE( FT_Long )\r\n  FT_Stream_Pos( FT_Stream  stream );\r\n\r\n  /* read bytes from a stream into a user-allocated buffer, returns an */\r\n  /* error if not all bytes could be read.                             */\r\n  FT_BASE( FT_Error )\r\n  FT_Stream_Read( FT_Stream  stream,\r\n                  FT_Byte*   buffer,\r\n                  FT_ULong   count );\r\n\r\n  /* read bytes from a stream at a given position */\r\n  FT_BASE( FT_Error )\r\n  FT_Stream_ReadAt( FT_Stream  stream,\r\n                    FT_ULong   pos,\r\n                    FT_Byte*   buffer,\r\n                    FT_ULong   count );\r\n\r\n  /* try to read bytes at the end of a stream; return number of bytes */\r\n  /* really available                                                 */\r\n  FT_BASE( FT_ULong )\r\n  FT_Stream_TryRead( FT_Stream  stream,\r\n                     FT_Byte*   buffer,\r\n                     FT_ULong   count );\r\n\r\n  /* Enter a frame of `count' consecutive bytes in a stream.  Returns an */\r\n  /* error if the frame could not be read/accessed.  The caller can use  */\r\n  /* the FT_Stream_Get_XXX functions to retrieve frame data without      */\r\n  /* error checks.                                                       */\r\n  /*                                                                     */\r\n  /* You must _always_ call FT_Stream_ExitFrame() once you have entered  */\r\n  /* a stream frame!                                                     */\r\n  /*                                                                     */\r\n  FT_BASE( FT_Error )\r\n  FT_Stream_EnterFrame( FT_Stream  stream,\r\n                        FT_ULong   count );\r\n\r\n  /* exit a stream frame */\r\n  FT_BASE( void )\r\n  FT_Stream_ExitFrame( FT_Stream  stream );\r\n\r\n  /* Extract a stream frame.  If the stream is disk-based, a heap block */\r\n  /* is allocated and the frame bytes are read into it.  If the stream  */\r\n  /* is memory-based, this function simply set a pointer to the data.   */\r\n  /*                                                                    */\r\n  /* Useful to optimize access to memory-based streams transparently.   */\r\n  /*                                                                    */\r\n  /* All extracted frames must be `freed' with a call to the function   */\r\n  /* FT_Stream_ReleaseFrame().                                          */\r\n  /*                                                                    */\r\n  FT_BASE( FT_Error )\r\n  FT_Stream_ExtractFrame( FT_Stream  stream,\r\n                          FT_ULong   count,\r\n                          FT_Byte**  pbytes );\r\n\r\n  /* release an extract frame (see FT_Stream_ExtractFrame) */\r\n  FT_BASE( void )\r\n  FT_Stream_ReleaseFrame( FT_Stream  stream,\r\n                          FT_Byte**  pbytes );\r\n\r\n  /* read a byte from an entered frame */\r\n  FT_BASE( FT_Char )\r\n  FT_Stream_GetChar( FT_Stream  stream );\r\n\r\n  /* read a 16-bit big-endian integer from an entered frame */\r\n  FT_BASE( FT_Short )\r\n  FT_Stream_GetShort( FT_Stream  stream );\r\n\r\n  /* read a 24-bit big-endian integer from an entered frame */\r\n  FT_BASE( FT_Long )\r\n  FT_Stream_GetOffset( FT_Stream  stream );\r\n\r\n  /* read a 32-bit big-endian integer from an entered frame */\r\n  FT_BASE( FT_Long )\r\n  FT_Stream_GetLong( FT_Stream  stream );\r\n\r\n  /* read a 16-bit little-endian integer from an entered frame */\r\n  FT_BASE( FT_Short )\r\n  FT_Stream_GetShortLE( FT_Stream  stream );\r\n\r\n  /* read a 32-bit little-endian integer from an entered frame */\r\n  FT_BASE( FT_Long )\r\n  FT_Stream_GetLongLE( FT_Stream  stream );\r\n\r\n\r\n  /* read a byte from a stream */\r\n  FT_BASE( FT_Char )\r\n  FT_Stream_ReadChar( FT_Stream  stream,\r\n                      FT_Error*  error );\r\n\r\n  /* read a 16-bit big-endian integer from a stream */\r\n  FT_BASE( FT_Short )\r\n  FT_Stream_ReadShort( FT_Stream  stream,\r\n                       FT_Error*  error );\r\n\r\n  /* read a 24-bit big-endian integer from a stream */\r\n  FT_BASE( FT_Long )\r\n  FT_Stream_ReadOffset( FT_Stream  stream,\r\n                        FT_Error*  error );\r\n\r\n  /* read a 32-bit big-endian integer from a stream */\r\n  FT_BASE( FT_Long )\r\n  FT_Stream_ReadLong( FT_Stream  stream,\r\n                      FT_Error*  error );\r\n\r\n  /* read a 16-bit little-endian integer from a stream */\r\n  FT_BASE( FT_Short )\r\n  FT_Stream_ReadShortLE( FT_Stream  stream,\r\n                         FT_Error*  error );\r\n\r\n  /* read a 32-bit little-endian integer from a stream */\r\n  FT_BASE( FT_Long )\r\n  FT_Stream_ReadLongLE( FT_Stream  stream,\r\n                        FT_Error*  error );\r\n\r\n  /* Read a structure from a stream.  The structure must be described */\r\n  /* by an array of FT_Frame_Field records.                           */\r\n  FT_BASE( FT_Error )\r\n  FT_Stream_ReadFields( FT_Stream              stream,\r\n                        const FT_Frame_Field*  fields,\r\n                        void*                  structure );\r\n\r\n\r\n#define FT_STREAM_POS()           \\\r\n          FT_Stream_Pos( stream )\r\n\r\n#define FT_STREAM_SEEK( position )                           \\\r\n          FT_SET_ERROR( FT_Stream_Seek( stream, position ) )\r\n\r\n#define FT_STREAM_SKIP( distance )                           \\\r\n          FT_SET_ERROR( FT_Stream_Skip( stream, distance ) )\r\n\r\n#define FT_STREAM_READ( buffer, count )                   \\\r\n          FT_SET_ERROR( FT_Stream_Read( stream,           \\\r\n                                        (FT_Byte*)buffer, \\\r\n                                        count ) )\r\n\r\n#define FT_STREAM_READ_AT( position, buffer, count )         \\\r\n          FT_SET_ERROR( FT_Stream_ReadAt( stream,            \\\r\n                                           position,         \\\r\n                                           (FT_Byte*)buffer, \\\r\n                                           count ) )\r\n\r\n#define FT_STREAM_READ_FIELDS( fields, object )                          \\\r\n          FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )\r\n\r\n\r\n#define FT_FRAME_ENTER( size )                                       \\\r\n          FT_SET_ERROR(                                              \\\r\n            FT_DEBUG_INNER( FT_Stream_EnterFrame( stream, size ) ) )\r\n\r\n#define FT_FRAME_EXIT()                 \\\r\n          FT_DEBUG_INNER( FT_Stream_ExitFrame( stream ) )\r\n\r\n#define FT_FRAME_EXTRACT( size, bytes )                                       \\\r\n          FT_SET_ERROR(                                                       \\\r\n            FT_DEBUG_INNER( FT_Stream_ExtractFrame( stream, size,             \\\r\n                                                    (FT_Byte**)&(bytes) ) ) )\r\n\r\n#define FT_FRAME_RELEASE( bytes )                                         \\\r\n          FT_DEBUG_INNER( FT_Stream_ReleaseFrame( stream,                 \\\r\n                                                  (FT_Byte**)&(bytes) ) )\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTSTREAM_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/fttrace.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  fttrace.h                                                              */\r\n/*                                                                         */\r\n/*    Tracing handling (specification only).                               */\r\n/*                                                                         */\r\n/*  Copyright 2002, 2004, 2005, 2006 by                                    */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n  /* definitions of trace levels for FreeType 2 */\r\n\r\n  /* the first level must always be `trace_any' */\r\nFT_TRACE_DEF( any )\r\n\r\n  /* base components */\r\nFT_TRACE_DEF( calc )      /* calculations            (ftcalc.c)   */\r\nFT_TRACE_DEF( memory )    /* memory manager          (ftobjs.c)   */\r\nFT_TRACE_DEF( stream )    /* stream manager          (ftstream.c) */\r\nFT_TRACE_DEF( io )        /* i/o interface           (ftsystem.c) */\r\nFT_TRACE_DEF( list )      /* list management         (ftlist.c)   */\r\nFT_TRACE_DEF( init )      /* initialization          (ftinit.c)   */\r\nFT_TRACE_DEF( objs )      /* base objects            (ftobjs.c)   */\r\nFT_TRACE_DEF( outline )   /* outline management      (ftoutln.c)  */\r\nFT_TRACE_DEF( glyph )     /* glyph management        (ftglyph.c)  */\r\n\r\nFT_TRACE_DEF( raster )    /* monochrome rasterizer   (ftraster.c) */\r\nFT_TRACE_DEF( smooth )    /* anti-aliasing raster    (ftgrays.c)  */\r\nFT_TRACE_DEF( mm )        /* MM interface            (ftmm.c)     */\r\nFT_TRACE_DEF( raccess )   /* resource fork accessor  (ftrfork.c)  */\r\n\r\n  /* Cache sub-system */\r\nFT_TRACE_DEF( cache )     /* cache sub-system        (ftcache.c, etc.) */\r\n\r\n  /* SFNT driver components */\r\nFT_TRACE_DEF( sfobjs )    /* SFNT object handler     (sfobjs.c)   */\r\nFT_TRACE_DEF( ttcmap )    /* charmap handler         (ttcmap.c)   */\r\nFT_TRACE_DEF( ttkern )    /* kerning handler         (ttkern.c)   */\r\nFT_TRACE_DEF( ttload )    /* basic TrueType tables   (ttload.c)   */\r\nFT_TRACE_DEF( ttmtx )     /* metrics-related tables  (ttmtx.c)    */\r\nFT_TRACE_DEF( ttpost )    /* PS table processing     (ttpost.c)   */\r\nFT_TRACE_DEF( ttsbit )    /* TrueType sbit handling  (ttsbit.c)   */\r\n\r\n  /* TrueType driver components */\r\nFT_TRACE_DEF( ttdriver )  /* TT font driver          (ttdriver.c) */\r\nFT_TRACE_DEF( ttgload )   /* TT glyph loader         (ttgload.c)  */\r\nFT_TRACE_DEF( ttinterp )  /* bytecode interpreter    (ttinterp.c) */\r\nFT_TRACE_DEF( ttobjs )    /* TT objects manager      (ttobjs.c)   */\r\nFT_TRACE_DEF( ttpload )   /* TT data/program loader  (ttpload.c)  */\r\nFT_TRACE_DEF( ttgxvar )   /* TrueType GX var handler (ttgxvar.c)  */\r\n\r\n  /* Type 1 driver components */\r\nFT_TRACE_DEF( t1driver )\r\nFT_TRACE_DEF( t1gload )\r\nFT_TRACE_DEF( t1hint )\r\nFT_TRACE_DEF( t1load )\r\nFT_TRACE_DEF( t1objs )\r\nFT_TRACE_DEF( t1parse )\r\n\r\n  /* PostScript helper module `psaux' */\r\nFT_TRACE_DEF( t1decode )\r\nFT_TRACE_DEF( psobjs )\r\n\r\n  /* PostScript hinting module `pshinter' */\r\nFT_TRACE_DEF( pshrec )\r\nFT_TRACE_DEF( pshalgo1 )\r\nFT_TRACE_DEF( pshalgo2 )\r\n\r\n  /* Type 2 driver components */\r\nFT_TRACE_DEF( cffdriver )\r\nFT_TRACE_DEF( cffgload )\r\nFT_TRACE_DEF( cffload )\r\nFT_TRACE_DEF( cffobjs )\r\nFT_TRACE_DEF( cffparse )\r\n\r\n  /* Type 42 driver component */\r\nFT_TRACE_DEF( t42 )\r\n\r\n  /* CID driver components */\r\nFT_TRACE_DEF( cidafm )\r\nFT_TRACE_DEF( ciddriver )\r\nFT_TRACE_DEF( cidgload )\r\nFT_TRACE_DEF( cidload )\r\nFT_TRACE_DEF( cidobjs )\r\nFT_TRACE_DEF( cidparse )\r\n\r\n  /* Windows font component */\r\nFT_TRACE_DEF( winfnt )\r\n\r\n  /* PCF font components */\r\nFT_TRACE_DEF( pcfdriver )\r\nFT_TRACE_DEF( pcfread )\r\n\r\n  /* BDF font components */\r\nFT_TRACE_DEF( bdfdriver )\r\nFT_TRACE_DEF( bdflib )\r\n\r\n  /* PFR font component */\r\nFT_TRACE_DEF( pfr )\r\n\r\n  /* OpenType validation components */\r\nFT_TRACE_DEF( otvmodule )\r\nFT_TRACE_DEF( otvcommon )\r\nFT_TRACE_DEF( otvbase )\r\nFT_TRACE_DEF( otvgdef )\r\nFT_TRACE_DEF( otvgpos )\r\nFT_TRACE_DEF( otvgsub )\r\nFT_TRACE_DEF( otvjstf )\r\n\r\n  /* TrueTypeGX/AAT validation components */\r\nFT_TRACE_DEF( gxvmodule )\r\nFT_TRACE_DEF( gxvcommon )\r\nFT_TRACE_DEF( gxvfeat )\r\nFT_TRACE_DEF( gxvmort )\r\nFT_TRACE_DEF( gxvmorx )\r\nFT_TRACE_DEF( gxvbsln )\r\nFT_TRACE_DEF( gxvjust )\r\nFT_TRACE_DEF( gxvkern )\r\nFT_TRACE_DEF( gxvopbd )\r\nFT_TRACE_DEF( gxvtrak )\r\nFT_TRACE_DEF( gxvprop )\r\nFT_TRACE_DEF( gxvlcar )\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/ftvalid.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ftvalid.h                                                              */\r\n/*                                                                         */\r\n/*    FreeType validation support (specification).                         */\r\n/*                                                                         */\r\n/*  Copyright 2004 by                                                      */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __FTVALID_H__\r\n#define __FTVALID_H__\r\n\r\n#include <ft2build.h>\r\n#include FT_CONFIG_STANDARD_LIBRARY_H   /* for ft_setjmp and ft_longjmp */\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /****                    V A L I D A T I O N                          ****/\r\n  /****                                                                 ****/\r\n  /****                                                                 ****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  /* handle to a validation object */\r\n  typedef struct FT_ValidatorRec_ volatile*  FT_Validator;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* There are three distinct validation levels defined here:              */\r\n  /*                                                                       */\r\n  /* FT_VALIDATE_DEFAULT ::                                                */\r\n  /*   A table that passes this validation level can be used reliably by   */\r\n  /*   FreeType.  It generally means that all offsets have been checked to */\r\n  /*   prevent out-of-bound reads, that array counts are correct, etc.     */\r\n  /*                                                                       */\r\n  /* FT_VALIDATE_TIGHT ::                                                  */\r\n  /*   A table that passes this validation level can be used reliably and  */\r\n  /*   doesn't contain invalid data.  For example, a charmap table that    */\r\n  /*   returns invalid glyph indices will not pass, even though it can     */\r\n  /*   be used with FreeType in default mode (the library will simply      */\r\n  /*   return an error later when trying to load the glyph).               */\r\n  /*                                                                       */\r\n  /*   It also checks that fields which must be a multiple of 2, 4, or 8,  */\r\n  /*   don't have incorrect values, etc.                                   */\r\n  /*                                                                       */\r\n  /* FT_VALIDATE_PARANOID ::                                               */\r\n  /*   Only for font debugging.  Checks that a table follows the           */\r\n  /*   specification by 100%.  Very few fonts will be able to pass this    */\r\n  /*   level anyway but it can be useful for certain tools like font       */\r\n  /*   editors/converters.                                                 */\r\n  /*                                                                       */\r\n  typedef enum  FT_ValidationLevel_\r\n  {\r\n    FT_VALIDATE_DEFAULT = 0,\r\n    FT_VALIDATE_TIGHT,\r\n    FT_VALIDATE_PARANOID\r\n\r\n  } FT_ValidationLevel;\r\n\r\n\r\n  /* validator structure */\r\n  typedef struct  FT_ValidatorRec_\r\n  {\r\n    const FT_Byte*      base;        /* address of table in memory       */\r\n    const FT_Byte*      limit;       /* `base' + sizeof(table) in memory */\r\n    FT_ValidationLevel  level;       /* validation level                 */\r\n    FT_Error            error;       /* error returned. 0 means success  */\r\n\r\n    ft_jmp_buf          jump_buffer; /* used for exception handling      */\r\n\r\n  } FT_ValidatorRec;\r\n\r\n\r\n#define FT_VALIDATOR( x )  ((FT_Validator)( x ))\r\n\r\n\r\n  FT_BASE( void )\r\n  ft_validator_init( FT_Validator        valid,\r\n                     const FT_Byte*      base,\r\n                     const FT_Byte*      limit,\r\n                     FT_ValidationLevel  level );\r\n\r\n  /* Do not use this. It's broken and will cause your validator to crash */\r\n  /* if you run it on an invalid font.                                   */\r\n  FT_BASE( FT_Int )\r\n  ft_validator_run( FT_Validator  valid );\r\n\r\n  /* Sets the error field in a validator, then calls `longjmp' to return */\r\n  /* to high-level caller.  Using `setjmp/longjmp' avoids many stupid    */\r\n  /* error checks within the validation routines.                        */\r\n  /*                                                                     */\r\n  FT_BASE( void )\r\n  ft_validator_error( FT_Validator  valid,\r\n                      FT_Error      error );\r\n\r\n\r\n  /* Calls ft_validate_error.  Assumes that the `valid' local variable */\r\n  /* holds a pointer to the current validator object.                  */\r\n  /*                                                                   */\r\n  /* Use preprocessor prescan to pass FT_ERR_PREFIX.                   */\r\n  /*                                                                   */\r\n#define FT_INVALID( _prefix, _error )  FT_INVALID_( _prefix, _error )\r\n#define FT_INVALID_( _prefix, _error ) \\\r\n          ft_validator_error( valid, _prefix ## _error )\r\n\r\n  /* called when a broken table is detected */\r\n#define FT_INVALID_TOO_SHORT \\\r\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\r\n\r\n  /* called when an invalid offset is detected */\r\n#define FT_INVALID_OFFSET \\\r\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Offset )\r\n\r\n  /* called when an invalid format/value is detected */\r\n#define FT_INVALID_FORMAT \\\r\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\r\n\r\n  /* called when an invalid glyph index is detected */\r\n#define FT_INVALID_GLYPH_ID \\\r\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Glyph_Index )\r\n\r\n  /* called when an invalid field value is detected */\r\n#define FT_INVALID_DATA \\\r\n          FT_INVALID( FT_ERR_PREFIX, Invalid_Table )\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __FTVALID_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/internal.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  internal.h                                                             */\r\n/*                                                                         */\r\n/*    Internal header files (specification only).                          */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2003, 2004 by                               */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* This file is automatically included by `ft2build.h'.                  */\r\n  /* Do not include it manually!                                           */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n\r\n#define FT_INTERNAL_OBJECTS_H             <freetype/internal/ftobjs.h>\r\n#define FT_INTERNAL_STREAM_H              <freetype/internal/ftstream.h>\r\n#define FT_INTERNAL_MEMORY_H              <freetype/internal/ftmemory.h>\r\n#define FT_INTERNAL_DEBUG_H               <freetype/internal/ftdebug.h>\r\n#define FT_INTERNAL_CALC_H                <freetype/internal/ftcalc.h>\r\n#define FT_INTERNAL_DRIVER_H              <freetype/internal/ftdriver.h>\r\n#define FT_INTERNAL_TRACE_H               <freetype/internal/fttrace.h>\r\n#define FT_INTERNAL_GLYPH_LOADER_H        <freetype/internal/ftgloadr.h>\r\n#define FT_INTERNAL_SFNT_H                <freetype/internal/sfnt.h>\r\n#define FT_INTERNAL_SERVICE_H             <freetype/internal/ftserv.h>\r\n#define FT_INTERNAL_RFORK_H               <freetype/internal/ftrfork.h>\r\n#define FT_INTERNAL_VALIDATE_H            <freetype/internal/ftvalid.h>\r\n\r\n#define FT_INTERNAL_TRUETYPE_TYPES_H      <freetype/internal/tttypes.h>\r\n#define FT_INTERNAL_TYPE1_TYPES_H         <freetype/internal/t1types.h>\r\n\r\n#define FT_INTERNAL_POSTSCRIPT_AUX_H      <freetype/internal/psaux.h>\r\n#define FT_INTERNAL_POSTSCRIPT_HINTS_H    <freetype/internal/pshints.h>\r\n#define FT_INTERNAL_POSTSCRIPT_GLOBALS_H  <freetype/internal/psglobal.h>\r\n\r\n#define FT_INTERNAL_AUTOHINT_H            <freetype/internal/autohint.h>\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/pcftypes.h",
    "content": "/*  pcftypes.h\r\n\r\n  FreeType font driver for pcf fonts\r\n\r\n  Copyright (C) 2000, 2001, 2002 by\r\n  Francesco Zappa Nardelli\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n*/\r\n\r\n\r\n#ifndef __PCFTYPES_H__\r\n#define __PCFTYPES_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_FREETYPE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  typedef struct  PCF_Public_FaceRec_\r\n  {\r\n    FT_FaceRec    root;\r\n    FT_StreamRec  gzip_stream;\r\n    FT_Stream     gzip_source;\r\n\r\n    char*         charset_encoding;\r\n    char*         charset_registry;\r\n\r\n  } PCF_Public_FaceRec, *PCF_Public_Face;\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif  /* __PCFTYPES_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/psaux.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  psaux.h                                                                */\r\n/*                                                                         */\r\n/*    Auxiliary functions and data structures related to PostScript fonts  */\r\n/*    (specification).                                                     */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2006 by                         */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __PSAUX_H__\r\n#define __PSAUX_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_INTERNAL_OBJECTS_H\r\n#include FT_INTERNAL_TYPE1_TYPES_H\r\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                             T1_TABLE                          *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  typedef struct PS_TableRec_*              PS_Table;\r\n  typedef const struct PS_Table_FuncsRec_*  PS_Table_Funcs;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    PS_Table_FuncsRec                                                  */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A set of function pointers to manage PS_Table objects.             */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    table_init    :: Used to initialize a table.                       */\r\n  /*                                                                       */\r\n  /*    table_done    :: Finalizes resp. destroy a given table.            */\r\n  /*                                                                       */\r\n  /*    table_add     :: Adds a new object to a table.                     */\r\n  /*                                                                       */\r\n  /*    table_release :: Releases table data, then finalizes it.           */\r\n  /*                                                                       */\r\n  typedef struct  PS_Table_FuncsRec_\r\n  {\r\n    FT_Error\r\n    (*init)( PS_Table   table,\r\n             FT_Int     count,\r\n             FT_Memory  memory );\r\n\r\n    void\r\n    (*done)( PS_Table  table );\r\n\r\n    FT_Error\r\n    (*add)( PS_Table    table,\r\n            FT_Int      idx,\r\n            void*       object,\r\n            FT_PtrDist  length );\r\n\r\n    void\r\n    (*release)( PS_Table  table );\r\n\r\n  } PS_Table_FuncsRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    PS_TableRec                                                        */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A PS_Table is a simple object used to store an array of objects in */\r\n  /*    a single memory block.                                             */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    block     :: The address in memory of the growheap's block.  This  */\r\n  /*                 can change between two object adds, due to            */\r\n  /*                 reallocation.                                         */\r\n  /*                                                                       */\r\n  /*    cursor    :: The current top of the grow heap within its block.    */\r\n  /*                                                                       */\r\n  /*    capacity  :: The current size of the heap block.  Increments by    */\r\n  /*                 1kByte chunks.                                        */\r\n  /*                                                                       */\r\n  /*    max_elems :: The maximum number of elements in table.              */\r\n  /*                                                                       */\r\n  /*    num_elems :: The current number of elements in table.              */\r\n  /*                                                                       */\r\n  /*    elements  :: A table of element addresses within the block.        */\r\n  /*                                                                       */\r\n  /*    lengths   :: A table of element sizes within the block.            */\r\n  /*                                                                       */\r\n  /*    memory    :: The object used for memory operations                 */\r\n  /*                 (alloc/realloc).                                      */\r\n  /*                                                                       */\r\n  /*    funcs     :: A table of method pointers for this object.           */\r\n  /*                                                                       */\r\n  typedef struct  PS_TableRec_\r\n  {\r\n    FT_Byte*           block;          /* current memory block           */\r\n    FT_Offset          cursor;         /* current cursor in memory block */\r\n    FT_Offset          capacity;       /* current size of memory block   */\r\n    FT_Long            init;\r\n\r\n    FT_Int             max_elems;\r\n    FT_Int             num_elems;\r\n    FT_Byte**          elements;       /* addresses of table elements */\r\n    FT_PtrDist*        lengths;        /* lengths of table elements   */\r\n\r\n    FT_Memory          memory;\r\n    PS_Table_FuncsRec  funcs;\r\n\r\n  } PS_TableRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                       T1 FIELDS & TOKENS                      *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  typedef struct PS_ParserRec_*  PS_Parser;\r\n\r\n  typedef struct T1_TokenRec_*   T1_Token;\r\n\r\n  typedef struct T1_FieldRec_*   T1_Field;\r\n\r\n\r\n  /* simple enumeration type used to identify token types */\r\n  typedef enum  T1_TokenType_\r\n  {\r\n    T1_TOKEN_TYPE_NONE = 0,\r\n    T1_TOKEN_TYPE_ANY,\r\n    T1_TOKEN_TYPE_STRING,\r\n    T1_TOKEN_TYPE_ARRAY,\r\n    T1_TOKEN_TYPE_KEY, /* aka `name' */\r\n\r\n    /* do not remove */\r\n    T1_TOKEN_TYPE_MAX\r\n\r\n  } T1_TokenType;\r\n\r\n\r\n  /* a simple structure used to identify tokens */\r\n  typedef struct  T1_TokenRec_\r\n  {\r\n    FT_Byte*      start;   /* first character of token in input stream */\r\n    FT_Byte*      limit;   /* first character after the token          */\r\n    T1_TokenType  type;    /* type of token                            */\r\n\r\n  } T1_TokenRec;\r\n\r\n\r\n  /* enumeration type used to identify object fields */\r\n  typedef enum  T1_FieldType_\r\n  {\r\n    T1_FIELD_TYPE_NONE = 0,\r\n    T1_FIELD_TYPE_BOOL,\r\n    T1_FIELD_TYPE_INTEGER,\r\n    T1_FIELD_TYPE_FIXED,\r\n    T1_FIELD_TYPE_FIXED_1000,\r\n    T1_FIELD_TYPE_STRING,\r\n    T1_FIELD_TYPE_KEY,\r\n    T1_FIELD_TYPE_BBOX,\r\n    T1_FIELD_TYPE_INTEGER_ARRAY,\r\n    T1_FIELD_TYPE_FIXED_ARRAY,\r\n    T1_FIELD_TYPE_CALLBACK,\r\n\r\n    /* do not remove */\r\n    T1_FIELD_TYPE_MAX\r\n\r\n  } T1_FieldType;\r\n\r\n\r\n  typedef enum  T1_FieldLocation_\r\n  {\r\n    T1_FIELD_LOCATION_CID_INFO,\r\n    T1_FIELD_LOCATION_FONT_DICT,\r\n    T1_FIELD_LOCATION_FONT_INFO,\r\n    T1_FIELD_LOCATION_PRIVATE,\r\n    T1_FIELD_LOCATION_BBOX,\r\n    T1_FIELD_LOCATION_LOADER,\r\n    T1_FIELD_LOCATION_FACE,\r\n    T1_FIELD_LOCATION_BLEND,\r\n\r\n    /* do not remove */\r\n    T1_FIELD_LOCATION_MAX\r\n\r\n  } T1_FieldLocation;\r\n\r\n\r\n  typedef void\r\n  (*T1_Field_ParseFunc)( FT_Face     face,\r\n                         FT_Pointer  parser );\r\n\r\n\r\n  /* structure type used to model object fields */\r\n  typedef struct  T1_FieldRec_\r\n  {\r\n    const char*         ident;        /* field identifier               */\r\n    T1_FieldLocation    location;\r\n    T1_FieldType        type;         /* type of field                  */\r\n    T1_Field_ParseFunc  reader;\r\n    FT_UInt             offset;       /* offset of field in object      */\r\n    FT_Byte             size;         /* size of field in bytes         */\r\n    FT_UInt             array_max;    /* maximal number of elements for */\r\n                                      /* array                          */\r\n    FT_UInt             count_offset; /* offset of element count for    */\r\n                                      /* arrays                         */\r\n    FT_UInt             dict;         /* where we expect it             */\r\n  } T1_FieldRec;\r\n\r\n#define T1_FIELD_DICT_FONTDICT ( 1 << 0 ) /* also FontInfo and FDArray */\r\n#define T1_FIELD_DICT_PRIVATE  ( 1 << 1 )\r\n\r\n\r\n\r\n#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \\\r\n          {                                                 \\\r\n            _ident, T1CODE, _type,                          \\\r\n            0,                                              \\\r\n            FT_FIELD_OFFSET( _fname ),                      \\\r\n            FT_FIELD_SIZE( _fname ),                        \\\r\n            0, 0,                                           \\\r\n            _dict                                           \\\r\n          },\r\n\r\n#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \\\r\n          {                                             \\\r\n            _ident, T1CODE, T1_FIELD_TYPE_CALLBACK,     \\\r\n            (T1_Field_ParseFunc)_reader,                \\\r\n            0, 0,                                       \\\r\n            0, 0,                                       \\\r\n            _dict                                       \\\r\n          },\r\n\r\n#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \\\r\n          {                                                      \\\r\n            _ident, T1CODE, _type,                               \\\r\n            0,                                                   \\\r\n            FT_FIELD_OFFSET( _fname ),                           \\\r\n            FT_FIELD_SIZE_DELTA( _fname ),                       \\\r\n            _max,                                                \\\r\n            FT_FIELD_OFFSET( num_ ## _fname ),                   \\\r\n            _dict                                                \\\r\n          },\r\n\r\n#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \\\r\n          {                                                       \\\r\n            _ident, T1CODE, _type,                                \\\r\n            0,                                                    \\\r\n            FT_FIELD_OFFSET( _fname ),                            \\\r\n            FT_FIELD_SIZE_DELTA( _fname ),                        \\\r\n            _max, 0,                                              \\\r\n            _dict                                                 \\\r\n          },\r\n\r\n\r\n#define T1_FIELD_BOOL( _ident, _fname, _dict )                             \\\r\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BOOL, _fname, _dict )\r\n\r\n#define T1_FIELD_NUM( _ident, _fname, _dict )                                 \\\r\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER, _fname, _dict )\r\n\r\n#define T1_FIELD_FIXED( _ident, _fname, _dict )                             \\\r\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED, _fname, _dict )\r\n\r\n#define T1_FIELD_FIXED_1000( _ident, _fname, _dict )                     \\\r\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_1000, _fname, \\\r\n                               _dict )\r\n\r\n#define T1_FIELD_STRING( _ident, _fname, _dict )                             \\\r\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_STRING, _fname, _dict )\r\n\r\n#define T1_FIELD_KEY( _ident, _fname, _dict )                             \\\r\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_KEY, _fname, _dict )\r\n\r\n#define T1_FIELD_BBOX( _ident, _fname, _dict )                             \\\r\n          T1_NEW_SIMPLE_FIELD( _ident, T1_FIELD_TYPE_BBOX, _fname, _dict )\r\n\r\n\r\n#define T1_FIELD_NUM_TABLE( _ident, _fname, _fmax, _dict )         \\\r\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\r\n                              _fname, _fmax, _dict )\r\n\r\n#define T1_FIELD_FIXED_TABLE( _ident, _fname, _fmax, _dict )     \\\r\n          T1_NEW_TABLE_FIELD( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\r\n                              _fname, _fmax, _dict )\r\n\r\n#define T1_FIELD_NUM_TABLE2( _ident, _fname, _fmax, _dict )         \\\r\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_INTEGER_ARRAY, \\\r\n                               _fname, _fmax, _dict )\r\n\r\n#define T1_FIELD_FIXED_TABLE2( _ident, _fname, _fmax, _dict )     \\\r\n          T1_NEW_TABLE_FIELD2( _ident, T1_FIELD_TYPE_FIXED_ARRAY, \\\r\n                               _fname, _fmax, _dict )\r\n\r\n#define T1_FIELD_CALLBACK( _ident, _name, _dict )       \\\r\n          T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                            T1 PARSER                          *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  typedef const struct PS_Parser_FuncsRec_*  PS_Parser_Funcs;\r\n\r\n  typedef struct  PS_Parser_FuncsRec_\r\n  {\r\n    void\r\n    (*init)( PS_Parser  parser,\r\n             FT_Byte*   base,\r\n             FT_Byte*   limit,\r\n             FT_Memory  memory );\r\n\r\n    void\r\n    (*done)( PS_Parser  parser );\r\n\r\n    void\r\n    (*skip_spaces)( PS_Parser  parser );\r\n    void\r\n    (*skip_PS_token)( PS_Parser  parser );\r\n\r\n    FT_Long\r\n    (*to_int)( PS_Parser  parser );\r\n    FT_Fixed\r\n    (*to_fixed)( PS_Parser  parser,\r\n                 FT_Int     power_ten );\r\n\r\n    FT_Error\r\n    (*to_bytes)( PS_Parser  parser,\r\n                 FT_Byte*   bytes,\r\n                 FT_Long    max_bytes,\r\n                 FT_Long*   pnum_bytes,\r\n                 FT_Bool    delimiters );\r\n\r\n    FT_Int\r\n    (*to_coord_array)( PS_Parser  parser,\r\n                       FT_Int     max_coords,\r\n                       FT_Short*  coords );\r\n    FT_Int\r\n    (*to_fixed_array)( PS_Parser  parser,\r\n                       FT_Int     max_values,\r\n                       FT_Fixed*  values,\r\n                       FT_Int     power_ten );\r\n\r\n    void\r\n    (*to_token)( PS_Parser  parser,\r\n                 T1_Token   token );\r\n    void\r\n    (*to_token_array)( PS_Parser  parser,\r\n                       T1_Token   tokens,\r\n                       FT_UInt    max_tokens,\r\n                       FT_Int*    pnum_tokens );\r\n\r\n    FT_Error\r\n    (*load_field)( PS_Parser       parser,\r\n                   const T1_Field  field,\r\n                   void**          objects,\r\n                   FT_UInt         max_objects,\r\n                   FT_ULong*       pflags );\r\n\r\n    FT_Error\r\n    (*load_field_table)( PS_Parser       parser,\r\n                         const T1_Field  field,\r\n                         void**          objects,\r\n                         FT_UInt         max_objects,\r\n                         FT_ULong*       pflags );\r\n\r\n  } PS_Parser_FuncsRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    PS_ParserRec                                                       */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A PS_Parser is an object used to parse a Type 1 font very quickly. */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    cursor :: The current position in the text.                        */\r\n  /*                                                                       */\r\n  /*    base   :: Start of the processed text.                             */\r\n  /*                                                                       */\r\n  /*    limit  :: End of the processed text.                               */\r\n  /*                                                                       */\r\n  /*    error  :: The last error returned.                                 */\r\n  /*                                                                       */\r\n  /*    memory :: The object used for memory operations (alloc/realloc).   */\r\n  /*                                                                       */\r\n  /*    funcs  :: A table of functions for the parser.                     */\r\n  /*                                                                       */\r\n  typedef struct  PS_ParserRec_\r\n  {\r\n    FT_Byte*   cursor;\r\n    FT_Byte*   base;\r\n    FT_Byte*   limit;\r\n    FT_Error   error;\r\n    FT_Memory  memory;\r\n\r\n    PS_Parser_FuncsRec  funcs;\r\n\r\n  } PS_ParserRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                         T1 BUILDER                            *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  typedef struct T1_BuilderRec_*  T1_Builder;\r\n\r\n\r\n  typedef FT_Error\r\n  (*T1_Builder_Check_Points_Func)( T1_Builder  builder,\r\n                                   FT_Int      count );\r\n\r\n  typedef void\r\n  (*T1_Builder_Add_Point_Func)( T1_Builder  builder,\r\n                                FT_Pos      x,\r\n                                FT_Pos      y,\r\n                                FT_Byte     flag );\r\n\r\n  typedef FT_Error\r\n  (*T1_Builder_Add_Point1_Func)( T1_Builder  builder,\r\n                                 FT_Pos      x,\r\n                                 FT_Pos      y );\r\n\r\n  typedef FT_Error\r\n  (*T1_Builder_Add_Contour_Func)( T1_Builder  builder );\r\n\r\n  typedef FT_Error\r\n  (*T1_Builder_Start_Point_Func)( T1_Builder  builder,\r\n                                  FT_Pos      x,\r\n                                  FT_Pos      y );\r\n\r\n  typedef void\r\n  (*T1_Builder_Close_Contour_Func)( T1_Builder  builder );\r\n\r\n\r\n  typedef const struct T1_Builder_FuncsRec_*  T1_Builder_Funcs;\r\n\r\n  typedef struct  T1_Builder_FuncsRec_\r\n  {\r\n    void\r\n    (*init)( T1_Builder    builder,\r\n             FT_Face       face,\r\n             FT_Size       size,\r\n             FT_GlyphSlot  slot,\r\n             FT_Bool       hinting );\r\n\r\n    void\r\n    (*done)( T1_Builder   builder );\r\n\r\n    T1_Builder_Check_Points_Func   check_points;\r\n    T1_Builder_Add_Point_Func      add_point;\r\n    T1_Builder_Add_Point1_Func     add_point1;\r\n    T1_Builder_Add_Contour_Func    add_contour;\r\n    T1_Builder_Start_Point_Func    start_point;\r\n    T1_Builder_Close_Contour_Func  close_contour;\r\n\r\n  } T1_Builder_FuncsRec;\r\n\r\n\r\n  /* an enumeration type to handle charstring parsing states */\r\n  typedef enum  T1_ParseState_\r\n  {\r\n    T1_Parse_Start,\r\n    T1_Parse_Have_Width,\r\n    T1_Parse_Have_Moveto,\r\n    T1_Parse_Have_Path\r\n\r\n  } T1_ParseState;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Structure>                                                           */\r\n  /*    T1_BuilderRec                                                      */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*     A structure used during glyph loading to store its outline.       */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    memory       :: The current memory object.                         */\r\n  /*                                                                       */\r\n  /*    face         :: The current face object.                           */\r\n  /*                                                                       */\r\n  /*    glyph        :: The current glyph slot.                            */\r\n  /*                                                                       */\r\n  /*    loader       :: XXX                                                */\r\n  /*                                                                       */\r\n  /*    base         :: The base glyph outline.                            */\r\n  /*                                                                       */\r\n  /*    current      :: The current glyph outline.                         */\r\n  /*                                                                       */\r\n  /*    max_points   :: maximum points in builder outline                  */\r\n  /*                                                                       */\r\n  /*    max_contours :: Maximal number of contours in builder outline.     */\r\n  /*                                                                       */\r\n  /*    last         :: The last point position.                           */\r\n  /*                                                                       */\r\n  /*    scale_x      :: The horizontal scaling value (FUnits to            */\r\n  /*                    sub-pixels).                                       */\r\n  /*                                                                       */\r\n  /*    scale_y      :: The vertical scaling value (FUnits to sub-pixels). */\r\n  /*                                                                       */\r\n  /*    pos_x        :: The horizontal translation (if composite glyph).   */\r\n  /*                                                                       */\r\n  /*    pos_y        :: The vertical translation (if composite glyph).     */\r\n  /*                                                                       */\r\n  /*    left_bearing :: The left side bearing point.                       */\r\n  /*                                                                       */\r\n  /*    advance      :: The horizontal advance vector.                     */\r\n  /*                                                                       */\r\n  /*    bbox         :: Unused.                                            */\r\n  /*                                                                       */\r\n  /*    parse_state  :: An enumeration which controls the charstring       */\r\n  /*                    parsing state.                                     */\r\n  /*                                                                       */\r\n  /*    load_points  :: If this flag is not set, no points are loaded.     */\r\n  /*                                                                       */\r\n  /*    no_recurse   :: Set but not used.                                  */\r\n  /*                                                                       */\r\n  /*    metrics_only :: A boolean indicating that we only want to compute  */\r\n  /*                    the metrics of a given glyph, not load all of its  */\r\n  /*                    points.                                            */\r\n  /*                                                                       */\r\n  /*    funcs        :: An array of function pointers for the builder.     */\r\n  /*                                                                       */\r\n  typedef struct  T1_BuilderRec_\r\n  {\r\n    FT_Memory       memory;\r\n    FT_Face         face;\r\n    FT_GlyphSlot    glyph;\r\n    FT_GlyphLoader  loader;\r\n    FT_Outline*     base;\r\n    FT_Outline*     current;\r\n\r\n    FT_Vector       last;\r\n\r\n    FT_Fixed        scale_x;\r\n    FT_Fixed        scale_y;\r\n\r\n    FT_Pos          pos_x;\r\n    FT_Pos          pos_y;\r\n\r\n    FT_Vector       left_bearing;\r\n    FT_Vector       advance;\r\n\r\n    FT_BBox         bbox;          /* bounding box */\r\n    T1_ParseState   parse_state;\r\n    FT_Bool         load_points;\r\n    FT_Bool         no_recurse;\r\n    FT_Bool         shift;\r\n\r\n    FT_Bool         metrics_only;\r\n\r\n    void*           hints_funcs;    /* hinter-specific */\r\n    void*           hints_globals;  /* hinter-specific */\r\n\r\n    T1_Builder_FuncsRec  funcs;\r\n\r\n  } T1_BuilderRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                         T1 DECODER                            *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n#if 0\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* T1_MAX_SUBRS_CALLS details the maximum number of nested sub-routine   */\r\n  /* calls during glyph loading.                                           */\r\n  /*                                                                       */\r\n#define T1_MAX_SUBRS_CALLS  8\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* T1_MAX_CHARSTRING_OPERANDS is the charstring stack's capacity.  A     */\r\n  /* minimum of 16 is required.                                            */\r\n  /*                                                                       */\r\n#define T1_MAX_CHARSTRINGS_OPERANDS  32\r\n\r\n#endif /* 0 */\r\n\r\n\r\n  typedef struct  T1_Decoder_ZoneRec_\r\n  {\r\n    FT_Byte*  cursor;\r\n    FT_Byte*  base;\r\n    FT_Byte*  limit;\r\n\r\n  } T1_Decoder_ZoneRec, *T1_Decoder_Zone;\r\n\r\n\r\n  typedef struct T1_DecoderRec_*              T1_Decoder;\r\n  typedef const struct T1_Decoder_FuncsRec_*  T1_Decoder_Funcs;\r\n\r\n\r\n  typedef FT_Error\r\n  (*T1_Decoder_Callback)( T1_Decoder  decoder,\r\n                          FT_UInt     glyph_index );\r\n\r\n\r\n  typedef struct  T1_Decoder_FuncsRec_\r\n  {\r\n    FT_Error\r\n    (*init)( T1_Decoder           decoder,\r\n             FT_Face              face,\r\n             FT_Size              size,\r\n             FT_GlyphSlot         slot,\r\n             FT_Byte**            glyph_names,\r\n             PS_Blend             blend,\r\n             FT_Bool              hinting,\r\n             FT_Render_Mode       hint_mode,\r\n             T1_Decoder_Callback  callback );\r\n\r\n    void\r\n    (*done)( T1_Decoder  decoder );\r\n\r\n    FT_Error\r\n    (*parse_charstrings)( T1_Decoder  decoder,\r\n                          FT_Byte*    base,\r\n                          FT_UInt     len );\r\n\r\n  } T1_Decoder_FuncsRec;\r\n\r\n\r\n  typedef struct  T1_DecoderRec_\r\n  {\r\n    T1_BuilderRec        builder;\r\n\r\n    FT_Long              stack[T1_MAX_CHARSTRINGS_OPERANDS];\r\n    FT_Long*             top;\r\n\r\n    T1_Decoder_ZoneRec   zones[T1_MAX_SUBRS_CALLS + 1];\r\n    T1_Decoder_Zone      zone;\r\n\r\n    FT_Service_PsCMaps   psnames;      /* for seac */\r\n    FT_UInt              num_glyphs;\r\n    FT_Byte**            glyph_names;\r\n\r\n    FT_Int               lenIV;        /* internal for sub routine calls */\r\n    FT_UInt              num_subrs;\r\n    FT_Byte**            subrs;\r\n    FT_PtrDist*          subrs_len;    /* array of subrs length (optional) */\r\n\r\n    FT_Matrix            font_matrix;\r\n    FT_Vector            font_offset;\r\n\r\n    FT_Int               flex_state;\r\n    FT_Int               num_flex_vectors;\r\n    FT_Vector            flex_vectors[7];\r\n\r\n    PS_Blend             blend;       /* for multiple master support */\r\n\r\n    FT_Render_Mode       hint_mode;\r\n\r\n    T1_Decoder_Callback  parse_callback;\r\n    T1_Decoder_FuncsRec  funcs;\r\n\r\n    FT_Int*              buildchar;\r\n    FT_UInt              len_buildchar;\r\n\r\n  } T1_DecoderRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                            AFM PARSER                         *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  typedef struct AFM_ParserRec_*  AFM_Parser;\r\n\r\n  typedef struct  AFM_Parser_FuncsRec_\r\n  {\r\n    FT_Error\r\n    (*init)( AFM_Parser  parser,\r\n             FT_Memory   memory,\r\n             FT_Byte*    base,\r\n             FT_Byte*    limit );\r\n\r\n    void\r\n    (*done)( AFM_Parser  parser );\r\n\r\n    FT_Error\r\n    (*parse)( AFM_Parser  parser );\r\n\r\n  } AFM_Parser_FuncsRec;\r\n\r\n\r\n  typedef struct AFM_StreamRec_*  AFM_Stream;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    AFM_ParserRec                                                      */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    An AFM_Parser is a parser for the AFM files.                       */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    memory    :: The object used for memory operations (alloc and      */\r\n  /*                 realloc).                                             */\r\n  /*                                                                       */\r\n  /*    stream    :: This is an opaque object.                             */\r\n  /*                                                                       */\r\n  /*    FontInfo  :: The result will be stored here.                       */\r\n  /*                                                                       */\r\n  /*    get_index :: A user provided function to get a glyph index by its  */\r\n  /*                 name.                                                 */\r\n  /*                                                                       */\r\n  typedef struct  AFM_ParserRec_\r\n  {\r\n    FT_Memory     memory;\r\n    AFM_Stream    stream;\r\n\r\n    AFM_FontInfo  FontInfo;\r\n\r\n    FT_Int\r\n    (*get_index)( const char*  name,\r\n                  FT_UInt      len,\r\n                  void*        user_data );\r\n\r\n    void*         user_data;\r\n\r\n  } AFM_ParserRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                     TYPE1 CHARMAPS                            *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  typedef const struct T1_CMap_ClassesRec_*  T1_CMap_Classes;\r\n\r\n  typedef struct T1_CMap_ClassesRec_\r\n  {\r\n    FT_CMap_Class  standard;\r\n    FT_CMap_Class  expert;\r\n    FT_CMap_Class  custom;\r\n    FT_CMap_Class  unicode;\r\n\r\n  } T1_CMap_ClassesRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                        PSAux Module Interface                 *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  typedef struct  PSAux_ServiceRec_\r\n  {\r\n    /* don't use `PS_Table_Funcs' and friends to avoid compiler warnings */\r\n    const PS_Table_FuncsRec*    ps_table_funcs;\r\n    const PS_Parser_FuncsRec*   ps_parser_funcs;\r\n    const T1_Builder_FuncsRec*  t1_builder_funcs;\r\n    const T1_Decoder_FuncsRec*  t1_decoder_funcs;\r\n\r\n    void\r\n    (*t1_decrypt)( FT_Byte*   buffer,\r\n                   FT_Offset  length,\r\n                   FT_UShort  seed );\r\n\r\n    T1_CMap_Classes  t1_cmap_classes;\r\n\r\n    /* fields after this comment line were added after version 2.1.10 */\r\n    const AFM_Parser_FuncsRec*  afm_parser_funcs;\r\n\r\n  } PSAux_ServiceRec, *PSAux_Service;\r\n\r\n  /* backwards-compatible type definition */\r\n  typedef PSAux_ServiceRec   PSAux_Interface;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                 Some convenience functions                    *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n#define IS_PS_NEWLINE( ch ) \\\r\n  ( (ch) == '\\r' ||         \\\r\n    (ch) == '\\n' )\r\n\r\n#define IS_PS_SPACE( ch )  \\\r\n  ( (ch) == ' '         || \\\r\n    IS_PS_NEWLINE( ch ) || \\\r\n    (ch) == '\\t'        || \\\r\n    (ch) == '\\f'        || \\\r\n    (ch) == '\\0' )\r\n\r\n#define IS_PS_SPECIAL( ch )       \\\r\n  ( (ch) == '/'                || \\\r\n    (ch) == '(' || (ch) == ')' || \\\r\n    (ch) == '<' || (ch) == '>' || \\\r\n    (ch) == '[' || (ch) == ']' || \\\r\n    (ch) == '{' || (ch) == '}' || \\\r\n    (ch) == '%'                )\r\n\r\n#define IS_PS_DELIM( ch )  \\\r\n  ( IS_PS_SPACE( ch )   || \\\r\n    IS_PS_SPECIAL( ch ) )\r\n\r\n#define IS_PS_DIGIT( ch )        \\\r\n  ( (ch) >= '0' && (ch) <= '9' )\r\n\r\n#define IS_PS_XDIGIT( ch )            \\\r\n  ( IS_PS_DIGIT( ch )              || \\\r\n    ( (ch) >= 'A' && (ch) <= 'F' ) || \\\r\n    ( (ch) >= 'a' && (ch) <= 'f' ) )\r\n\r\n#define IS_PS_BASE85( ch )       \\\r\n  ( (ch) >= '!' && (ch) <= 'u' )\r\n\r\n#define IS_PS_TOKEN( cur, limit, token )                                \\\r\n  ( (char)(cur)[0] == (token)[0]                                     && \\\r\n    ( (cur) + sizeof ( (token) ) == (limit) ||                          \\\r\n      ( (cur) + sizeof( (token) ) < (limit)          &&                 \\\r\n        IS_PS_DELIM( (cur)[sizeof ( (token) ) - 1] ) ) )             && \\\r\n    ft_strncmp( (char*)(cur), (token), sizeof ( (token) ) - 1 ) == 0 )\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __PSAUX_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/pshints.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  pshints.h                                                              */\r\n/*                                                                         */\r\n/*    Interface to Postscript-specific (Type 1 and Type 2) hints           */\r\n/*    recorders (specification only).  These are used to support native    */\r\n/*    T1/T2 hints in the `type1', `cid', and `cff' font drivers.           */\r\n/*                                                                         */\r\n/*  Copyright 2001, 2002, 2003, 2005, 2006, 2007 by                        */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __PSHINTS_H__\r\n#define __PSHINTS_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_FREETYPE_H\r\n#include FT_TYPE1_TABLES_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****               INTERNAL REPRESENTATION OF GLOBALS              *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  typedef struct PSH_GlobalsRec_*  PSH_Globals;\r\n\r\n  typedef FT_Error\r\n  (*PSH_Globals_NewFunc)( FT_Memory     memory,\r\n                          T1_Private*   private_dict,\r\n                          PSH_Globals*  aglobals );\r\n\r\n  typedef FT_Error\r\n  (*PSH_Globals_SetScaleFunc)( PSH_Globals  globals,\r\n                               FT_Fixed     x_scale,\r\n                               FT_Fixed     y_scale,\r\n                               FT_Fixed     x_delta,\r\n                               FT_Fixed     y_delta );\r\n\r\n  typedef void\r\n  (*PSH_Globals_DestroyFunc)( PSH_Globals  globals );\r\n\r\n\r\n  typedef struct  PSH_Globals_FuncsRec_\r\n  {\r\n    PSH_Globals_NewFunc       create;\r\n    PSH_Globals_SetScaleFunc  set_scale;\r\n    PSH_Globals_DestroyFunc   destroy;\r\n\r\n  } PSH_Globals_FuncsRec, *PSH_Globals_Funcs;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                  PUBLIC TYPE 1 HINTS RECORDER                 *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @type:\r\n   *   T1_Hints\r\n   *\r\n   * @description:\r\n   *   This is a handle to an opaque structure used to record glyph hints\r\n   *   from a Type 1 character glyph character string.\r\n   *\r\n   *   The methods used to operate on this object are defined by the\r\n   *   @T1_Hints_FuncsRec structure.  Recording glyph hints is normally\r\n   *   achieved through the following scheme:\r\n   *\r\n   *   - Open a new hint recording session by calling the `open' method.\r\n   *     This rewinds the recorder and prepare it for new input.\r\n   *\r\n   *   - For each hint found in the glyph charstring, call the corresponding\r\n   *     method (`stem', `stem3', or `reset').  Note that these functions do\r\n   *     not return an error code.\r\n   *\r\n   *   - Close the recording session by calling the `close' method.  It\r\n   *     returns an error code if the hints were invalid or something\r\n   *     strange happened (e.g., memory shortage).\r\n   *\r\n   *   The hints accumulated in the object can later be used by the\r\n   *   PostScript hinter.\r\n   *\r\n   */\r\n  typedef struct T1_HintsRec_*  T1_Hints;\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @type:\r\n   *   T1_Hints_Funcs\r\n   *\r\n   * @description:\r\n   *   A pointer to the @T1_Hints_FuncsRec structure that defines the API of\r\n   *   a given @T1_Hints object.\r\n   *\r\n   */\r\n  typedef const struct T1_Hints_FuncsRec_*  T1_Hints_Funcs;\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T1_Hints_OpenFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T1_Hints class used to prepare it for a new Type 1\r\n   *   hints recording session.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 1 hints recorder.\r\n   *\r\n   * @note:\r\n   *   You should always call the @T1_Hints_CloseFunc method in order to\r\n   *   close an opened recording session.\r\n   *\r\n   */\r\n  typedef void\r\n  (*T1_Hints_OpenFunc)( T1_Hints  hints );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T1_Hints_SetStemFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T1_Hints class used to record a new horizontal or\r\n   *   vertical stem.  This corresponds to the Type 1 `hstem' and `vstem'\r\n   *   operators.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 1 hints recorder.\r\n   *\r\n   *   dimension ::\r\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\r\n   *\r\n   *   coords ::\r\n   *     Array of 2 integers, used as (position,length) stem descriptor.\r\n   *\r\n   * @note:\r\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\r\n   *   horizontal coordinates (x) for vertical stems (dim=1).\r\n   *\r\n   *   `coords[0]' is the absolute stem position (lowest coordinate);\r\n   *   `coords[1]' is the length.\r\n   *\r\n   *   The length can be negative, in which case it must be either -20 or\r\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\r\n   *   specification.\r\n   *\r\n   *   If the length is -21 (corresponding to a bottom ghost stem), then\r\n   *   the real stem position is `coords[0]+coords[1]'.\r\n   *\r\n   */\r\n  typedef void\r\n  (*T1_Hints_SetStemFunc)( T1_Hints  hints,\r\n                           FT_UInt   dimension,\r\n                           FT_Long*  coords );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T1_Hints_SetStem3Func\r\n   *\r\n   * @description:\r\n   *   A method of the @T1_Hints class used to record three\r\n   *   counter-controlled horizontal or vertical stems at once.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 1 hints recorder.\r\n   *\r\n   *   dimension ::\r\n   *     0 for horizontal stems, 1 for vertical ones.\r\n   *\r\n   *   coords ::\r\n   *     An array of 6 integers, holding 3 (position,length) pairs for the\r\n   *     counter-controlled stems.\r\n   *\r\n   * @note:\r\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\r\n   *   horizontal coordinates (x) for vertical stems (dim=1).\r\n   *\r\n   *   The lengths cannot be negative (ghost stems are never\r\n   *   counter-controlled).\r\n   *\r\n   */\r\n  typedef void\r\n  (*T1_Hints_SetStem3Func)( T1_Hints  hints,\r\n                            FT_UInt   dimension,\r\n                            FT_Long*  coords );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T1_Hints_ResetFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T1_Hints class used to reset the stems hints in a\r\n   *   recording session.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 1 hints recorder.\r\n   *\r\n   *   end_point ::\r\n   *     The index of the last point in the input glyph in which the\r\n   *     previously defined hints apply.\r\n   *\r\n   */\r\n  typedef void\r\n  (*T1_Hints_ResetFunc)( T1_Hints  hints,\r\n                         FT_UInt   end_point );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T1_Hints_CloseFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T1_Hints class used to close a hint recording\r\n   *   session.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 1 hints recorder.\r\n   *\r\n   *   end_point ::\r\n   *     The index of the last point in the input glyph.\r\n   *\r\n   * @return:\r\n   *   FreeType error code.  0 means success.\r\n   *\r\n   * @note:\r\n   *   The error code is set to indicate that an error occurred during the\r\n   *   recording session.\r\n   *\r\n   */\r\n  typedef FT_Error\r\n  (*T1_Hints_CloseFunc)( T1_Hints  hints,\r\n                         FT_UInt   end_point );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T1_Hints_ApplyFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T1_Hints class used to apply hints to the\r\n   *   corresponding glyph outline.  Must be called once all hints have been\r\n   *   recorded.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 1 hints recorder.\r\n   *\r\n   *   outline ::\r\n   *     A pointer to the target outline descriptor.\r\n   *\r\n   *   globals ::\r\n   *     The hinter globals for this font.\r\n   *\r\n   *   hint_mode ::\r\n   *     Hinting information.\r\n   *\r\n   * @return:\r\n   *   FreeType error code.  0 means success.\r\n   *\r\n   * @note:\r\n   *   On input, all points within the outline are in font coordinates. On\r\n   *   output, they are in 1/64th of pixels.\r\n   *\r\n   *   The scaling transformation is taken from the `globals' object which\r\n   *   must correspond to the same font as the glyph.\r\n   *\r\n   */\r\n  typedef FT_Error\r\n  (*T1_Hints_ApplyFunc)( T1_Hints        hints,\r\n                         FT_Outline*     outline,\r\n                         PSH_Globals     globals,\r\n                         FT_Render_Mode  hint_mode );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @struct:\r\n   *   T1_Hints_FuncsRec\r\n   *\r\n   * @description:\r\n   *   The structure used to provide the API to @T1_Hints objects.\r\n   *\r\n   * @fields:\r\n   *   hints ::\r\n   *     A handle to the T1 Hints recorder.\r\n   *\r\n   *   open ::\r\n   *     The function to open a recording session.\r\n   *\r\n   *   close ::\r\n   *     The function to close a recording session.\r\n   *\r\n   *   stem ::\r\n   *     The function to set a simple stem.\r\n   *\r\n   *   stem3 ::\r\n   *     The function to set counter-controlled stems.\r\n   *\r\n   *   reset ::\r\n   *     The function to reset stem hints.\r\n   *\r\n   *   apply ::\r\n   *     The function to apply the hints to the corresponding glyph outline.\r\n   *\r\n   */\r\n  typedef struct  T1_Hints_FuncsRec_\r\n  {\r\n    T1_Hints               hints;\r\n    T1_Hints_OpenFunc      open;\r\n    T1_Hints_CloseFunc     close;\r\n    T1_Hints_SetStemFunc   stem;\r\n    T1_Hints_SetStem3Func  stem3;\r\n    T1_Hints_ResetFunc     reset;\r\n    T1_Hints_ApplyFunc     apply;\r\n\r\n  } T1_Hints_FuncsRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*****                                                               *****/\r\n  /*****                  PUBLIC TYPE 2 HINTS RECORDER                 *****/\r\n  /*****                                                               *****/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @type:\r\n   *   T2_Hints\r\n   *\r\n   * @description:\r\n   *   This is a handle to an opaque structure used to record glyph hints\r\n   *   from a Type 2 character glyph character string.\r\n   *\r\n   *   The methods used to operate on this object are defined by the\r\n   *   @T2_Hints_FuncsRec structure.  Recording glyph hints is normally\r\n   *   achieved through the following scheme:\r\n   *\r\n   *   - Open a new hint recording session by calling the `open' method.\r\n   *     This rewinds the recorder and prepare it for new input.\r\n   *\r\n   *   - For each hint found in the glyph charstring, call the corresponding\r\n   *     method (`stems', `hintmask', `counters').  Note that these\r\n   *     functions do not return an error code.\r\n   *\r\n   *   - Close the recording session by calling the `close' method.  It\r\n   *     returns an error code if the hints were invalid or something\r\n   *     strange happened (e.g., memory shortage).\r\n   *\r\n   *   The hints accumulated in the object can later be used by the\r\n   *   Postscript hinter.\r\n   *\r\n   */\r\n  typedef struct T2_HintsRec_*  T2_Hints;\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @type:\r\n   *   T2_Hints_Funcs\r\n   *\r\n   * @description:\r\n   *   A pointer to the @T2_Hints_FuncsRec structure that defines the API of\r\n   *   a given @T2_Hints object.\r\n   *\r\n   */\r\n  typedef const struct T2_Hints_FuncsRec_*  T2_Hints_Funcs;\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T2_Hints_OpenFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T2_Hints class used to prepare it for a new Type 2\r\n   *   hints recording session.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 2 hints recorder.\r\n   *\r\n   * @note:\r\n   *   You should always call the @T2_Hints_CloseFunc method in order to\r\n   *   close an opened recording session.\r\n   *\r\n   */\r\n  typedef void\r\n  (*T2_Hints_OpenFunc)( T2_Hints  hints );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T2_Hints_StemsFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T2_Hints class used to set the table of stems in\r\n   *   either the vertical or horizontal dimension.  Equivalent to the\r\n   *   `hstem', `vstem', `hstemhm', and `vstemhm' Type 2 operators.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 2 hints recorder.\r\n   *\r\n   *   dimension ::\r\n   *     0 for horizontal stems (hstem), 1 for vertical ones (vstem).\r\n   *\r\n   *   count ::\r\n   *     The number of stems.\r\n   *\r\n   *   coords ::\r\n   *     An array of `count' (position,length) pairs.\r\n   *\r\n   * @note:\r\n   *   Use vertical coordinates (y) for horizontal stems (dim=0).  Use\r\n   *   horizontal coordinates (x) for vertical stems (dim=1).\r\n   *\r\n   *   There are `2*count' elements in the `coords' array.  Each even\r\n   *   element is an absolute position in font units, each odd element is a\r\n   *   length in font units.\r\n   *\r\n   *   A length can be negative, in which case it must be either -20 or\r\n   *   -21.  It is interpreted as a `ghost' stem, according to the Type 1\r\n   *   specification.\r\n   *\r\n   */\r\n  typedef void\r\n  (*T2_Hints_StemsFunc)( T2_Hints   hints,\r\n                         FT_UInt    dimension,\r\n                         FT_UInt    count,\r\n                         FT_Fixed*  coordinates );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T2_Hints_MaskFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T2_Hints class used to set a given hintmask (this\r\n   *   corresponds to the `hintmask' Type 2 operator).\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 2 hints recorder.\r\n   *\r\n   *   end_point ::\r\n   *     The glyph index of the last point to which the previously defined\r\n   *     or activated hints apply.\r\n   *\r\n   *   bit_count ::\r\n   *     The number of bits in the hint mask.\r\n   *\r\n   *   bytes ::\r\n   *     An array of bytes modelling the hint mask.\r\n   *\r\n   * @note:\r\n   *   If the hintmask starts the charstring (before any glyph point\r\n   *   definition), the value of `end_point' should be 0.\r\n   *\r\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\r\n   *   must be equal to the total number of hints defined so far (i.e.,\r\n   *   horizontal+verticals).\r\n   *\r\n   *   The `bytes' array can come directly from the Type 2 charstring and\r\n   *   respects the same format.\r\n   *\r\n   */\r\n  typedef void\r\n  (*T2_Hints_MaskFunc)( T2_Hints        hints,\r\n                        FT_UInt         end_point,\r\n                        FT_UInt         bit_count,\r\n                        const FT_Byte*  bytes );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T2_Hints_CounterFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T2_Hints class used to set a given counter mask\r\n   *   (this corresponds to the `hintmask' Type 2 operator).\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 2 hints recorder.\r\n   *\r\n   *   end_point ::\r\n   *     A glyph index of the last point to which the previously defined or\r\n   *     active hints apply.\r\n   *\r\n   *   bit_count ::\r\n   *     The number of bits in the hint mask.\r\n   *\r\n   *   bytes ::\r\n   *     An array of bytes modelling the hint mask.\r\n   *\r\n   * @note:\r\n   *   If the hintmask starts the charstring (before any glyph point\r\n   *   definition), the value of `end_point' should be 0.\r\n   *\r\n   *   `bit_count' is the number of meaningful bits in the `bytes' array; it\r\n   *   must be equal to the total number of hints defined so far (i.e.,\r\n   *   horizontal+verticals).\r\n   *\r\n   *    The `bytes' array can come directly from the Type 2 charstring and\r\n   *    respects the same format.\r\n   *\r\n   */\r\n  typedef void\r\n  (*T2_Hints_CounterFunc)( T2_Hints        hints,\r\n                           FT_UInt         bit_count,\r\n                           const FT_Byte*  bytes );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T2_Hints_CloseFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T2_Hints class used to close a hint recording\r\n   *   session.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 2 hints recorder.\r\n   *\r\n   *   end_point ::\r\n   *     The index of the last point in the input glyph.\r\n   *\r\n   * @return:\r\n   *   FreeType error code.  0 means success.\r\n   *\r\n   * @note:\r\n   *   The error code is set to indicate that an error occurred during the\r\n   *   recording session.\r\n   *\r\n   */\r\n  typedef FT_Error\r\n  (*T2_Hints_CloseFunc)( T2_Hints  hints,\r\n                         FT_UInt   end_point );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @functype:\r\n   *   T2_Hints_ApplyFunc\r\n   *\r\n   * @description:\r\n   *   A method of the @T2_Hints class used to apply hints to the\r\n   *   corresponding glyph outline.  Must be called after the `close'\r\n   *   method.\r\n   *\r\n   * @input:\r\n   *   hints ::\r\n   *     A handle to the Type 2 hints recorder.\r\n   *\r\n   *   outline ::\r\n   *     A pointer to the target outline descriptor.\r\n   *\r\n   *   globals ::\r\n   *     The hinter globals for this font.\r\n   *\r\n   *   hint_mode ::\r\n   *     Hinting information.\r\n   *\r\n   * @return:\r\n   *   FreeType error code.  0 means success.\r\n   *\r\n   * @note:\r\n   *   On input, all points within the outline are in font coordinates. On\r\n   *   output, they are in 1/64th of pixels.\r\n   *\r\n   *   The scaling transformation is taken from the `globals' object which\r\n   *   must correspond to the same font than the glyph.\r\n   *\r\n   */\r\n  typedef FT_Error\r\n  (*T2_Hints_ApplyFunc)( T2_Hints        hints,\r\n                         FT_Outline*     outline,\r\n                         PSH_Globals     globals,\r\n                         FT_Render_Mode  hint_mode );\r\n\r\n\r\n  /*************************************************************************\r\n   *\r\n   * @struct:\r\n   *   T2_Hints_FuncsRec\r\n   *\r\n   * @description:\r\n   *   The structure used to provide the API to @T2_Hints objects.\r\n   *\r\n   * @fields:\r\n   *   hints ::\r\n   *     A handle to the T2 hints recorder object.\r\n   *\r\n   *   open ::\r\n   *     The function to open a recording session.\r\n   *\r\n   *   close ::\r\n   *     The function to close a recording session.\r\n   *\r\n   *   stems ::\r\n   *     The function to set the dimension's stems table.\r\n   *\r\n   *   hintmask ::\r\n   *     The function to set hint masks.\r\n   *\r\n   *   counter ::\r\n   *     The function to set counter masks.\r\n   *\r\n   *   apply ::\r\n   *     The function to apply the hints on the corresponding glyph outline.\r\n   *\r\n   */\r\n  typedef struct  T2_Hints_FuncsRec_\r\n  {\r\n    T2_Hints              hints;\r\n    T2_Hints_OpenFunc     open;\r\n    T2_Hints_CloseFunc    close;\r\n    T2_Hints_StemsFunc    stems;\r\n    T2_Hints_MaskFunc     hintmask;\r\n    T2_Hints_CounterFunc  counter;\r\n    T2_Hints_ApplyFunc    apply;\r\n\r\n  } T2_Hints_FuncsRec;\r\n\r\n\r\n  /* */\r\n\r\n\r\n  typedef struct  PSHinter_Interface_\r\n  {\r\n    PSH_Globals_Funcs  (*get_globals_funcs)( FT_Module  module );\r\n    T1_Hints_Funcs     (*get_t1_funcs)     ( FT_Module  module );\r\n    T2_Hints_Funcs     (*get_t2_funcs)     ( FT_Module  module );\r\n\r\n  } PSHinter_Interface;\r\n\r\n  typedef PSHinter_Interface*  PSHinter_Service;\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __PSHINTS_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svbdf.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svbdf.h                                                                */\r\n/*                                                                         */\r\n/*    The FreeType BDF services (specification).                           */\r\n/*                                                                         */\r\n/*  Copyright 2003 by                                                      */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVBDF_H__\r\n#define __SVBDF_H__\r\n\r\n#include FT_BDF_H\r\n#include FT_INTERNAL_SERVICE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n#define FT_SERVICE_ID_BDF  \"bdf\"\r\n\r\n  typedef FT_Error\r\n  (*FT_BDF_GetCharsetIdFunc)( FT_Face       face,\r\n                              const char*  *acharset_encoding,\r\n                              const char*  *acharset_registry );\r\n\r\n  typedef FT_Error\r\n  (*FT_BDF_GetPropertyFunc)( FT_Face           face,\r\n                             const char*       prop_name,\r\n                             BDF_PropertyRec  *aproperty );\r\n\r\n\r\n  FT_DEFINE_SERVICE( BDF )\r\n  {\r\n    FT_BDF_GetCharsetIdFunc  get_charset_id;\r\n    FT_BDF_GetPropertyFunc   get_property;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVBDF_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svgldict.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svgldict.h                                                             */\r\n/*                                                                         */\r\n/*    The FreeType glyph dictionary services (specification).              */\r\n/*                                                                         */\r\n/*  Copyright 2003 by                                                      */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVGLDICT_H__\r\n#define __SVGLDICT_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*\r\n   *  A service used to retrieve glyph names, as well as to find the\r\n   *  index of a given glyph name in a font.\r\n   *\r\n   */\r\n\r\n#define FT_SERVICE_ID_GLYPH_DICT  \"glyph-dict\"\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_GlyphDict_GetNameFunc)( FT_Face     face,\r\n                               FT_UInt     glyph_index,\r\n                               FT_Pointer  buffer,\r\n                               FT_UInt     buffer_max );\r\n\r\n  typedef FT_UInt\r\n  (*FT_GlyphDict_NameIndexFunc)( FT_Face     face,\r\n                                 FT_String*  glyph_name );\r\n\r\n\r\n  FT_DEFINE_SERVICE( GlyphDict )\r\n  {\r\n    FT_GlyphDict_GetNameFunc    get_name;\r\n    FT_GlyphDict_NameIndexFunc  name_index;  /* optional */\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVGLDICT_H__ */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svgxval.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svgxval.h                                                              */\r\n/*                                                                         */\r\n/*    FreeType API for validating TrueTypeGX/AAT tables (specification).   */\r\n/*                                                                         */\r\n/*  Copyright 2004, 2005 by                                                */\r\n/*  Masatake YAMATO, Red Hat K.K.,                                         */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n/***************************************************************************/\r\n/*                                                                         */\r\n/* gxvalid is derived from both gxlayout module and otvalid module.        */\r\n/* Development of gxlayout is supported by the Information-technology      */\r\n/* Promotion Agency(IPA), Japan.                                           */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVGXVAL_H__\r\n#define __SVGXVAL_H__\r\n\r\n#include FT_GX_VALIDATE_H\r\n#include FT_INTERNAL_VALIDATE_H\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n#define FT_SERVICE_ID_GX_VALIDATE           \"truetypegx-validate\"\r\n#define FT_SERVICE_ID_CLASSICKERN_VALIDATE  \"classickern-validate\"\r\n\r\n  typedef FT_Error\r\n  (*gxv_validate_func)( FT_Face   face,\r\n                        FT_UInt   gx_flags,\r\n                        FT_Bytes  tables[FT_VALIDATE_GX_LENGTH],\r\n                        FT_UInt   table_length );\r\n\r\n\r\n  typedef FT_Error\r\n  (*ckern_validate_func)( FT_Face   face,\r\n                          FT_UInt   ckern_flags,\r\n                          FT_Bytes  *ckern_table );\r\n\r\n\r\n  FT_DEFINE_SERVICE( GXvalidate )\r\n  {\r\n    gxv_validate_func  validate;\r\n  };\r\n\r\n  FT_DEFINE_SERVICE( CKERNvalidate )\r\n  {\r\n    ckern_validate_func  validate;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVGXVAL_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svkern.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svkern.h                                                               */\r\n/*                                                                         */\r\n/*    The FreeType Kerning service (specification).                        */\r\n/*                                                                         */\r\n/*  Copyright 2006 by                                                      */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVKERN_H__\r\n#define __SVKERN_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n#include FT_TRUETYPE_TABLES_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n#define FT_SERVICE_ID_KERNING  \"kerning\"\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_Kerning_TrackGetFunc)( FT_Face    face,\r\n                              FT_Fixed   point_size,\r\n                              FT_Int     degree,\r\n                              FT_Fixed*  akerning );\r\n\r\n  FT_DEFINE_SERVICE( Kerning )\r\n  {\r\n    FT_Kerning_TrackGetFunc  get_track;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVKERN_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svmm.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svmm.h                                                                 */\r\n/*                                                                         */\r\n/*    The FreeType Multiple Masters and GX var services (specification).   */\r\n/*                                                                         */\r\n/*  Copyright 2003, 2004 by                                                */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVMM_H__\r\n#define __SVMM_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*\r\n   *  A service used to manage multiple-masters data in a given face.\r\n   *\r\n   *  See the related APIs in `ftmm.h' (FT_MULTIPLE_MASTERS_H).\r\n   *\r\n   */\r\n\r\n#define FT_SERVICE_ID_MULTI_MASTERS  \"multi-masters\"\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_Get_MM_Func)( FT_Face           face,\r\n                     FT_Multi_Master*  master );\r\n\r\n  typedef FT_Error\r\n  (*FT_Get_MM_Var_Func)( FT_Face      face,\r\n                         FT_MM_Var*  *master );\r\n\r\n  typedef FT_Error\r\n  (*FT_Set_MM_Design_Func)( FT_Face   face,\r\n                            FT_UInt   num_coords,\r\n                            FT_Long*  coords );\r\n\r\n  typedef FT_Error\r\n  (*FT_Set_Var_Design_Func)( FT_Face    face,\r\n                             FT_UInt    num_coords,\r\n                             FT_Fixed*  coords );\r\n\r\n  typedef FT_Error\r\n  (*FT_Set_MM_Blend_Func)( FT_Face   face,\r\n                           FT_UInt   num_coords,\r\n                           FT_Long*  coords );\r\n\r\n\r\n  FT_DEFINE_SERVICE( MultiMasters )\r\n  {\r\n    FT_Get_MM_Func          get_mm;\r\n    FT_Set_MM_Design_Func   set_mm_design;\r\n    FT_Set_MM_Blend_Func    set_mm_blend;\r\n    FT_Get_MM_Var_Func      get_mm_var;\r\n    FT_Set_Var_Design_Func  set_var_design;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __SVMM_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svotval.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svotval.h                                                              */\r\n/*                                                                         */\r\n/*    The FreeType OpenType validation service (specification).            */\r\n/*                                                                         */\r\n/*  Copyright 2004, 2006 by                                                */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVOTVAL_H__\r\n#define __SVOTVAL_H__\r\n\r\n#include FT_OPENTYPE_VALIDATE_H\r\n#include FT_INTERNAL_VALIDATE_H\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n#define FT_SERVICE_ID_OPENTYPE_VALIDATE  \"opentype-validate\"\r\n\r\n\r\n  typedef FT_Error\r\n  (*otv_validate_func)( FT_Face volatile  face,\r\n                        FT_UInt           ot_flags,\r\n                        FT_Bytes         *base,\r\n                        FT_Bytes         *gdef,\r\n                        FT_Bytes         *gpos,\r\n                        FT_Bytes         *gsub,\r\n                        FT_Bytes         *jstf );\r\n\r\n\r\n  FT_DEFINE_SERVICE( OTvalidate )\r\n  {\r\n    otv_validate_func  validate;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVOTVAL_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svpfr.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svpfr.h                                                                */\r\n/*                                                                         */\r\n/*    Internal PFR service functions (specification).                      */\r\n/*                                                                         */\r\n/*  Copyright 2003, 2006 by                                                */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVPFR_H__\r\n#define __SVPFR_H__\r\n\r\n#include FT_PFR_H\r\n#include FT_INTERNAL_SERVICE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n#define FT_SERVICE_ID_PFR_METRICS  \"pfr-metrics\"\r\n\r\n\r\n  typedef FT_Error\r\n  (*FT_PFR_GetMetricsFunc)( FT_Face    face,\r\n                            FT_UInt   *aoutline,\r\n                            FT_UInt   *ametrics,\r\n                            FT_Fixed  *ax_scale,\r\n                            FT_Fixed  *ay_scale );\r\n\r\n  typedef FT_Error\r\n  (*FT_PFR_GetKerningFunc)( FT_Face     face,\r\n                            FT_UInt     left,\r\n                            FT_UInt     right,\r\n                            FT_Vector  *avector );\r\n\r\n  typedef FT_Error\r\n  (*FT_PFR_GetAdvanceFunc)( FT_Face   face,\r\n                            FT_UInt   gindex,\r\n                            FT_Pos   *aadvance );\r\n\r\n\r\n  FT_DEFINE_SERVICE( PfrMetrics )\r\n  {\r\n    FT_PFR_GetMetricsFunc  get_metrics;\r\n    FT_PFR_GetKerningFunc  get_kerning;\r\n    FT_PFR_GetAdvanceFunc  get_advance;\r\n\r\n  };\r\n\r\n /* */\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __SVPFR_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svpostnm.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svpostnm.h                                                             */\r\n/*                                                                         */\r\n/*    The FreeType PostScript name services (specification).               */\r\n/*                                                                         */\r\n/*  Copyright 2003, 2007 by                                                */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVPOSTNM_H__\r\n#define __SVPOSTNM_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n  /*\r\n   *  A trivial service used to retrieve the PostScript name of a given\r\n   *  font when available.  The `get_name' field should never be NULL.\r\n   *\r\n   *  The corresponding function can return NULL to indicate that the\r\n   *  PostScript name is not available.\r\n   *\r\n   *  The name is owned by the face and will be destroyed with it.\r\n   */\r\n\r\n#define FT_SERVICE_ID_POSTSCRIPT_FONT_NAME  \"postscript-font-name\"\r\n\r\n\r\n  typedef const char*\r\n  (*FT_PsName_GetFunc)( FT_Face  face );\r\n\r\n\r\n  FT_DEFINE_SERVICE( PsFontName )\r\n  {\r\n    FT_PsName_GetFunc  get_ps_font_name;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVPOSTNM_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svpscmap.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svpscmap.h                                                             */\r\n/*                                                                         */\r\n/*    The FreeType PostScript charmap service (specification).             */\r\n/*                                                                         */\r\n/*  Copyright 2003, 2006 by                                                */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVPSCMAP_H__\r\n#define __SVPSCMAP_H__\r\n\r\n#include FT_INTERNAL_OBJECTS_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n#define FT_SERVICE_ID_POSTSCRIPT_CMAPS  \"postscript-cmaps\"\r\n\r\n\r\n  /*\r\n   *  Adobe glyph name to unicode value.\r\n   */\r\n  typedef FT_UInt32\r\n  (*PS_Unicode_ValueFunc)( const char*  glyph_name );\r\n\r\n  /*\r\n   *  Macintosh name id to glyph name.  NULL if invalid index.\r\n   */\r\n  typedef const char*\r\n  (*PS_Macintosh_NameFunc)( FT_UInt  name_index );\r\n\r\n  /*\r\n   *  Adobe standard string ID to glyph name.  NULL if invalid index.\r\n   */\r\n  typedef const char*\r\n  (*PS_Adobe_Std_StringsFunc)( FT_UInt  string_index );\r\n\r\n\r\n  /*\r\n   *  Simple unicode -> glyph index charmap built from font glyph names\r\n   *  table.\r\n   */\r\n  typedef struct  PS_UniMap_\r\n  {\r\n    FT_UInt32  unicode;      /* bit 31 set: is glyph variant */\r\n    FT_UInt    glyph_index;\r\n\r\n  } PS_UniMap;\r\n\r\n\r\n  typedef struct PS_UnicodesRec_*  PS_Unicodes;\r\n\r\n  typedef struct  PS_UnicodesRec_\r\n  {\r\n    FT_CMapRec  cmap;\r\n    FT_UInt     num_maps;\r\n    PS_UniMap*  maps;\r\n\r\n  } PS_UnicodesRec;\r\n\r\n\r\n  /*\r\n   *  A function which returns a glyph name for a given index.  Returns\r\n   *  NULL if invalid index.\r\n   */\r\n  typedef const char*\r\n  (*PS_GetGlyphNameFunc)( FT_Pointer  data,\r\n                          FT_UInt     string_index );\r\n\r\n  /*\r\n   *  A function used to release the glyph name returned by\r\n   *  PS_GetGlyphNameFunc, when needed\r\n   */\r\n  typedef void\r\n  (*PS_FreeGlyphNameFunc)( FT_Pointer  data,\r\n                           const char*  name );\r\n\r\n  typedef FT_Error\r\n  (*PS_Unicodes_InitFunc)( FT_Memory             memory,\r\n                           PS_Unicodes           unicodes,\r\n                           FT_UInt               num_glyphs,\r\n                           PS_GetGlyphNameFunc   get_glyph_name,\r\n                           PS_FreeGlyphNameFunc  free_glyph_name,\r\n                           FT_Pointer            glyph_data );\r\n\r\n  typedef FT_UInt\r\n  (*PS_Unicodes_CharIndexFunc)( PS_Unicodes  unicodes,\r\n                                FT_UInt32    unicode );\r\n\r\n  typedef FT_ULong\r\n  (*PS_Unicodes_CharNextFunc)( PS_Unicodes  unicodes,\r\n                               FT_UInt32   *unicode );\r\n\r\n\r\n  FT_DEFINE_SERVICE( PsCMaps )\r\n  {\r\n    PS_Unicode_ValueFunc       unicode_value;\r\n\r\n    PS_Unicodes_InitFunc       unicodes_init;\r\n    PS_Unicodes_CharIndexFunc  unicodes_char_index;\r\n    PS_Unicodes_CharNextFunc   unicodes_char_next;\r\n\r\n    PS_Macintosh_NameFunc      macintosh_name;\r\n    PS_Adobe_Std_StringsFunc   adobe_std_strings;\r\n    const unsigned short*      adobe_std_encoding;\r\n    const unsigned short*      adobe_expert_encoding;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVPSCMAP_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svpsinfo.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svpsinfo.h                                                             */\r\n/*                                                                         */\r\n/*    The FreeType PostScript info service (specification).                */\r\n/*                                                                         */\r\n/*  Copyright 2003, 2004 by                                                */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVPSINFO_H__\r\n#define __SVPSINFO_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n#include FT_INTERNAL_TYPE1_TYPES_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n#define FT_SERVICE_ID_POSTSCRIPT_INFO  \"postscript-info\"\r\n\r\n\r\n  typedef FT_Error\r\n  (*PS_GetFontInfoFunc)( FT_Face          face,\r\n                         PS_FontInfoRec*  afont_info );\r\n\r\n  typedef FT_Int\r\n  (*PS_HasGlyphNamesFunc)( FT_Face   face );\r\n\r\n  typedef FT_Error\r\n  (*PS_GetFontPrivateFunc)( FT_Face         face,\r\n                            PS_PrivateRec*  afont_private );\r\n\r\n\r\n  FT_DEFINE_SERVICE( PsInfo )\r\n  {\r\n    PS_GetFontInfoFunc     ps_get_font_info;\r\n    PS_HasGlyphNamesFunc   ps_has_glyph_names;\r\n    PS_GetFontPrivateFunc  ps_get_font_private;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVPSINFO_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svsfnt.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svsfnt.h                                                               */\r\n/*                                                                         */\r\n/*    The FreeType SFNT table loading service (specification).             */\r\n/*                                                                         */\r\n/*  Copyright 2003, 2004 by                                                */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVSFNT_H__\r\n#define __SVSFNT_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n#include FT_TRUETYPE_TABLES_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*\r\n   *  SFNT table loading service.\r\n   */\r\n\r\n#define FT_SERVICE_ID_SFNT_TABLE  \"sfnt-table\"\r\n\r\n\r\n  /*\r\n   * Used to implement FT_Load_Sfnt_Table().\r\n   */\r\n  typedef FT_Error\r\n  (*FT_SFNT_TableLoadFunc)( FT_Face    face,\r\n                            FT_ULong   tag,\r\n                            FT_Long    offset,\r\n                            FT_Byte*   buffer,\r\n                            FT_ULong*  length );\r\n\r\n  /*\r\n   * Used to implement FT_Get_Sfnt_Table().\r\n   */\r\n  typedef void*\r\n  (*FT_SFNT_TableGetFunc)( FT_Face      face,\r\n                           FT_Sfnt_Tag  tag );\r\n\r\n\r\n  /*\r\n   * Used to implement FT_Sfnt_Table_Info().\r\n   */\r\n  typedef FT_Error\r\n  (*FT_SFNT_TableInfoFunc)( FT_Face    face,\r\n                            FT_UInt    idx,\r\n                            FT_ULong  *tag,\r\n                            FT_ULong  *length );\r\n\r\n\r\n  FT_DEFINE_SERVICE( SFNT_Table )\r\n  {\r\n    FT_SFNT_TableLoadFunc  load_table;\r\n    FT_SFNT_TableGetFunc   get_table;\r\n    FT_SFNT_TableInfoFunc  table_info;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVSFNT_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svttcmap.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svsttcmap.h                                                            */\r\n/*                                                                         */\r\n/*    The FreeType TrueType/sfnt cmap extra information service.           */\r\n/*                                                                         */\r\n/*  Copyright 2003 by                                                      */\r\n/*  Masatake YAMATO, Redhat K.K.                                           */\r\n/*                                                                         */\r\n/*  Copyright 2003 by                                                      */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n/* Development of this service is support of\r\n   Information-technology Promotion Agency, Japan. */\r\n\r\n#ifndef __SVTTCMAP_H__\r\n#define __SVTTCMAP_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n#include FT_TRUETYPE_TABLES_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n#define FT_SERVICE_ID_TT_CMAP \"tt-cmaps\"\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_CMapInfo                                                        */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure used to store TrueType/sfnt specific cmap information  */\r\n  /*    which is not covered by the generic @FT_CharMap structure.  This   */\r\n  /*    structure can be accessed with the @FT_Get_TT_CMap_Info function.  */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    language ::                                                        */\r\n  /*      The language ID used in Mac fonts.  Definitions of values are in */\r\n  /*      freetype/ttnameid.h.                                             */\r\n  /*                                                                       */\r\n  typedef struct  TT_CMapInfo_\r\n  {\r\n    FT_ULong language;\r\n    FT_Long  format;\r\n\r\n  } TT_CMapInfo;\r\n\r\n\r\n  typedef FT_Error\r\n  (*TT_CMap_Info_GetFunc)( FT_CharMap    charmap,\r\n                           TT_CMapInfo  *cmap_info );\r\n\r\n\r\n  FT_DEFINE_SERVICE( TTCMaps )\r\n  {\r\n    TT_CMap_Info_GetFunc  get_cmap_info;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __SVTTCMAP_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svtteng.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svtteng.h                                                              */\r\n/*                                                                         */\r\n/*    The FreeType TrueType engine query service (specification).          */\r\n/*                                                                         */\r\n/*  Copyright 2006 by                                                      */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVTTENG_H__\r\n#define __SVTTENG_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n#include FT_MODULE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*\r\n   *  SFNT table loading service.\r\n   */\r\n\r\n#define FT_SERVICE_ID_TRUETYPE_ENGINE  \"truetype-engine\"\r\n\r\n  /*\r\n   * Used to implement FT_Get_TrueType_Engine_Type\r\n   */\r\n\r\n  FT_DEFINE_SERVICE( TrueTypeEngine )\r\n  {\r\n    FT_TrueTypeEngineType  engine_type;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVTTENG_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svttglyf.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svttglyf.h                                                             */\r\n/*                                                                         */\r\n/*    The FreeType TrueType glyph service.                                 */\r\n/*                                                                         */\r\n/*  Copyright 2007 by David Turner.                                        */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n#ifndef __SVTTGLYF_H__\r\n#define __SVTTGLYF_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n#include FT_TRUETYPE_TABLES_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n#define FT_SERVICE_ID_TT_GLYF \"tt-glyf\"\r\n\r\n\r\n  typedef FT_ULong\r\n  (*TT_Glyf_GetLocationFunc)( FT_Face    face,\r\n                              FT_UInt    gindex,\r\n                              FT_ULong  *psize );\r\n\r\n  FT_DEFINE_SERVICE( TTGlyf )\r\n  {\r\n    TT_Glyf_GetLocationFunc  get_location;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __SVTTGLYF_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svwinfnt.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svwinfnt.h                                                             */\r\n/*                                                                         */\r\n/*    The FreeType Windows FNT/FONT service (specification).               */\r\n/*                                                                         */\r\n/*  Copyright 2003 by                                                      */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVWINFNT_H__\r\n#define __SVWINFNT_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n#include FT_WINFONTS_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n#define FT_SERVICE_ID_WINFNT  \"winfonts\"\r\n\r\n  typedef FT_Error\r\n  (*FT_WinFnt_GetHeaderFunc)( FT_Face               face,\r\n                              FT_WinFNT_HeaderRec  *aheader );\r\n\r\n\r\n  FT_DEFINE_SERVICE( WinFnt )\r\n  {\r\n    FT_WinFnt_GetHeaderFunc  get_header;\r\n  };\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVWINFNT_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/services/svxf86nm.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  svxf86nm.h                                                             */\r\n/*                                                                         */\r\n/*    The FreeType XFree86 services (specification only).                  */\r\n/*                                                                         */\r\n/*  Copyright 2003 by                                                      */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SVXF86NM_H__\r\n#define __SVXF86NM_H__\r\n\r\n#include FT_INTERNAL_SERVICE_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*\r\n   *  A trivial service used to return the name of a face's font driver,\r\n   *  according to the XFree86 nomenclature.  Note that the service data\r\n   *  is a simple constant string pointer.\r\n   */\r\n\r\n#define FT_SERVICE_ID_XF86_NAME  \"xf86-driver-name\"\r\n\r\n#define FT_XF86_FORMAT_TRUETYPE  \"TrueType\"\r\n#define FT_XF86_FORMAT_TYPE_1    \"Type 1\"\r\n#define FT_XF86_FORMAT_BDF       \"BDF\"\r\n#define FT_XF86_FORMAT_PCF       \"PCF\"\r\n#define FT_XF86_FORMAT_TYPE_42   \"Type 42\"\r\n#define FT_XF86_FORMAT_CID       \"CID Type 1\"\r\n#define FT_XF86_FORMAT_CFF       \"CFF\"\r\n#define FT_XF86_FORMAT_PFR       \"PFR\"\r\n#define FT_XF86_FORMAT_WINFNT    \"Windows FNT\"\r\n\r\n  /* */\r\n\r\n\r\nFT_END_HEADER\r\n\r\n\r\n#endif /* __SVXF86NM_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/sfnt.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  sfnt.h                                                                 */\r\n/*                                                                         */\r\n/*    High-level `sfnt' driver interface (specification).                  */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __SFNT_H__\r\n#define __SFNT_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_INTERNAL_DRIVER_H\r\n#include FT_INTERNAL_TRUETYPE_TYPES_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Init_Face_Func                                                  */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    First part of the SFNT face object initialization.  This finds     */\r\n  /*    the face in a SFNT file or collection, and load its format tag in  */\r\n  /*    face->format_tag.                                                  */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    stream     :: The input stream.                                    */\r\n  /*                                                                       */\r\n  /*    face       :: A handle to the target face object.                  */\r\n  /*                                                                       */\r\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\r\n  /*                  collection.                                          */\r\n  /*                                                                       */\r\n  /*    num_params :: The number of additional parameters.                 */\r\n  /*                                                                       */\r\n  /*    params     :: Optional additional parameters.                      */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    The stream cursor must be at the font file's origin.               */\r\n  /*                                                                       */\r\n  /*    This function recognizes fonts embedded in a `TrueType             */\r\n  /*    collection'.                                                       */\r\n  /*                                                                       */\r\n  /*    Once the format tag has been validated by the font driver, it      */\r\n  /*    should then call the TT_Load_Face_Func() callback to read the rest */\r\n  /*    of the SFNT tables in the object.                                  */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Init_Face_Func)( FT_Stream      stream,\r\n                        TT_Face        face,\r\n                        FT_Int         face_index,\r\n                        FT_Int         num_params,\r\n                        FT_Parameter*  params );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Load_Face_Func                                                  */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Second part of the SFNT face object initialization.  This loads    */\r\n  /*    the common SFNT tables (head, OS/2, maxp, metrics, etc.) in the    */\r\n  /*    face object.                                                       */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    stream     :: The input stream.                                    */\r\n  /*                                                                       */\r\n  /*    face       :: A handle to the target face object.                  */\r\n  /*                                                                       */\r\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\r\n  /*                  collection.                                          */\r\n  /*                                                                       */\r\n  /*    num_params :: The number of additional parameters.                 */\r\n  /*                                                                       */\r\n  /*    params     :: Optional additional parameters.                      */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    This function must be called after TT_Init_Face_Func().            */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Load_Face_Func)( FT_Stream      stream,\r\n                        TT_Face        face,\r\n                        FT_Int         face_index,\r\n                        FT_Int         num_params,\r\n                        FT_Parameter*  params );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Done_Face_Func                                                  */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A callback used to delete the common SFNT data from a face.        */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face :: A handle to the target face object.                        */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    This function does NOT destroy the face object.                    */\r\n  /*                                                                       */\r\n  typedef void\r\n  (*TT_Done_Face_Func)( TT_Face  face );\r\n\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Load_SFNT_HeaderRec_Func                                        */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Loads the header of a SFNT font file.  Supports collections.       */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face       :: A handle to the target face object.                  */\r\n  /*                                                                       */\r\n  /*    stream     :: The input stream.                                    */\r\n  /*                                                                       */\r\n  /*    face_index :: The index of the TrueType font, if we are opening a  */\r\n  /*                  collection.                                          */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    sfnt       :: The SFNT header.                                     */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    The stream cursor must be at the font file's origin.               */\r\n  /*                                                                       */\r\n  /*    This function recognizes fonts embedded in a `TrueType             */\r\n  /*    collection'.                                                       */\r\n  /*                                                                       */\r\n  /*    This function checks that the header is valid by looking at the    */\r\n  /*    values of `search_range', `entry_selector', and `range_shift'.     */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Load_SFNT_HeaderRec_Func)( TT_Face      face,\r\n                                  FT_Stream    stream,\r\n                                  FT_Long      face_index,\r\n                                  SFNT_Header  sfnt );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Load_Directory_Func                                             */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Loads the table directory into a face object.                      */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face   :: A handle to the target face object.                      */\r\n  /*                                                                       */\r\n  /*    stream :: The input stream.                                        */\r\n  /*                                                                       */\r\n  /*    sfnt   :: The SFNT header.                                         */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    The stream cursor must be on the first byte after the 4-byte font  */\r\n  /*    format tag.  This is the case just after a call to                 */\r\n  /*    TT_Load_Format_Tag().                                              */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Load_Directory_Func)( TT_Face      face,\r\n                             FT_Stream    stream,\r\n                             SFNT_Header  sfnt );\r\n\r\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Load_Any_Func                                                   */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Load any font table into client memory.                            */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face   :: The face object to look for.                             */\r\n  /*                                                                       */\r\n  /*    tag    :: The tag of table to load.  Use the value 0 if you want   */\r\n  /*              to access the whole font file, else set this parameter   */\r\n  /*              to a valid TrueType table tag that you can forge with    */\r\n  /*              the MAKE_TT_TAG macro.                                   */\r\n  /*                                                                       */\r\n  /*    offset :: The starting offset in the table (or the file if         */\r\n  /*              tag == 0).                                               */\r\n  /*                                                                       */\r\n  /*    length :: The address of the decision variable:                    */\r\n  /*                                                                       */\r\n  /*                If length == NULL:                                     */\r\n  /*                  Loads the whole table.  Returns an error if          */\r\n  /*                  `offset' == 0!                                       */\r\n  /*                                                                       */\r\n  /*                If *length == 0:                                       */\r\n  /*                  Exits immediately; returning the length of the given */\r\n  /*                  table or of the font file, depending on the value of */\r\n  /*                  `tag'.                                               */\r\n  /*                                                                       */\r\n  /*                If *length != 0:                                       */\r\n  /*                  Loads the next `length' bytes of table or font,      */\r\n  /*                  starting at offset `offset' (in table or font too).  */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    buffer :: The address of target buffer.                            */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    TrueType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Load_Any_Func)( TT_Face    face,\r\n                       FT_ULong   tag,\r\n                       FT_Long    offset,\r\n                       FT_Byte   *buffer,\r\n                       FT_ULong*  length );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Find_SBit_Image_Func                                            */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Check whether an embedded bitmap (an `sbit') exists for a given    */\r\n  /*    glyph, at a given strike.                                          */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face          :: The target face object.                           */\r\n  /*                                                                       */\r\n  /*    glyph_index   :: The glyph index.                                  */\r\n  /*                                                                       */\r\n  /*    strike_index  :: The current strike index.                         */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    arange        :: The SBit range containing the glyph index.        */\r\n  /*                                                                       */\r\n  /*    astrike       :: The SBit strike containing the glyph index.       */\r\n  /*                                                                       */\r\n  /*    aglyph_offset :: The offset of the glyph data in `EBDT' table.     */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.  Returns                    */\r\n  /*    SFNT_Err_Invalid_Argument if no sbit exists for the requested      */\r\n  /*    glyph.                                                             */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Find_SBit_Image_Func)( TT_Face          face,\r\n                              FT_UInt          glyph_index,\r\n                              FT_ULong         strike_index,\r\n                              TT_SBit_Range   *arange,\r\n                              TT_SBit_Strike  *astrike,\r\n                              FT_ULong        *aglyph_offset );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Load_SBit_Metrics_Func                                          */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Get the big metrics for a given embedded bitmap.                   */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    stream      :: The input stream.                                   */\r\n  /*                                                                       */\r\n  /*    range       :: The SBit range containing the glyph.                */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    big_metrics :: A big SBit metrics structure for the glyph.         */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    The stream cursor must be positioned at the glyph's offset within  */\r\n  /*    the `EBDT' table before the call.                                  */\r\n  /*                                                                       */\r\n  /*    If the image format uses variable metrics, the stream cursor is    */\r\n  /*    positioned just after the metrics header in the `EBDT' table on    */\r\n  /*    function exit.                                                     */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Load_SBit_Metrics_Func)( FT_Stream        stream,\r\n                                TT_SBit_Range    range,\r\n                                TT_SBit_Metrics  metrics );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Load_SBit_Image_Func                                            */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Load a given glyph sbit image from the font resource.  This also   */\r\n  /*    returns its metrics.                                               */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face ::                                                            */\r\n  /*      The target face object.                                          */\r\n  /*                                                                       */\r\n  /*    strike_index ::                                                    */\r\n  /*      The strike index.                                                */\r\n  /*                                                                       */\r\n  /*    glyph_index ::                                                     */\r\n  /*      The current glyph index.                                         */\r\n  /*                                                                       */\r\n  /*    load_flags ::                                                      */\r\n  /*      The current load flags.                                          */\r\n  /*                                                                       */\r\n  /*    stream ::                                                          */\r\n  /*      The input stream.                                                */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    amap ::                                                            */\r\n  /*      The target pixmap.                                               */\r\n  /*                                                                       */\r\n  /*    ametrics ::                                                        */\r\n  /*      A big sbit metrics structure for the glyph image.                */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\r\n  /*    glyph sbit exists for the index.                                   */\r\n  /*                                                                       */\r\n  /*  <Note>                                                               */\r\n  /*    The `map.buffer' field is always freed before the glyph is loaded. */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Load_SBit_Image_Func)( TT_Face              face,\r\n                              FT_ULong             strike_index,\r\n                              FT_UInt              glyph_index,\r\n                              FT_UInt              load_flags,\r\n                              FT_Stream            stream,\r\n                              FT_Bitmap           *amap,\r\n                              TT_SBit_MetricsRec  *ametrics );\r\n\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Set_SBit_Strike_OldFunc                                         */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Select an sbit strike for a given size request.                    */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face          :: The target face object.                           */\r\n  /*                                                                       */\r\n  /*    req           :: The size request.                                 */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    astrike_index :: The index of the sbit strike.                     */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\r\n  /*    sbit strike exists for the selected ppem values.                   */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Set_SBit_Strike_OldFunc)( TT_Face    face,\r\n                                 FT_UInt    x_ppem,\r\n                                 FT_UInt    y_ppem,\r\n                                 FT_ULong*  astrike_index );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_CharMap_Load_Func                                               */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Loads a given TrueType character map into memory.                  */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face   :: A handle to the parent face object.                      */\r\n  /*                                                                       */\r\n  /*    stream :: A handle to the current stream object.                   */\r\n  /*                                                                       */\r\n  /* <InOut>                                                               */\r\n  /*    cmap   :: A pointer to a cmap object.                              */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    The function assumes that the stream is already in use (i.e.,      */\r\n  /*    opened).  In case of error, all partially allocated tables are     */\r\n  /*    released.                                                          */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_CharMap_Load_Func)( TT_Face    face,\r\n                           void*      cmap,\r\n                           FT_Stream  input );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_CharMap_Free_Func                                               */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Destroys a character mapping table.                                */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face :: A handle to the parent face object.                        */\r\n  /*                                                                       */\r\n  /*    cmap :: A handle to a cmap object.                                 */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_CharMap_Free_Func)( TT_Face       face,\r\n                           void*         cmap );\r\n\r\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Set_SBit_Strike_Func                                            */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Select an sbit strike for a given size request.                    */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face          :: The target face object.                           */\r\n  /*                                                                       */\r\n  /*    req           :: The size request.                                 */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    astrike_index :: The index of the sbit strike.                     */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\r\n  /*    sbit strike exists for the selected ppem values.                   */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Set_SBit_Strike_Func)( TT_Face          face,\r\n                              FT_Size_Request  req,\r\n                              FT_ULong*        astrike_index );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Load_Strike_Metrics_Func                                        */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Load the metrics of a given strike.                                */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face          :: The target face object.                           */\r\n  /*                                                                       */\r\n  /*    strike_index  :: The strike index.                                 */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    metrics       :: the metrics of the strike.                        */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.  Returns an error if no     */\r\n  /*    such sbit strike exists.                                           */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Load_Strike_Metrics_Func)( TT_Face           face,\r\n                                  FT_ULong          strike_index,\r\n                                  FT_Size_Metrics*  metrics );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Get_PS_Name_Func                                                */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Get the PostScript glyph name of a glyph.                          */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    idx  :: The glyph index.                                           */\r\n  /*                                                                       */\r\n  /*    PSname :: The address of a string pointer.  Will be NULL in case   */\r\n  /*              of error, otherwise it is a pointer to the glyph name.   */\r\n  /*                                                                       */\r\n  /*              You must not modify the returned string!                 */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Get_PS_Name_Func)( TT_Face      face,\r\n                          FT_UInt      idx,\r\n                          FT_String**  PSname );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Load_Metrics_Func                                               */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Load a metrics table, which is a table with a horizontal and a     */\r\n  /*    vertical version.                                                  */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face     :: A handle to the target face object.                    */\r\n  /*                                                                       */\r\n  /*    stream   :: The input stream.                                      */\r\n  /*                                                                       */\r\n  /*    vertical :: A boolean flag.  If set, load the vertical one.        */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Load_Metrics_Func)( TT_Face    face,\r\n                           FT_Stream  stream,\r\n                           FT_Bool    vertical );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Get_Metrics_Func                                                */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Load the horizontal or vertical header in a face object.           */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face     :: A handle to the target face object.                    */\r\n  /*                                                                       */\r\n  /*    stream   :: The input stream.                                      */\r\n  /*                                                                       */\r\n  /*    vertical :: A boolean flag.  If set, load vertical metrics.        */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Get_Metrics_Func)( TT_Face     face,\r\n                          FT_Bool     vertical,\r\n                          FT_UInt     gindex,\r\n                          FT_Short*   abearing,\r\n                          FT_UShort*  aadvance );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Load_Table_Func                                                 */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Load a given TrueType table.                                       */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face   :: A handle to the target face object.                      */\r\n  /*                                                                       */\r\n  /*    stream :: The input stream.                                        */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    The function uses `face->goto_table' to seek the stream to the     */\r\n  /*    start of the table, except while loading the font directory.       */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Load_Table_Func)( TT_Face    face,\r\n                         FT_Stream  stream );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Free_Table_Func                                                 */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Free a given TrueType table.                                       */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face :: A handle to the target face object.                        */\r\n  /*                                                                       */\r\n  typedef void\r\n  (*TT_Free_Table_Func)( TT_Face  face );\r\n\r\n\r\n  /*\r\n   * @functype:\r\n   *    TT_Face_GetKerningFunc\r\n   *\r\n   * @description:\r\n   *    Return the horizontal kerning value between two glyphs.\r\n   *\r\n   * @input:\r\n   *    face        :: A handle to the source face object.\r\n   *    left_glyph  :: The left glyph index.\r\n   *    right_glyph :: The right glyph index.\r\n   *\r\n   * @return:\r\n   *    The kerning value in font units.\r\n   */\r\n  typedef FT_Int\r\n  (*TT_Face_GetKerningFunc)( TT_Face  face,\r\n                             FT_UInt  left_glyph,\r\n                             FT_UInt  right_glyph );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    SFNT_Interface                                                     */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    This structure holds pointers to the functions used to load and    */\r\n  /*    free the basic tables that are required in a `sfnt' font file.     */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    Check the various xxx_Func() descriptions for details.             */\r\n  /*                                                                       */\r\n  typedef struct  SFNT_Interface_\r\n  {\r\n    TT_Loader_GotoTableFunc      goto_table;\r\n\r\n    TT_Init_Face_Func            init_face;\r\n    TT_Load_Face_Func            load_face;\r\n    TT_Done_Face_Func            done_face;\r\n    FT_Module_Requester          get_interface;\r\n\r\n    TT_Load_Any_Func             load_any;\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    TT_Load_SFNT_HeaderRec_Func  load_sfnt_header;\r\n    TT_Load_Directory_Func       load_directory;\r\n#endif\r\n\r\n    /* these functions are called by `load_face' but they can also  */\r\n    /* be called from external modules, if there is a need to do so */\r\n    TT_Load_Table_Func           load_head;\r\n    TT_Load_Metrics_Func         load_hhea;\r\n    TT_Load_Table_Func           load_cmap;\r\n    TT_Load_Table_Func           load_maxp;\r\n    TT_Load_Table_Func           load_os2;\r\n    TT_Load_Table_Func           load_post;\r\n\r\n    TT_Load_Table_Func           load_name;\r\n    TT_Free_Table_Func           free_name;\r\n\r\n    /* optional tables */\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    TT_Load_Table_Func           load_hdmx_stub;\r\n    TT_Free_Table_Func           free_hdmx_stub;\r\n#endif\r\n\r\n    /* this field was called `load_kerning' up to version 2.1.10 */\r\n    TT_Load_Table_Func           load_kern;\r\n\r\n    TT_Load_Table_Func           load_gasp;\r\n    TT_Load_Table_Func           load_pclt;\r\n\r\n    /* see `ttload.h'; this field was called `load_bitmap_header' up to */\r\n    /* version 2.1.10                                                   */\r\n    TT_Load_Table_Func           load_bhed;\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n\r\n    /* see `ttsbit.h' */\r\n    TT_Set_SBit_Strike_OldFunc   set_sbit_strike_stub;\r\n    TT_Load_Table_Func           load_sbits_stub;\r\n\r\n    /*\r\n     *  The following two fields appeared in version 2.1.8, and were placed\r\n     *  between `load_sbits' and `load_sbit_image'.  We support them as a\r\n     *  special exception since they are used by Xfont library within the\r\n     *  X.Org xserver, and because the probability that other rogue clients\r\n     *  use the other version 2.1.7 fields below is _extremely_ low.\r\n     *\r\n     *  Note that this forces us to disable an interesting memory-saving\r\n     *  optimization though...\r\n     */\r\n\r\n    TT_Find_SBit_Image_Func      find_sbit_image;\r\n    TT_Load_SBit_Metrics_Func    load_sbit_metrics;\r\n\r\n#endif\r\n\r\n    TT_Load_SBit_Image_Func      load_sbit_image;\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    TT_Free_Table_Func           free_sbits_stub;\r\n#endif\r\n\r\n    /* see `ttpost.h' */\r\n    TT_Get_PS_Name_Func          get_psname;\r\n    TT_Free_Table_Func           free_psnames;\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    TT_CharMap_Load_Func         load_charmap_stub;\r\n    TT_CharMap_Free_Func         free_charmap_stub;\r\n#endif\r\n\r\n    /* starting here, the structure differs from version 2.1.7 */\r\n\r\n    /* this field was introduced in version 2.1.8, named `get_psname' */\r\n    TT_Face_GetKerningFunc       get_kerning;\r\n\r\n    /* new elements introduced after version 2.1.10 */\r\n\r\n    /* load the font directory, i.e., the offset table and */\r\n    /* the table directory                                 */\r\n    TT_Load_Table_Func           load_font_dir;\r\n    TT_Load_Metrics_Func         load_hmtx;\r\n\r\n    TT_Load_Table_Func           load_eblc;\r\n    TT_Free_Table_Func           free_eblc;\r\n\r\n    TT_Set_SBit_Strike_Func      set_sbit_strike;\r\n    TT_Load_Strike_Metrics_Func  load_strike_metrics;\r\n\r\n    TT_Get_Metrics_Func          get_metrics;\r\n\r\n  } SFNT_Interface;\r\n\r\n\r\n  /* transitional */\r\n  typedef SFNT_Interface*   SFNT_Service;\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __SFNT_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/t1types.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  t1types.h                                                              */\r\n/*                                                                         */\r\n/*    Basic Type1/Type2 type definitions and interface (specification      */\r\n/*    only).                                                               */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2006 by                         */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __T1TYPES_H__\r\n#define __T1TYPES_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_TYPE1_TABLES_H\r\n#include FT_INTERNAL_POSTSCRIPT_HINTS_H\r\n#include FT_INTERNAL_SERVICE_H\r\n#include FT_SERVICE_POSTSCRIPT_CMAPS_H\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***              REQUIRED TYPE1/TYPE2 TABLES DEFINITIONS              ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    T1_EncodingRec                                                     */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure modeling a custom encoding.                            */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    num_chars  :: The number of character codes in the encoding.       */\r\n  /*                  Usually 256.                                         */\r\n  /*                                                                       */\r\n  /*    code_first :: The lowest valid character code in the encoding.     */\r\n  /*                                                                       */\r\n  /*    code_last  :: The highest valid character code in the encoding.    */\r\n  /*                                                                       */\r\n  /*    char_index :: An array of corresponding glyph indices.             */\r\n  /*                                                                       */\r\n  /*    char_name  :: An array of corresponding glyph names.               */\r\n  /*                                                                       */\r\n  typedef struct  T1_EncodingRecRec_\r\n  {\r\n    FT_Int       num_chars;\r\n    FT_Int       code_first;\r\n    FT_Int       code_last;\r\n\r\n    FT_UShort*   char_index;\r\n    FT_String**  char_name;\r\n\r\n  } T1_EncodingRec, *T1_Encoding;\r\n\r\n\r\n  typedef enum  T1_EncodingType_\r\n  {\r\n    T1_ENCODING_TYPE_NONE = 0,\r\n    T1_ENCODING_TYPE_ARRAY,\r\n    T1_ENCODING_TYPE_STANDARD,\r\n    T1_ENCODING_TYPE_ISOLATIN1,\r\n    T1_ENCODING_TYPE_EXPERT\r\n\r\n  } T1_EncodingType;\r\n\r\n\r\n  typedef struct  T1_FontRec_\r\n  {\r\n    PS_FontInfoRec   font_info;         /* font info dictionary */\r\n    PS_PrivateRec    private_dict;      /* private dictionary   */\r\n    FT_String*       font_name;         /* top-level dictionary */\r\n\r\n    T1_EncodingType  encoding_type;\r\n    T1_EncodingRec   encoding;\r\n\r\n    FT_Byte*         subrs_block;\r\n    FT_Byte*         charstrings_block;\r\n    FT_Byte*         glyph_names_block;\r\n\r\n    FT_Int           num_subrs;\r\n    FT_Byte**        subrs;\r\n    FT_PtrDist*      subrs_len;\r\n\r\n    FT_Int           num_glyphs;\r\n    FT_String**      glyph_names;       /* array of glyph names       */\r\n    FT_Byte**        charstrings;       /* array of glyph charstrings */\r\n    FT_PtrDist*      charstrings_len;\r\n\r\n    FT_Byte          paint_type;\r\n    FT_Byte          font_type;\r\n    FT_Matrix        font_matrix;\r\n    FT_Vector        font_offset;\r\n    FT_BBox          font_bbox;\r\n    FT_Long          font_id;\r\n\r\n    FT_Fixed         stroke_width;\r\n\r\n  } T1_FontRec, *T1_Font;\r\n\r\n\r\n  typedef struct  CID_SubrsRec_\r\n  {\r\n    FT_UInt    num_subrs;\r\n    FT_Byte**  code;\r\n\r\n  } CID_SubrsRec, *CID_Subrs;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***                AFM FONT INFORMATION STRUCTURES                    ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  typedef struct  AFM_TrackKernRec_\r\n  {\r\n    FT_Int    degree;\r\n    FT_Fixed  min_ptsize;\r\n    FT_Fixed  min_kern;\r\n    FT_Fixed  max_ptsize;\r\n    FT_Fixed  max_kern;\r\n\r\n  } AFM_TrackKernRec, *AFM_TrackKern;\r\n\r\n  typedef struct  AFM_KernPairRec_\r\n  {\r\n    FT_Int  index1;\r\n    FT_Int  index2;\r\n    FT_Int  x;\r\n    FT_Int  y;\r\n\r\n  } AFM_KernPairRec, *AFM_KernPair;\r\n\r\n  typedef struct  AFM_FontInfoRec_\r\n  {\r\n    FT_Bool        IsCIDFont;\r\n    FT_BBox        FontBBox;\r\n    FT_Fixed       Ascender;\r\n    FT_Fixed       Descender;\r\n    AFM_TrackKern  TrackKerns;   /* free if non-NULL */\r\n    FT_Int         NumTrackKern;\r\n    AFM_KernPair   KernPairs;    /* free if non-NULL */\r\n    FT_Int         NumKernPair;\r\n\r\n  } AFM_FontInfoRec, *AFM_FontInfo;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***                ORIGINAL T1_FACE CLASS DEFINITION                  ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  typedef struct T1_FaceRec_*   T1_Face;\r\n  typedef struct CID_FaceRec_*  CID_Face;\r\n\r\n\r\n  typedef struct  T1_FaceRec_\r\n  {\r\n    FT_FaceRec      root;\r\n    T1_FontRec      type1;\r\n    const void*     psnames;\r\n    const void*     psaux;\r\n    const void*     afm_data;\r\n    FT_CharMapRec   charmaprecs[2];\r\n    FT_CharMap      charmaps[2];\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    PS_Unicodes     unicode_map;\r\n#endif\r\n\r\n    /* support for Multiple Masters fonts */\r\n    PS_Blend        blend;\r\n\r\n    /* undocumented, optional: indices of subroutines that express      */\r\n    /* the NormalizeDesignVector and the ConvertDesignVector procedure, */\r\n    /* respectively, as Type 2 charstrings; -1 if keywords not present  */\r\n    FT_Int           ndv_idx;\r\n    FT_Int           cdv_idx;\r\n\r\n    /* undocumented, optional: has the same meaning as len_buildchar */\r\n    /* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25    */\r\n    FT_UInt          len_buildchar;\r\n    FT_Int*          buildchar;\r\n\r\n    /* since version 2.1 - interface to PostScript hinter */\r\n    const void*     pshinter;\r\n\r\n  } T1_FaceRec;\r\n\r\n\r\n  typedef struct  CID_FaceRec_\r\n  {\r\n    FT_FaceRec       root;\r\n    void*            psnames;\r\n    void*            psaux;\r\n    CID_FaceInfoRec  cid;\r\n    void*            afm_data;\r\n    CID_Subrs        subrs;\r\n\r\n    /* since version 2.1 - interface to PostScript hinter */\r\n    void*            pshinter;\r\n\r\n    /* since version 2.1.8, but was originally positioned after `afm_data' */\r\n    FT_Byte*         binary_data; /* used if hex data has been converted */\r\n    FT_Stream        cid_stream;\r\n\r\n  } CID_FaceRec;\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __T1TYPES_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/internal/tttypes.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  tttypes.h                                                              */\r\n/*                                                                         */\r\n/*    Basic SFNT/TrueType type definitions and interface (specification    */\r\n/*    only).                                                               */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2002, 2004, 2005, 2006, 2007 by                   */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n#ifndef __TTTYPES_H__\r\n#define __TTTYPES_H__\r\n\r\n\r\n#include <ft2build.h>\r\n#include FT_TRUETYPE_TABLES_H\r\n#include FT_INTERNAL_OBJECTS_H\r\n\r\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\r\n#include FT_MULTIPLE_MASTERS_H\r\n#endif\r\n\r\n\r\nFT_BEGIN_HEADER\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***             REQUIRED TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TTC_HeaderRec                                                      */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    TrueType collection header.  This table contains the offsets of    */\r\n  /*    the font headers of each distinct TrueType face in the file.       */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    tag     :: Must be `ttc ' to indicate a TrueType collection.       */\r\n  /*                                                                       */\r\n  /*    version :: The version number.                                     */\r\n  /*                                                                       */\r\n  /*    count   :: The number of faces in the collection.  The             */\r\n  /*               specification says this should be an unsigned long, but */\r\n  /*               we use a signed long since we need the value -1 for     */\r\n  /*               specific purposes.                                      */\r\n  /*                                                                       */\r\n  /*    offsets :: The offsets of the font headers, one per face.          */\r\n  /*                                                                       */\r\n  typedef struct  TTC_HeaderRec_\r\n  {\r\n    FT_ULong   tag;\r\n    FT_Fixed   version;\r\n    FT_Long    count;\r\n    FT_ULong*  offsets;\r\n\r\n  } TTC_HeaderRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    SFNT_HeaderRec                                                     */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    SFNT file format header.                                           */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    format_tag     :: The font format tag.                             */\r\n  /*                                                                       */\r\n  /*    num_tables     :: The number of tables in file.                    */\r\n  /*                                                                       */\r\n  /*    search_range   :: Must be `16 * (max power of 2 <= num_tables)'.   */\r\n  /*                                                                       */\r\n  /*    entry_selector :: Must be log2 of `search_range / 16'.             */\r\n  /*                                                                       */\r\n  /*    range_shift    :: Must be `num_tables * 16 - search_range'.        */\r\n  /*                                                                       */\r\n  typedef struct  SFNT_HeaderRec_\r\n  {\r\n    FT_ULong   format_tag;\r\n    FT_UShort  num_tables;\r\n    FT_UShort  search_range;\r\n    FT_UShort  entry_selector;\r\n    FT_UShort  range_shift;\r\n\r\n    FT_ULong   offset;  /* not in file */\r\n\r\n  } SFNT_HeaderRec, *SFNT_Header;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_TableRec                                                        */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    This structure describes a given table of a TrueType font.         */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    Tag      :: A four-bytes tag describing the table.                 */\r\n  /*                                                                       */\r\n  /*    CheckSum :: The table checksum.  This value can be ignored.        */\r\n  /*                                                                       */\r\n  /*    Offset   :: The offset of the table from the start of the TrueType */\r\n  /*                font in its resource.                                  */\r\n  /*                                                                       */\r\n  /*    Length   :: The table length (in bytes).                           */\r\n  /*                                                                       */\r\n  typedef struct  TT_TableRec_\r\n  {\r\n    FT_ULong  Tag;        /*        table type */\r\n    FT_ULong  CheckSum;   /*    table checksum */\r\n    FT_ULong  Offset;     /* table file offset */\r\n    FT_ULong  Length;     /*      table length */\r\n\r\n  } TT_TableRec, *TT_Table;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_LongMetricsRec                                                  */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure modeling the long metrics of the `hmtx' and `vmtx'     */\r\n  /*    TrueType tables.  The values are expressed in font units.          */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    advance :: The advance width or height for the glyph.              */\r\n  /*                                                                       */\r\n  /*    bearing :: The left-side or top-side bearing for the glyph.        */\r\n  /*                                                                       */\r\n  typedef struct  TT_LongMetricsRec_\r\n  {\r\n    FT_UShort  advance;\r\n    FT_Short   bearing;\r\n\r\n  } TT_LongMetricsRec, *TT_LongMetrics;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Type>                                                                */\r\n  /*    TT_ShortMetrics                                                    */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A simple type to model the short metrics of the `hmtx' and `vmtx'  */\r\n  /*    tables.                                                            */\r\n  /*                                                                       */\r\n  typedef FT_Short  TT_ShortMetrics;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_NameEntryRec                                                    */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure modeling TrueType name records.  Name records are used */\r\n  /*    to store important strings like family name, style name,           */\r\n  /*    copyright, etc. in _localized_ versions (i.e., language, encoding, */\r\n  /*    etc).                                                              */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    platformID   :: The ID of the name's encoding platform.            */\r\n  /*                                                                       */\r\n  /*    encodingID   :: The platform-specific ID for the name's encoding.  */\r\n  /*                                                                       */\r\n  /*    languageID   :: The platform-specific ID for the name's language.  */\r\n  /*                                                                       */\r\n  /*    nameID       :: The ID specifying what kind of name this is.       */\r\n  /*                                                                       */\r\n  /*    stringLength :: The length of the string in bytes.                 */\r\n  /*                                                                       */\r\n  /*    stringOffset :: The offset to the string in the `name' table.      */\r\n  /*                                                                       */\r\n  /*    string       :: A pointer to the string's bytes.  Note that these  */\r\n  /*                    are usually UTF-16 encoded characters.             */\r\n  /*                                                                       */\r\n  typedef struct  TT_NameEntryRec_\r\n  {\r\n    FT_UShort  platformID;\r\n    FT_UShort  encodingID;\r\n    FT_UShort  languageID;\r\n    FT_UShort  nameID;\r\n    FT_UShort  stringLength;\r\n    FT_ULong   stringOffset;\r\n\r\n    /* this last field is not defined in the spec */\r\n    /* but used by the FreeType engine            */\r\n\r\n    FT_Byte*   string;\r\n\r\n  } TT_NameEntryRec, *TT_NameEntry;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_NameTableRec                                                    */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure modeling the TrueType name table.                      */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    format         :: The format of the name table.                    */\r\n  /*                                                                       */\r\n  /*    numNameRecords :: The number of names in table.                    */\r\n  /*                                                                       */\r\n  /*    storageOffset  :: The offset of the name table in the `name'       */\r\n  /*                      TrueType table.                                  */\r\n  /*                                                                       */\r\n  /*    names          :: An array of name records.                        */\r\n  /*                                                                       */\r\n  /*    stream         :: the file's input stream.                         */\r\n  /*                                                                       */\r\n  typedef struct  TT_NameTableRec_\r\n  {\r\n    FT_UShort         format;\r\n    FT_UInt           numNameRecords;\r\n    FT_UInt           storageOffset;\r\n    TT_NameEntryRec*  names;\r\n    FT_Stream         stream;\r\n\r\n  } TT_NameTableRec, *TT_NameTable;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***             OPTIONAL TRUETYPE/OPENTYPE TABLES DEFINITIONS         ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_GaspRangeRec                                                    */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A tiny structure used to model a gasp range according to the       */\r\n  /*    TrueType specification.                                            */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    maxPPEM  :: The maximum ppem value to which `gaspFlag' applies.    */\r\n  /*                                                                       */\r\n  /*    gaspFlag :: A flag describing the grid-fitting and anti-aliasing   */\r\n  /*                modes to be used.                                      */\r\n  /*                                                                       */\r\n  typedef struct  TT_GaspRangeRec_\r\n  {\r\n    FT_UShort  maxPPEM;\r\n    FT_UShort  gaspFlag;\r\n\r\n  } TT_GaspRangeRec, *TT_GaspRange;\r\n\r\n\r\n#define TT_GASP_GRIDFIT  0x01\r\n#define TT_GASP_DOGRAY   0x02\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_GaspRec                                                         */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure modeling the TrueType `gasp' table used to specify     */\r\n  /*    grid-fitting and anti-aliasing behaviour.                          */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    version    :: The version number.                                  */\r\n  /*                                                                       */\r\n  /*    numRanges  :: The number of gasp ranges in table.                  */\r\n  /*                                                                       */\r\n  /*    gaspRanges :: An array of gasp ranges.                             */\r\n  /*                                                                       */\r\n  typedef struct  TT_Gasp_\r\n  {\r\n    FT_UShort     version;\r\n    FT_UShort     numRanges;\r\n    TT_GaspRange  gaspRanges;\r\n\r\n  } TT_GaspRec;\r\n\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_HdmxEntryRec                                                    */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A small structure used to model the pre-computed widths of a given */\r\n  /*    size.  They are found in the `hdmx' table.                         */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    ppem      :: The pixels per EM value at which these metrics apply. */\r\n  /*                                                                       */\r\n  /*    max_width :: The maximum advance width for this metric.            */\r\n  /*                                                                       */\r\n  /*    widths    :: An array of widths.  Note: These are 8-bit bytes.     */\r\n  /*                                                                       */\r\n  typedef struct  TT_HdmxEntryRec_\r\n  {\r\n    FT_Byte   ppem;\r\n    FT_Byte   max_width;\r\n    FT_Byte*  widths;\r\n\r\n  } TT_HdmxEntryRec, *TT_HdmxEntry;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_HdmxRec                                                         */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure used to model the `hdmx' table, which contains         */\r\n  /*    pre-computed widths for a set of given sizes/dimensions.           */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    version     :: The version number.                                 */\r\n  /*                                                                       */\r\n  /*    num_records :: The number of hdmx records.                         */\r\n  /*                                                                       */\r\n  /*    records     :: An array of hdmx records.                           */\r\n  /*                                                                       */\r\n  typedef struct  TT_HdmxRec_\r\n  {\r\n    FT_UShort     version;\r\n    FT_Short      num_records;\r\n    TT_HdmxEntry  records;\r\n\r\n  } TT_HdmxRec, *TT_Hdmx;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_Kern0_PairRec                                                   */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure used to model a kerning pair for the kerning table     */\r\n  /*    format 0.  The engine now loads this table if it finds one in the  */\r\n  /*    font file.                                                         */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    left  :: The index of the left glyph in pair.                      */\r\n  /*                                                                       */\r\n  /*    right :: The index of the right glyph in pair.                     */\r\n  /*                                                                       */\r\n  /*    value :: The kerning distance.  A positive value spaces the        */\r\n  /*             glyphs, a negative one makes them closer.                 */\r\n  /*                                                                       */\r\n  typedef struct  TT_Kern0_PairRec_\r\n  {\r\n    FT_UShort  left;   /* index of left  glyph in pair */\r\n    FT_UShort  right;  /* index of right glyph in pair */\r\n    FT_FWord   value;  /* kerning value                */\r\n\r\n  } TT_Kern0_PairRec, *TT_Kern0_Pair;\r\n\r\n#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***                    EMBEDDED BITMAPS SUPPORT                       ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_SBit_MetricsRec                                                 */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure used to hold the big metrics of a given glyph bitmap   */\r\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\r\n  /*    `EBDT' (Microsoft) or `bloc' (Apple) table.                        */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    height       :: The glyph height in pixels.                        */\r\n  /*                                                                       */\r\n  /*    width        :: The glyph width in pixels.                         */\r\n  /*                                                                       */\r\n  /*    horiBearingX :: The horizontal left bearing.                       */\r\n  /*                                                                       */\r\n  /*    horiBearingY :: The horizontal top bearing.                        */\r\n  /*                                                                       */\r\n  /*    horiAdvance  :: The horizontal advance.                            */\r\n  /*                                                                       */\r\n  /*    vertBearingX :: The vertical left bearing.                         */\r\n  /*                                                                       */\r\n  /*    vertBearingY :: The vertical top bearing.                          */\r\n  /*                                                                       */\r\n  /*    vertAdvance  :: The vertical advance.                              */\r\n  /*                                                                       */\r\n  typedef struct  TT_SBit_MetricsRec_\r\n  {\r\n    FT_Byte  height;\r\n    FT_Byte  width;\r\n\r\n    FT_Char  horiBearingX;\r\n    FT_Char  horiBearingY;\r\n    FT_Byte  horiAdvance;\r\n\r\n    FT_Char  vertBearingX;\r\n    FT_Char  vertBearingY;\r\n    FT_Byte  vertAdvance;\r\n\r\n  } TT_SBit_MetricsRec, *TT_SBit_Metrics;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_SBit_SmallMetricsRec                                            */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure used to hold the small metrics of a given glyph bitmap */\r\n  /*    in a TrueType or OpenType font.  These are usually found in the    */\r\n  /*    `EBDT' (Microsoft) or the `bdat' (Apple) table.                    */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    height   :: The glyph height in pixels.                            */\r\n  /*                                                                       */\r\n  /*    width    :: The glyph width in pixels.                             */\r\n  /*                                                                       */\r\n  /*    bearingX :: The left-side bearing.                                 */\r\n  /*                                                                       */\r\n  /*    bearingY :: The top-side bearing.                                  */\r\n  /*                                                                       */\r\n  /*    advance  :: The advance width or height.                           */\r\n  /*                                                                       */\r\n  typedef struct  TT_SBit_Small_Metrics_\r\n  {\r\n    FT_Byte  height;\r\n    FT_Byte  width;\r\n\r\n    FT_Char  bearingX;\r\n    FT_Char  bearingY;\r\n    FT_Byte  advance;\r\n\r\n  } TT_SBit_SmallMetricsRec, *TT_SBit_SmallMetrics;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_SBit_LineMetricsRec                                             */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure used to describe the text line metrics of a given      */\r\n  /*    bitmap strike, for either a horizontal or vertical layout.         */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    ascender                :: The ascender in pixels.                 */\r\n  /*                                                                       */\r\n  /*    descender               :: The descender in pixels.                */\r\n  /*                                                                       */\r\n  /*    max_width               :: The maximum glyph width in pixels.      */\r\n  /*                                                                       */\r\n  /*    caret_slope_enumerator  :: Rise of the caret slope, typically set  */\r\n  /*                               to 1 for non-italic fonts.              */\r\n  /*                                                                       */\r\n  /*    caret_slope_denominator :: Rise of the caret slope, typically set  */\r\n  /*                               to 0 for non-italic fonts.              */\r\n  /*                                                                       */\r\n  /*    caret_offset            :: Offset in pixels to move the caret for  */\r\n  /*                               proper positioning.                     */\r\n  /*                                                                       */\r\n  /*    min_origin_SB           :: Minimum of horiBearingX (resp.          */\r\n  /*                               vertBearingY).                          */\r\n  /*    min_advance_SB          :: Minimum of                              */\r\n  /*                                                                       */\r\n  /*                                 horizontal advance -                  */\r\n  /*                                   ( horiBearingX + width )            */\r\n  /*                                                                       */\r\n  /*                               resp.                                   */\r\n  /*                                                                       */\r\n  /*                                 vertical advance -                    */\r\n  /*                                   ( vertBearingY + height )           */\r\n  /*                                                                       */\r\n  /*    max_before_BL           :: Maximum of horiBearingY (resp.          */\r\n  /*                               vertBearingY).                          */\r\n  /*                                                                       */\r\n  /*    min_after_BL            :: Minimum of                              */\r\n  /*                                                                       */\r\n  /*                                 horiBearingY - height                 */\r\n  /*                                                                       */\r\n  /*                               resp.                                   */\r\n  /*                                                                       */\r\n  /*                                 vertBearingX - width                  */\r\n  /*                                                                       */\r\n  /*    pads                    :: Unused (to make the size of the record  */\r\n  /*                               a multiple of 32 bits.                  */\r\n  /*                                                                       */\r\n  typedef struct  TT_SBit_LineMetricsRec_\r\n  {\r\n    FT_Char  ascender;\r\n    FT_Char  descender;\r\n    FT_Byte  max_width;\r\n    FT_Char  caret_slope_numerator;\r\n    FT_Char  caret_slope_denominator;\r\n    FT_Char  caret_offset;\r\n    FT_Char  min_origin_SB;\r\n    FT_Char  min_advance_SB;\r\n    FT_Char  max_before_BL;\r\n    FT_Char  min_after_BL;\r\n    FT_Char  pads[2];\r\n\r\n  } TT_SBit_LineMetricsRec, *TT_SBit_LineMetrics;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_SBit_RangeRec                                                   */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A TrueType/OpenType subIndexTable as defined in the `EBLC'         */\r\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    first_glyph   :: The first glyph index in the range.               */\r\n  /*                                                                       */\r\n  /*    last_glyph    :: The last glyph index in the range.                */\r\n  /*                                                                       */\r\n  /*    index_format  :: The format of index table.  Valid values are 1    */\r\n  /*                     to 5.                                             */\r\n  /*                                                                       */\r\n  /*    image_format  :: The format of `EBDT' image data.                  */\r\n  /*                                                                       */\r\n  /*    image_offset  :: The offset to image data in `EBDT'.               */\r\n  /*                                                                       */\r\n  /*    image_size    :: For index formats 2 and 5.  This is the size in   */\r\n  /*                     bytes of each glyph bitmap.                       */\r\n  /*                                                                       */\r\n  /*    big_metrics   :: For index formats 2 and 5.  This is the big       */\r\n  /*                     metrics for each glyph bitmap.                    */\r\n  /*                                                                       */\r\n  /*    num_glyphs    :: For index formats 4 and 5.  This is the number of */\r\n  /*                     glyphs in the code array.                         */\r\n  /*                                                                       */\r\n  /*    glyph_offsets :: For index formats 1 and 3.                        */\r\n  /*                                                                       */\r\n  /*    glyph_codes   :: For index formats 4 and 5.                        */\r\n  /*                                                                       */\r\n  /*    table_offset  :: The offset of the index table in the `EBLC'       */\r\n  /*                     table.  Only used during strike loading.          */\r\n  /*                                                                       */\r\n  typedef struct  TT_SBit_RangeRec\r\n  {\r\n    FT_UShort           first_glyph;\r\n    FT_UShort           last_glyph;\r\n\r\n    FT_UShort           index_format;\r\n    FT_UShort           image_format;\r\n    FT_ULong            image_offset;\r\n\r\n    FT_ULong            image_size;\r\n    TT_SBit_MetricsRec  metrics;\r\n    FT_ULong            num_glyphs;\r\n\r\n    FT_ULong*           glyph_offsets;\r\n    FT_UShort*          glyph_codes;\r\n\r\n    FT_ULong            table_offset;\r\n\r\n  } TT_SBit_RangeRec, *TT_SBit_Range;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_SBit_StrikeRec                                                  */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure used describe a given bitmap strike in the `EBLC'      */\r\n  /*    (Microsoft) or `bloc' (Apple) tables.                              */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*   num_index_ranges :: The number of index ranges.                     */\r\n  /*                                                                       */\r\n  /*   index_ranges     :: An array of glyph index ranges.                 */\r\n  /*                                                                       */\r\n  /*   color_ref        :: Unused.  `color_ref' is put in for future       */\r\n  /*                       enhancements, but these fields are already      */\r\n  /*                       in use by other platforms (e.g. Newton).        */\r\n  /*                       For details, please see                         */\r\n  /*                                                                       */\r\n  /*                         http://fonts.apple.com/                       */\r\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\r\n  /*                                                                       */\r\n  /*   hori             :: The line metrics for horizontal layouts.        */\r\n  /*                                                                       */\r\n  /*   vert             :: The line metrics for vertical layouts.          */\r\n  /*                                                                       */\r\n  /*   start_glyph      :: The lowest glyph index for this strike.         */\r\n  /*                                                                       */\r\n  /*   end_glyph        :: The highest glyph index for this strike.        */\r\n  /*                                                                       */\r\n  /*   x_ppem           :: The number of horizontal pixels per EM.         */\r\n  /*                                                                       */\r\n  /*   y_ppem           :: The number of vertical pixels per EM.           */\r\n  /*                                                                       */\r\n  /*   bit_depth        :: The bit depth.  Valid values are 1, 2, 4,       */\r\n  /*                       and 8.                                          */\r\n  /*                                                                       */\r\n  /*   flags            :: Is this a vertical or horizontal strike?  For   */\r\n  /*                       details, please see                             */\r\n  /*                                                                       */\r\n  /*                         http://fonts.apple.com/                       */\r\n  /*                                TTRefMan/RM06/Chap6bloc.html           */\r\n  /*                                                                       */\r\n  typedef struct  TT_SBit_StrikeRec_\r\n  {\r\n    FT_Int                  num_ranges;\r\n    TT_SBit_Range           sbit_ranges;\r\n    FT_ULong                ranges_offset;\r\n\r\n    FT_ULong                color_ref;\r\n\r\n    TT_SBit_LineMetricsRec  hori;\r\n    TT_SBit_LineMetricsRec  vert;\r\n\r\n    FT_UShort               start_glyph;\r\n    FT_UShort               end_glyph;\r\n\r\n    FT_Byte                 x_ppem;\r\n    FT_Byte                 y_ppem;\r\n\r\n    FT_Byte                 bit_depth;\r\n    FT_Char                 flags;\r\n\r\n  } TT_SBit_StrikeRec, *TT_SBit_Strike;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_SBit_ComponentRec                                               */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A simple structure to describe a compound sbit element.            */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    glyph_code :: The element's glyph index.                           */\r\n  /*                                                                       */\r\n  /*    x_offset   :: The element's left bearing.                          */\r\n  /*                                                                       */\r\n  /*    y_offset   :: The element's top bearing.                           */\r\n  /*                                                                       */\r\n  typedef struct  TT_SBit_ComponentRec_\r\n  {\r\n    FT_UShort  glyph_code;\r\n    FT_Char    x_offset;\r\n    FT_Char    y_offset;\r\n\r\n  } TT_SBit_ComponentRec, *TT_SBit_Component;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_SBit_ScaleRec                                                   */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A structure used describe a given bitmap scaling table, as defined */\r\n  /*    in the `EBSC' table.                                               */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    hori              :: The horizontal line metrics.                  */\r\n  /*                                                                       */\r\n  /*    vert              :: The vertical line metrics.                    */\r\n  /*                                                                       */\r\n  /*    x_ppem            :: The number of horizontal pixels per EM.       */\r\n  /*                                                                       */\r\n  /*    y_ppem            :: The number of vertical pixels per EM.         */\r\n  /*                                                                       */\r\n  /*    x_ppem_substitute :: Substitution x_ppem value.                    */\r\n  /*                                                                       */\r\n  /*    y_ppem_substitute :: Substitution y_ppem value.                    */\r\n  /*                                                                       */\r\n  typedef struct  TT_SBit_ScaleRec_\r\n  {\r\n    TT_SBit_LineMetricsRec  hori;\r\n    TT_SBit_LineMetricsRec  vert;\r\n\r\n    FT_Byte                 x_ppem;\r\n    FT_Byte                 y_ppem;\r\n\r\n    FT_Byte                 x_ppem_substitute;\r\n    FT_Byte                 y_ppem_substitute;\r\n\r\n  } TT_SBit_ScaleRec, *TT_SBit_Scale;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***                  POSTSCRIPT GLYPH NAMES SUPPORT                   ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_Post_20Rec                                                      */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Postscript names sub-table, format 2.0.  Stores the PS name of     */\r\n  /*    each glyph in the font face.                                       */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    num_glyphs    :: The number of named glyphs in the table.          */\r\n  /*                                                                       */\r\n  /*    num_names     :: The number of PS names stored in the table.       */\r\n  /*                                                                       */\r\n  /*    glyph_indices :: The indices of the glyphs in the names arrays.    */\r\n  /*                                                                       */\r\n  /*    glyph_names   :: The PS names not in Mac Encoding.                 */\r\n  /*                                                                       */\r\n  typedef struct  TT_Post_20Rec_\r\n  {\r\n    FT_UShort   num_glyphs;\r\n    FT_UShort   num_names;\r\n    FT_UShort*  glyph_indices;\r\n    FT_Char**   glyph_names;\r\n\r\n  } TT_Post_20Rec, *TT_Post_20;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_Post_25Rec                                                      */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Postscript names sub-table, format 2.5.  Stores the PS name of     */\r\n  /*    each glyph in the font face.                                       */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    num_glyphs :: The number of glyphs in the table.                   */\r\n  /*                                                                       */\r\n  /*    offsets    :: An array of signed offsets in a normal Mac           */\r\n  /*                  Postscript name encoding.                            */\r\n  /*                                                                       */\r\n  typedef struct  TT_Post_25_\r\n  {\r\n    FT_UShort  num_glyphs;\r\n    FT_Char*   offsets;\r\n\r\n  } TT_Post_25Rec, *TT_Post_25;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_Post_NamesRec                                                   */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Postscript names table, either format 2.0 or 2.5.                  */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    loaded    :: A flag to indicate whether the PS names are loaded.   */\r\n  /*                                                                       */\r\n  /*    format_20 :: The sub-table used for format 2.0.                    */\r\n  /*                                                                       */\r\n  /*    format_25 :: The sub-table used for format 2.5.                    */\r\n  /*                                                                       */\r\n  typedef struct  TT_Post_NamesRec_\r\n  {\r\n    FT_Bool  loaded;\r\n\r\n    union\r\n    {\r\n      TT_Post_20Rec  format_20;\r\n      TT_Post_25Rec  format_25;\r\n\r\n    } names;\r\n\r\n  } TT_Post_NamesRec, *TT_Post_Names;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***                    GX VARIATION TABLE SUPPORT                     ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\r\n  typedef struct GX_BlendRec_  *GX_Blend;\r\n#endif\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***              EMBEDDED BDF PROPERTIES TABLE SUPPORT                ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n  /*\r\n   * These types are used to support a `BDF ' table that isn't part of the\r\n   * official TrueType specification.  It is mainly used in SFNT-based\r\n   * bitmap fonts that were generated from a set of BDF fonts.\r\n   *\r\n   * The format of the table is as follows.\r\n   *\r\n   *   USHORT   version      `BDF ' table version number, should be 0x0001.\r\n   *   USHORT   strikeCount  Number of strikes (bitmap sizes) in this table.\r\n   *   ULONG    stringTable  Offset (from start of BDF table) to string\r\n   *                         table.\r\n   *\r\n   * This is followed by an array of `strikeCount' descriptors, having the\r\n   * following format.\r\n   *\r\n   *   USHORT   ppem         Vertical pixels per EM for this strike.\r\n   *   USHORT   numItems     Number of items for this strike (properties and\r\n   *                         atoms).  Maximum is 255.\r\n   *\r\n   * This array in turn is followed by `strikeCount' value sets.  Each\r\n   * `value set' is an array of `numItems' items with the following format.\r\n   *\r\n   *   ULONG    item_name    Offset in string table to item name.\r\n   *   USHORT   item_type    The item type.  Possible values are\r\n   *                            0 => string (e.g., COMMENT)\r\n   *                            1 => atom   (e.g., FONT or even SIZE)\r\n   *                            2 => int32\r\n   *                            3 => uint32\r\n   *                         0x10 => A flag to indicate a properties.  This\r\n   *                                 is ORed with the above values.\r\n   *   ULONG    item_value   For strings  => Offset into string table without\r\n   *                                         the corresponding double quotes.\r\n   *                         For atoms    => Offset into string table.\r\n   *                         For integers => Direct value.\r\n   *\r\n   * All strings in the string table consist of bytes and are\r\n   * zero-terminated.\r\n   *\r\n   */\r\n\r\n#ifdef TT_CONFIG_OPTION_BDF\r\n\r\n  typedef struct  TT_BDFRec_\r\n  {\r\n    FT_Byte*   table;\r\n    FT_Byte*   table_end;\r\n    FT_Byte*   strings;\r\n    FT_UInt32  strings_size;\r\n    FT_UInt    num_strikes;\r\n    FT_Bool    loaded;\r\n\r\n  } TT_BDFRec, *TT_BDF;\r\n\r\n#endif /* TT_CONFIG_OPTION_BDF */\r\n\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /***                  ORIGINAL TT_FACE CLASS DEFINITION                ***/\r\n  /***                                                                   ***/\r\n  /***                                                                   ***/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n  /*************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* This structure/class is defined here because it is common to the      */\r\n  /* following formats: TTF, OpenType-TT, and OpenType-CFF.                */\r\n  /*                                                                       */\r\n  /* Note, however, that the classes TT_Size and TT_GlyphSlot are not      */\r\n  /* shared between font drivers, and are thus defined in `ttobjs.h'.      */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <Type>                                                                */\r\n  /*    TT_Face                                                            */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    A handle to a TrueType face/font object.  A TT_Face encapsulates   */\r\n  /*    the resolution and scaling independent parts of a TrueType font    */\r\n  /*    resource.                                                          */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    The TT_Face structure is also used as a `parent class' for the     */\r\n  /*    OpenType-CFF class (T2_Face).                                      */\r\n  /*                                                                       */\r\n  typedef struct TT_FaceRec_*  TT_Face;\r\n\r\n\r\n  /* a function type used for the truetype bytecode interpreter hooks */\r\n  typedef FT_Error\r\n  (*TT_Interpreter)( void*  exec_context );\r\n\r\n  /* forward declaration */\r\n  typedef struct TT_LoaderRec_*  TT_Loader;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Loader_GotoTableFunc                                            */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Seeks a stream to the start of a given TrueType table.             */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    face   :: A handle to the target face object.                      */\r\n  /*                                                                       */\r\n  /*    tag    :: A 4-byte tag used to name the table.                     */\r\n  /*                                                                       */\r\n  /*    stream :: The input stream.                                        */\r\n  /*                                                                       */\r\n  /* <Output>                                                              */\r\n  /*    length :: The length of the table in bytes.  Set to 0 if not       */\r\n  /*              needed.                                                  */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    The stream cursor must be at the font file's origin.               */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Loader_GotoTableFunc)( TT_Face    face,\r\n                              FT_ULong   tag,\r\n                              FT_Stream  stream,\r\n                              FT_ULong*  length );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Loader_StartGlyphFunc                                           */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Seeks a stream to the start of a given glyph element, and opens a  */\r\n  /*    frame for it.                                                      */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    loader      :: The current TrueType glyph loader object.           */\r\n  /*                                                                       */\r\n  /*    glyph index :: The index of the glyph to access.                   */\r\n  /*                                                                       */\r\n  /*    offset      :: The offset of the glyph according to the            */\r\n  /*                   `locations' table.                                  */\r\n  /*                                                                       */\r\n  /*    byte_count  :: The size of the frame in bytes.                     */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  /* <Note>                                                                */\r\n  /*    This function is normally equivalent to FT_STREAM_SEEK(offset)     */\r\n  /*    followed by FT_FRAME_ENTER(byte_count) with the loader's stream,   */\r\n  /*    but alternative formats (e.g. compressed ones) might use something */\r\n  /*    different.                                                         */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Loader_StartGlyphFunc)( TT_Loader  loader,\r\n                               FT_UInt    glyph_index,\r\n                               FT_ULong   offset,\r\n                               FT_UInt    byte_count );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Loader_ReadGlyphFunc                                            */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Reads one glyph element (its header, a simple glyph, or a          */\r\n  /*    composite) from the loader's current stream frame.                 */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    loader :: The current TrueType glyph loader object.                */\r\n  /*                                                                       */\r\n  /* <Return>                                                              */\r\n  /*    FreeType error code.  0 means success.                             */\r\n  /*                                                                       */\r\n  typedef FT_Error\r\n  (*TT_Loader_ReadGlyphFunc)( TT_Loader  loader );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* <FuncType>                                                            */\r\n  /*    TT_Loader_EndGlyphFunc                                             */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    Closes the current loader stream frame for the glyph.              */\r\n  /*                                                                       */\r\n  /* <Input>                                                               */\r\n  /*    loader :: The current TrueType glyph loader object.                */\r\n  /*                                                                       */\r\n  typedef void\r\n  (*TT_Loader_EndGlyphFunc)( TT_Loader  loader );\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /*                         TrueType Face Type                            */\r\n  /*                                                                       */\r\n  /* <Struct>                                                              */\r\n  /*    TT_Face                                                            */\r\n  /*                                                                       */\r\n  /* <Description>                                                         */\r\n  /*    The TrueType face class.  These objects model the resolution and   */\r\n  /*    point-size independent data found in a TrueType font file.         */\r\n  /*                                                                       */\r\n  /* <Fields>                                                              */\r\n  /*    root                 :: The base FT_Face structure, managed by the */\r\n  /*                            base layer.                                */\r\n  /*                                                                       */\r\n  /*    ttc_header           :: The TrueType collection header, used when  */\r\n  /*                            the file is a `ttc' rather than a `ttf'.   */\r\n  /*                            For ordinary font files, the field         */\r\n  /*                            `ttc_header.count' is set to 0.            */\r\n  /*                                                                       */\r\n  /*    format_tag           :: The font format tag.                       */\r\n  /*                                                                       */\r\n  /*    num_tables           :: The number of TrueType tables in this font */\r\n  /*                            file.                                      */\r\n  /*                                                                       */\r\n  /*    dir_tables           :: The directory of TrueType tables for this  */\r\n  /*                            font file.                                 */\r\n  /*                                                                       */\r\n  /*    header               :: The font's font header (`head' table).     */\r\n  /*                            Read on font opening.                      */\r\n  /*                                                                       */\r\n  /*    horizontal           :: The font's horizontal header (`hhea'       */\r\n  /*                            table).  This field also contains the      */\r\n  /*                            associated horizontal metrics table        */\r\n  /*                            (`hmtx').                                  */\r\n  /*                                                                       */\r\n  /*    max_profile          :: The font's maximum profile table.  Read on */\r\n  /*                            font opening.  Note that some maximum      */\r\n  /*                            values cannot be taken directly from this  */\r\n  /*                            table.  We thus define additional fields   */\r\n  /*                            below to hold the computed maxima.         */\r\n  /*                                                                       */\r\n  /*    vertical_info        :: A boolean which is set when the font file  */\r\n  /*                            contains vertical metrics.  If not, the    */\r\n  /*                            value of the `vertical' field is           */\r\n  /*                            undefined.                                 */\r\n  /*                                                                       */\r\n  /*    vertical             :: The font's vertical header (`vhea' table). */\r\n  /*                            This field also contains the associated    */\r\n  /*                            vertical metrics table (`vmtx'), if found. */\r\n  /*                            IMPORTANT: The contents of this field is   */\r\n  /*                            undefined if the `verticalInfo' field is   */\r\n  /*                            unset.                                     */\r\n  /*                                                                       */\r\n  /*    num_names            :: The number of name records within this     */\r\n  /*                            TrueType font.                             */\r\n  /*                                                                       */\r\n  /*    name_table           :: The table of name records (`name').        */\r\n  /*                                                                       */\r\n  /*    os2                  :: The font's OS/2 table (`OS/2').            */\r\n  /*                                                                       */\r\n  /*    postscript           :: The font's PostScript table (`post'        */\r\n  /*                            table).  The PostScript glyph names are    */\r\n  /*                            not loaded by the driver on face opening.  */\r\n  /*                            See the `ttpost' module for more details.  */\r\n  /*                                                                       */\r\n  /*    cmap_table           :: Address of the face's `cmap' SFNT table    */\r\n  /*                            in memory (it's an extracted frame).       */\r\n  /*                                                                       */\r\n  /*    cmap_size            :: The size in bytes of the `cmap_table'      */\r\n  /*                            described above.                           */\r\n  /*                                                                       */\r\n  /*    goto_table           :: A function called by each TrueType table   */\r\n  /*                            loader to position a stream's cursor to    */\r\n  /*                            the start of a given table according to    */\r\n  /*                            its tag.  It defaults to TT_Goto_Face but  */\r\n  /*                            can be different for strange formats (e.g. */\r\n  /*                            Type 42).                                  */\r\n  /*                                                                       */\r\n  /*    access_glyph_frame   :: A function used to access the frame of a   */\r\n  /*                            given glyph within the face's font file.   */\r\n  /*                                                                       */\r\n  /*    forget_glyph_frame   :: A function used to forget the frame of a   */\r\n  /*                            given glyph when all data has been loaded. */\r\n  /*                                                                       */\r\n  /*    read_glyph_header    :: A function used to read a glyph header.    */\r\n  /*                            It must be called between an `access' and  */\r\n  /*                            `forget'.                                  */\r\n  /*                                                                       */\r\n  /*    read_simple_glyph    :: A function used to read a simple glyph.    */\r\n  /*                            It must be called after the header was     */\r\n  /*                            read, and before the `forget'.             */\r\n  /*                                                                       */\r\n  /*    read_composite_glyph :: A function used to read a composite glyph. */\r\n  /*                            It must be called after the header was     */\r\n  /*                            read, and before the `forget'.             */\r\n  /*                                                                       */\r\n  /*    sfnt                 :: A pointer to the SFNT service.             */\r\n  /*                                                                       */\r\n  /*    psnames              :: A pointer to the PostScript names service. */\r\n  /*                                                                       */\r\n  /*    hdmx                 :: The face's horizontal device metrics       */\r\n  /*                            (`hdmx' table).  This table is optional in */\r\n  /*                            TrueType/OpenType fonts.                   */\r\n  /*                                                                       */\r\n  /*    gasp                 :: The grid-fitting and scaling properties    */\r\n  /*                            table (`gasp').  This table is optional in */\r\n  /*                            TrueType/OpenType fonts.                   */\r\n  /*                                                                       */\r\n  /*    pclt                 :: The `pclt' SFNT table.                     */\r\n  /*                                                                       */\r\n  /*    num_sbit_strikes     :: The number of sbit strikes, i.e., bitmap   */\r\n  /*                            sizes, embedded in this font.              */\r\n  /*                                                                       */\r\n  /*    sbit_strikes         :: An array of sbit strikes embedded in this  */\r\n  /*                            font.  This table is optional in a         */\r\n  /*                            TrueType/OpenType font.                    */\r\n  /*                                                                       */\r\n  /*    num_sbit_scales      :: The number of sbit scales for this font.   */\r\n  /*                                                                       */\r\n  /*    sbit_scales          :: Array of sbit scales embedded in this      */\r\n  /*                            font.  This table is optional in a         */\r\n  /*                            TrueType/OpenType font.                    */\r\n  /*                                                                       */\r\n  /*    postscript_names     :: A table used to store the Postscript names */\r\n  /*                            of  the glyphs for this font.  See the     */\r\n  /*                            file  `ttconfig.h' for comments on the     */\r\n  /*                            TT_CONFIG_OPTION_POSTSCRIPT_NAMES option.  */\r\n  /*                                                                       */\r\n  /*    num_locations        :: The number of glyph locations in this      */\r\n  /*                            TrueType file.  This should be             */\r\n  /*                            identical to the number of glyphs.         */\r\n  /*                            Ignored for Type 2 fonts.                  */\r\n  /*                                                                       */\r\n  /*    glyph_locations      :: An array of longs.  These are offsets to   */\r\n  /*                            glyph data within the `glyf' table.        */\r\n  /*                            Ignored for Type 2 font faces.             */\r\n  /*                                                                       */\r\n  /*    glyf_len             :: The length of the `glyf' table.  Needed    */\r\n  /*                            for malformed `loca' tables.               */\r\n  /*                                                                       */\r\n  /*    font_program_size    :: Size in bytecodes of the face's font       */\r\n  /*                            program.  0 if none defined.  Ignored for  */\r\n  /*                            Type 2 fonts.                              */\r\n  /*                                                                       */\r\n  /*    font_program         :: The face's font program (bytecode stream)  */\r\n  /*                            executed at load time, also used during    */\r\n  /*                            glyph rendering.  Comes from the `fpgm'    */\r\n  /*                            table.  Ignored for Type 2 font fonts.     */\r\n  /*                                                                       */\r\n  /*    cvt_program_size     :: The size in bytecodes of the face's cvt    */\r\n  /*                            program.  Ignored for Type 2 fonts.        */\r\n  /*                                                                       */\r\n  /*    cvt_program          :: The face's cvt program (bytecode stream)   */\r\n  /*                            executed each time an instance/size is     */\r\n  /*                            changed/reset.  Comes from the `prep'      */\r\n  /*                            table.  Ignored for Type 2 fonts.          */\r\n  /*                                                                       */\r\n  /*    cvt_size             :: Size of the control value table (in        */\r\n  /*                            entries).   Ignored for Type 2 fonts.      */\r\n  /*                                                                       */\r\n  /*    cvt                  :: The face's original control value table.   */\r\n  /*                            Coordinates are expressed in unscaled font */\r\n  /*                            units.  Comes from the `cvt ' table.       */\r\n  /*                            Ignored for Type 2 fonts.                  */\r\n  /*                                                                       */\r\n  /*    num_kern_pairs       :: The number of kerning pairs present in the */\r\n  /*                            font file.  The engine only loads the      */\r\n  /*                            first horizontal format 0 kern table it    */\r\n  /*                            finds in the font file.  Ignored for       */\r\n  /*                            Type 2 fonts.                              */\r\n  /*                                                                       */\r\n  /*    kern_table_index     :: The index of the kerning table in the font */\r\n  /*                            kerning directory.  Ignored for Type 2     */\r\n  /*                            fonts.                                     */\r\n  /*                                                                       */\r\n  /*    interpreter          :: A pointer to the TrueType bytecode         */\r\n  /*                            interpreters field is also used to hook    */\r\n  /*                            the debugger in `ttdebug'.                 */\r\n  /*                                                                       */\r\n  /*    unpatented_hinting   :: If true, use only unpatented methods in    */\r\n  /*                            the bytecode interpreter.                  */\r\n  /*                                                                       */\r\n  /*    doblend              :: A boolean which is set if the font should  */\r\n  /*                            be blended (this is for GX var).           */\r\n  /*                                                                       */\r\n  /*    blend                :: Contains the data needed to control GX     */\r\n  /*                            variation tables (rather like Multiple     */\r\n  /*                            Master data).                              */\r\n  /*                                                                       */\r\n  /*    extra                :: Reserved for third-party font drivers.     */\r\n  /*                                                                       */\r\n  /*    postscript_name      :: The PS name of the font.  Used by the      */\r\n  /*                            postscript name service.                   */\r\n  /*                                                                       */\r\n  typedef struct  TT_FaceRec_\r\n  {\r\n    FT_FaceRec            root;\r\n\r\n    TTC_HeaderRec         ttc_header;\r\n\r\n    FT_ULong              format_tag;\r\n    FT_UShort             num_tables;\r\n    TT_Table              dir_tables;\r\n\r\n    TT_Header             header;       /* TrueType header table          */\r\n    TT_HoriHeader         horizontal;   /* TrueType horizontal header     */\r\n\r\n    TT_MaxProfile         max_profile;\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    FT_ULong              max_components;  /* stubbed to 0 */\r\n#endif\r\n\r\n    FT_Bool               vertical_info;\r\n    TT_VertHeader         vertical;     /* TT Vertical header, if present */\r\n\r\n    FT_UShort             num_names;    /* number of name records  */\r\n    TT_NameTableRec       name_table;   /* name table              */\r\n\r\n    TT_OS2                os2;          /* TrueType OS/2 table            */\r\n    TT_Postscript         postscript;   /* TrueType Postscript table      */\r\n\r\n    FT_Byte*              cmap_table;   /* extracted `cmap' table */\r\n    FT_ULong              cmap_size;\r\n\r\n    TT_Loader_GotoTableFunc   goto_table;\r\n\r\n    TT_Loader_StartGlyphFunc  access_glyph_frame;\r\n    TT_Loader_EndGlyphFunc    forget_glyph_frame;\r\n    TT_Loader_ReadGlyphFunc   read_glyph_header;\r\n    TT_Loader_ReadGlyphFunc   read_simple_glyph;\r\n    TT_Loader_ReadGlyphFunc   read_composite_glyph;\r\n\r\n    /* a typeless pointer to the SFNT_Interface table used to load */\r\n    /* the basic TrueType tables in the face object                */\r\n    void*                 sfnt;\r\n\r\n    /* a typeless pointer to the FT_Service_PsCMapsRec table used to */\r\n    /* handle glyph names <-> unicode & Mac values                   */\r\n    void*                 psnames;\r\n\r\n\r\n    /***********************************************************************/\r\n    /*                                                                     */\r\n    /* Optional TrueType/OpenType tables                                   */\r\n    /*                                                                     */\r\n    /***********************************************************************/\r\n\r\n    /* horizontal device metrics */\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    TT_HdmxRec            hdmx;\r\n#endif\r\n\r\n    /* grid-fitting and scaling table */\r\n    TT_GaspRec            gasp;                 /* the `gasp' table */\r\n\r\n    /* PCL 5 table */\r\n    TT_PCLT               pclt;\r\n\r\n    /* embedded bitmaps support */\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    FT_ULong              num_sbit_strikes;\r\n    TT_SBit_Strike        sbit_strikes;\r\n#endif\r\n\r\n    FT_ULong              num_sbit_scales;\r\n    TT_SBit_Scale         sbit_scales;\r\n\r\n    /* postscript names table */\r\n    TT_Post_NamesRec      postscript_names;\r\n\r\n\r\n    /***********************************************************************/\r\n    /*                                                                     */\r\n    /* TrueType-specific fields (ignored by the OTF-Type2 driver)          */\r\n    /*                                                                     */\r\n    /***********************************************************************/\r\n\r\n    /* the glyph locations */\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    FT_UShort             num_locations_stub;\r\n    FT_Long*              glyph_locations_stub;\r\n#endif\r\n\r\n    /* the font program, if any */\r\n    FT_ULong              font_program_size;\r\n    FT_Byte*              font_program;\r\n\r\n    /* the cvt program, if any */\r\n    FT_ULong              cvt_program_size;\r\n    FT_Byte*              cvt_program;\r\n\r\n    /* the original, unscaled, control value table */\r\n    FT_ULong              cvt_size;\r\n    FT_Short*             cvt;\r\n\r\n#ifdef FT_CONFIG_OPTION_OLD_INTERNALS\r\n    /* the format 0 kerning table, if any */\r\n    FT_Int                num_kern_pairs;\r\n    FT_Int                kern_table_index;\r\n    TT_Kern0_Pair         kern_pairs;\r\n#endif\r\n\r\n    /* A pointer to the bytecode interpreter to use.  This is also */\r\n    /* used to hook the debugger for the `ttdebug' utility.        */\r\n    TT_Interpreter        interpreter;\r\n\r\n#ifdef TT_CONFIG_OPTION_UNPATENTED_HINTING\r\n    /* Use unpatented hinting only. */\r\n    FT_Bool               unpatented_hinting;\r\n#endif\r\n\r\n    /***********************************************************************/\r\n    /*                                                                     */\r\n    /* Other tables or fields. This is used by derivative formats like     */\r\n    /* OpenType.                                                           */\r\n    /*                                                                     */\r\n    /***********************************************************************/\r\n\r\n    FT_Generic            extra;\r\n\r\n    const char*           postscript_name;\r\n\r\n    /* since version 2.1.8, but was originally placed after */\r\n    /* `glyph_locations_stub'                               */\r\n    FT_ULong              glyf_len;\r\n\r\n    /* since version 2.1.8, but was originally placed before `extra' */\r\n#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT\r\n    FT_Bool               doblend;\r\n    GX_Blend              blend;\r\n#endif\r\n\r\n    /* since version 2.2 */\r\n\r\n    FT_Byte*              horz_metrics;\r\n    FT_ULong              horz_metrics_size;\r\n\r\n    FT_Byte*              vert_metrics;\r\n    FT_ULong              vert_metrics_size;\r\n\r\n    FT_UInt               num_locations;\r\n    FT_Byte*              glyph_locations;\r\n\r\n    FT_Byte*              hdmx_table;\r\n    FT_ULong              hdmx_table_size;\r\n    FT_UInt               hdmx_record_count;\r\n    FT_ULong              hdmx_record_size;\r\n    FT_Byte*              hdmx_record_sizes;\r\n\r\n    FT_Byte*              sbit_table;\r\n    FT_ULong              sbit_table_size;\r\n    FT_UInt               sbit_num_strikes;\r\n\r\n    FT_Byte*              kern_table;\r\n    FT_ULong              kern_table_size;\r\n    FT_UInt               num_kern_tables;\r\n    FT_UInt32             kern_avail_bits;\r\n    FT_UInt32             kern_order_bits;\r\n\r\n#ifdef TT_CONFIG_OPTION_BDF\r\n    TT_BDFRec             bdf;\r\n#endif /* TT_CONFIG_OPTION_BDF */\r\n\r\n    /* since 2.3.0 */\r\n    FT_ULong              horz_metrics_offset;\r\n    FT_ULong              vert_metrics_offset;\r\n\r\n  } TT_FaceRec;\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /*  <Struct>                                                             */\r\n  /*     TT_GlyphZoneRec                                                   */\r\n  /*                                                                       */\r\n  /*  <Description>                                                        */\r\n  /*     A glyph zone is used to load, scale and hint glyph outline        */\r\n  /*     coordinates.                                                      */\r\n  /*                                                                       */\r\n  /*  <Fields>                                                             */\r\n  /*     memory       :: A handle to the memory manager.                   */\r\n  /*                                                                       */\r\n  /*     max_points   :: The maximal size in points of the zone.           */\r\n  /*                                                                       */\r\n  /*     max_contours :: Max size in links contours of the zone.           */\r\n  /*                                                                       */\r\n  /*     n_points     :: The current number of points in the zone.         */\r\n  /*                                                                       */\r\n  /*     n_contours   :: The current number of contours in the zone.       */\r\n  /*                                                                       */\r\n  /*     org          :: The original glyph coordinates (font              */\r\n  /*                     units/scaled).                                    */\r\n  /*                                                                       */\r\n  /*     cur          :: The current glyph coordinates (scaled/hinted).    */\r\n  /*                                                                       */\r\n  /*     tags         :: The point control tags.                           */\r\n  /*                                                                       */\r\n  /*     contours     :: The contours end points.                          */\r\n  /*                                                                       */\r\n  /*     first_point  :: Offset of the current subglyph's first point.     */\r\n  /*                                                                       */\r\n  typedef struct  TT_GlyphZoneRec_\r\n  {\r\n    FT_Memory   memory;\r\n    FT_UShort   max_points;\r\n    FT_UShort   max_contours;\r\n    FT_UShort   n_points;    /* number of points in zone    */\r\n    FT_Short    n_contours;  /* number of contours          */\r\n\r\n    FT_Vector*  org;         /* original point coordinates  */\r\n    FT_Vector*  cur;         /* current point coordinates   */\r\n    FT_Vector*  orus;        /* original (unscaled) point coordinates */\r\n\r\n    FT_Byte*    tags;        /* current touch flags         */\r\n    FT_UShort*  contours;    /* contour end points          */\r\n\r\n    FT_UShort   first_point; /* offset of first (#0) point  */\r\n\r\n  } TT_GlyphZoneRec, *TT_GlyphZone;\r\n\r\n\r\n  /* handle to execution context */\r\n  typedef struct TT_ExecContextRec_*  TT_ExecContext;\r\n\r\n  /* glyph loader structure */\r\n  typedef struct  TT_LoaderRec_\r\n  {\r\n    FT_Face          face;\r\n    FT_Size          size;\r\n    FT_GlyphSlot     glyph;\r\n    FT_GlyphLoader   gloader;\r\n\r\n    FT_ULong         load_flags;\r\n    FT_UInt          glyph_index;\r\n\r\n    FT_Stream        stream;\r\n    FT_Int           byte_len;\r\n\r\n    FT_Short         n_contours;\r\n    FT_BBox          bbox;\r\n    FT_Int           left_bearing;\r\n    FT_Int           advance;\r\n    FT_Int           linear;\r\n    FT_Bool          linear_def;\r\n    FT_Bool          preserve_pps;\r\n    FT_Vector        pp1;\r\n    FT_Vector        pp2;\r\n\r\n    FT_ULong         glyf_offset;\r\n\r\n    /* the zone where we load our glyphs */\r\n    TT_GlyphZoneRec  base;\r\n    TT_GlyphZoneRec  zone;\r\n\r\n    TT_ExecContext   exec;\r\n    FT_Byte*         instructions;\r\n    FT_ULong         ins_pos;\r\n\r\n    /* for possible extensibility in other formats */\r\n    void*            other;\r\n\r\n    /* since version 2.1.8 */\r\n    FT_Int           top_bearing;\r\n    FT_Int           vadvance;\r\n    FT_Vector        pp3;\r\n    FT_Vector        pp4;\r\n\r\n    /* since version 2.2.1 */\r\n    FT_Byte*         cursor;\r\n    FT_Byte*         limit;\r\n\r\n  } TT_LoaderRec;\r\n\r\n\r\nFT_END_HEADER\r\n\r\n#endif /* __TTTYPES_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/include/freetype/t1tables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  t1tables.h                                                             */\n/*                                                                         */\n/*    Basic Type 1/Type 2 tables definitions and interface (specification  */\n/*    only).                                                               */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2006 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __T1TABLES_H__\n#define __T1TABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    type1_tables                                                       */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    Type 1 Tables                                                      */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    Type 1 (PostScript) specific font tables.                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of Type 1-specific tables,    */\n  /*    including structures related to other PostScript font formats.     */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /* Note that we separate font data in PS_FontInfoRec and PS_PrivateRec */\n  /* structures in order to support Multiple Master fonts.               */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_FontInfoRec                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type1/Type2 FontInfo dictionary.  Note */\n  /*    that for Multiple Master fonts, each instance has its own          */\n  /*    FontInfo dictionary.                                               */\n  /*                                                                       */\n  typedef struct  PS_FontInfoRec\n  {\n    FT_String*  version;\n    FT_String*  notice;\n    FT_String*  full_name;\n    FT_String*  family_name;\n    FT_String*  weight;\n    FT_Long     italic_angle;\n    FT_Bool     is_fixed_pitch;\n    FT_Short    underline_position;\n    FT_UShort   underline_thickness;\n\n  } PS_FontInfoRec, *PS_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_FontInfo                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This type is equivalent to @PS_FontInfoRec.  It is deprecated but  */\n  /*    kept to maintain source compatibility between various versions of  */\n  /*    FreeType.                                                          */\n  /*                                                                       */\n  typedef PS_FontInfoRec  T1_FontInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    PS_PrivateRec                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a Type1/Type2 private dictionary.  Note  */\n  /*    that for Multiple Master fonts, each instance has its own Private  */\n  /*    dictionary.                                                        */\n  /*                                                                       */\n  typedef struct  PS_PrivateRec_\n  {\n    FT_Int     unique_id;\n    FT_Int     lenIV;\n\n    FT_Byte    num_blue_values;\n    FT_Byte    num_other_blues;\n    FT_Byte    num_family_blues;\n    FT_Byte    num_family_other_blues;\n\n    FT_Short   blue_values[14];\n    FT_Short   other_blues[10];\n\n    FT_Short   family_blues      [14];\n    FT_Short   family_other_blues[10];\n\n    FT_Fixed   blue_scale;\n    FT_Int     blue_shift;\n    FT_Int     blue_fuzz;\n\n    FT_UShort  standard_width[1];\n    FT_UShort  standard_height[1];\n\n    FT_Byte    num_snap_widths;\n    FT_Byte    num_snap_heights;\n    FT_Bool    force_bold;\n    FT_Bool    round_stem_up;\n\n    FT_Short   snap_widths [13];  /* including std width  */\n    FT_Short   snap_heights[13];  /* including std height */\n\n    FT_Fixed   expansion_factor;\n\n    FT_Long    language_group;\n    FT_Long    password;\n\n    FT_Short   min_feature[2];\n\n  } PS_PrivateRec, *PS_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    T1_Private                                                         */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @PS_PrivateRec.  It is deprecated but    */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef PS_PrivateRec  T1_Private;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    T1_Blend_Flags                                                     */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A set of flags used to indicate which fields are present in a      */\n  /*    given blend dictionary (font info or private).  Used to support    */\n  /*    Multiple Masters fonts.                                            */\n  /*                                                                       */\n  typedef enum\n  {\n    /*# required fields in a FontInfo blend dictionary */\n    T1_BLEND_UNDERLINE_POSITION = 0,\n    T1_BLEND_UNDERLINE_THICKNESS,\n    T1_BLEND_ITALIC_ANGLE,\n\n    /*# required fields in a Private blend dictionary */\n    T1_BLEND_BLUE_VALUES,\n    T1_BLEND_OTHER_BLUES,\n    T1_BLEND_STANDARD_WIDTH,\n    T1_BLEND_STANDARD_HEIGHT,\n    T1_BLEND_STEM_SNAP_WIDTHS,\n    T1_BLEND_STEM_SNAP_HEIGHTS,\n    T1_BLEND_BLUE_SCALE,\n    T1_BLEND_BLUE_SHIFT,\n    T1_BLEND_FAMILY_BLUES,\n    T1_BLEND_FAMILY_OTHER_BLUES,\n    T1_BLEND_FORCE_BOLD,\n\n    /*# never remove */\n    T1_BLEND_MAX\n\n  } T1_Blend_Flags;\n\n  /* */\n\n\n  /*# backwards compatible definitions */\n#define t1_blend_underline_position   T1_BLEND_UNDERLINE_POSITION\n#define t1_blend_underline_thickness  T1_BLEND_UNDERLINE_THICKNESS\n#define t1_blend_italic_angle         T1_BLEND_ITALIC_ANGLE\n#define t1_blend_blue_values          T1_BLEND_BLUE_VALUES\n#define t1_blend_other_blues          T1_BLEND_OTHER_BLUES\n#define t1_blend_standard_widths      T1_BLEND_STANDARD_WIDTH\n#define t1_blend_standard_height      T1_BLEND_STANDARD_HEIGHT\n#define t1_blend_stem_snap_widths     T1_BLEND_STEM_SNAP_WIDTHS\n#define t1_blend_stem_snap_heights    T1_BLEND_STEM_SNAP_HEIGHTS\n#define t1_blend_blue_scale           T1_BLEND_BLUE_SCALE\n#define t1_blend_blue_shift           T1_BLEND_BLUE_SHIFT\n#define t1_blend_family_blues         T1_BLEND_FAMILY_BLUES\n#define t1_blend_family_other_blues   T1_BLEND_FAMILY_OTHER_BLUES\n#define t1_blend_force_bold           T1_BLEND_FORCE_BOLD\n#define t1_blend_max                  T1_BLEND_MAX\n\n\n  /* maximum number of Multiple Masters designs, as defined in the spec */\n#define T1_MAX_MM_DESIGNS     16\n\n  /* maximum number of Multiple Masters axes, as defined in the spec */\n#define T1_MAX_MM_AXIS        4\n\n  /* maximum number of elements in a design map */\n#define T1_MAX_MM_MAP_POINTS  20\n\n\n  /* this structure is used to store the BlendDesignMap entry for an axis */\n  typedef struct  PS_DesignMap_\n  {\n    FT_Byte    num_points;\n    FT_Long*   design_points;\n    FT_Fixed*  blend_points;\n\n  } PS_DesignMapRec, *PS_DesignMap;\n\n  /* backwards-compatible definition */\n  typedef PS_DesignMapRec  T1_DesignMap;\n\n\n  typedef struct  PS_BlendRec_\n  {\n    FT_UInt          num_designs;\n    FT_UInt          num_axis;\n\n    FT_String*       axis_names[T1_MAX_MM_AXIS];\n    FT_Fixed*        design_pos[T1_MAX_MM_DESIGNS];\n    PS_DesignMapRec  design_map[T1_MAX_MM_AXIS];\n\n    FT_Fixed*        weight_vector;\n    FT_Fixed*        default_weight_vector;\n\n    PS_FontInfo      font_infos[T1_MAX_MM_DESIGNS + 1];\n    PS_Private       privates  [T1_MAX_MM_DESIGNS + 1];\n\n    FT_ULong         blend_bitflags;\n\n    FT_BBox*         bboxes    [T1_MAX_MM_DESIGNS + 1];\n\n    /* since 2.3.0 */\n\n    /* undocumented, optional: the default design instance;   */\n    /* corresponds to default_weight_vector --                */\n    /* num_default_design_vector == 0 means it is not present */\n    /* in the font and associated metrics files               */\n    FT_UInt          default_design_vector[T1_MAX_MM_DESIGNS];\n    FT_UInt          num_default_design_vector;\n\n  } PS_BlendRec, *PS_Blend;\n\n\n  /* backwards-compatible definition */\n  typedef PS_BlendRec  T1_Blend;\n\n\n  typedef struct  CID_FaceDictRec_\n  {\n    PS_PrivateRec  private_dict;\n\n    FT_UInt        len_buildchar;\n    FT_Fixed       forcebold_threshold;\n    FT_Pos         stroke_width;\n    FT_Fixed       expansion_factor;\n\n    FT_Byte        paint_type;\n    FT_Byte        font_type;\n    FT_Matrix      font_matrix;\n    FT_Vector      font_offset;\n\n    FT_UInt        num_subrs;\n    FT_ULong       subrmap_offset;\n    FT_Int         sd_bytes;\n\n  } CID_FaceDictRec, *CID_FaceDict;\n\n\n  /* backwards-compatible definition */\n  typedef CID_FaceDictRec  CID_FontDict;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_FaceInfoRec                                                    */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to represent CID Face information.                */\n  /*                                                                       */\n  typedef struct  CID_FaceInfoRec_\n  {\n    FT_String*      cid_font_name;\n    FT_Fixed        cid_version;\n    FT_Int          cid_font_type;\n\n    FT_String*      registry;\n    FT_String*      ordering;\n    FT_Int          supplement;\n\n    PS_FontInfoRec  font_info;\n    FT_BBox         font_bbox;\n    FT_ULong        uid_base;\n\n    FT_Int          num_xuid;\n    FT_ULong        xuid[16];\n\n    FT_ULong        cidmap_offset;\n    FT_Int          fd_bytes;\n    FT_Int          gd_bytes;\n    FT_ULong        cid_count;\n\n    FT_Int          num_dicts;\n    CID_FaceDict    font_dicts;\n\n    FT_ULong        data_offset;\n\n  } CID_FaceInfoRec, *CID_FaceInfo;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    CID_Info                                                           */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*   This type is equivalent to @CID_FaceInfoRec.  It is deprecated but  */\n  /*   kept to maintain source compatibility between various versions of   */\n  /*   FreeType.                                                           */\n  /*                                                                       */\n  typedef CID_FaceInfoRec  CID_Info;\n\n  /* */\n\n\n /************************************************************************\n  *\n  * @function:\n  *    FT_Has_PS_Glyph_Names\n  *\n  * @description:\n  *    Return true if a given face provides reliable Postscript glyph\n  *    names.  This is similar to using the @FT_HAS_GLYPH_NAMES macro,\n  *    except that certain fonts (mostly TrueType) contain incorrect\n  *    glyph name tables.\n  *\n  *    When this function returns true, the caller is sure that the glyph\n  *    names returned by @FT_Get_Glyph_Name are reliable.\n  *\n  * @input:\n  *    face ::\n  *       face handle\n  *\n  * @return:\n  *    Boolean.  True if glyph names are reliable.\n  */\n  FT_EXPORT( FT_Int )\n  FT_Has_PS_Glyph_Names( FT_Face  face );\n\n\n /************************************************************************\n  *\n  * @function:\n  *    FT_Get_PS_Font_Info\n  *\n  * @description:\n  *    Retrieve the @PS_FontInfoRec structure corresponding to a given\n  *    Postscript font.\n  *\n  * @input:\n  *    face ::\n  *       Postscript face handle.\n  *\n  * @output:\n  *    afont_info ::\n  *       Output font info structure pointer.\n  *\n  * @return:\n  *    FreeType error code.  0 means success.\n  *\n  * @note:\n  *    The string pointers within the font info structure are owned by\n  *    the face and don't need to be freed by the caller.\n  *\n  *    If the font's format is not Postscript-based, this function will\n  *    return the `FT_Err_Invalid_Argument' error code.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Info( FT_Face          face,\n                       PS_FontInfoRec  *afont_info );\n\n\n /************************************************************************\n  *\n  * @function:\n  *    FT_Get_PS_Font_Private\n  *\n  * @description:\n  *    Retrieve the @PS_PrivateRec structure corresponding to a given\n  *    Postscript font.\n  *\n  * @input:\n  *    face ::\n  *       Postscript face handle.\n  *\n  * @output:\n  *    afont_private ::\n  *       Output private dictionary structure pointer.\n  *\n  * @return:\n  *    FreeType error code.  0 means success.\n  *\n  * @note:\n  *    The string pointers within the font info structure are owned by\n  *    the face and don't need to be freed by the caller.\n  *\n  *    If the font's format is not Postscript-based, this function will\n  *    return the `FT_Err_Invalid_Argument' error code.\n  */\n  FT_EXPORT( FT_Error )\n  FT_Get_PS_Font_Private( FT_Face         face,\n                          PS_PrivateRec  *afont_private );\n\n /* */\n\n\n\nFT_END_HEADER\n\n#endif /* __T1TABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ttnameid.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttnameid.h                                                             */\n/*                                                                         */\n/*    TrueType name ID definitions (specification only).                   */\n/*                                                                         */\n/*  Copyright 1996-2002, 2003, 2004, 2006, 2007 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTNAMEID_H__\n#define __TTNAMEID_H__\n\n\n#include <ft2build.h>\n\n\nFT_BEGIN_HEADER\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values for the `platform' identifier code in the name        */\n  /* records of the TTF `name' table.                                      */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_PLATFORM_XXX\n   *\n   * @description:\n   *   A list of valid values for the `platform_id' identifier code in\n   *   @FT_CharMapRec and @FT_SfntName structures.\n   *\n   * @values:\n   *   TT_PLATFORM_APPLE_UNICODE ::\n   *     Used by Apple to indicate a Unicode character map and/or name entry.\n   *     See @TT_APPLE_ID_XXX for corresponding `encoding_id' values.  Note\n   *     that name entries in this format are coded as big-endian UCS-2\n   *     character codes _only_.\n   *\n   *   TT_PLATFORM_MACINTOSH ::\n   *     Used by Apple to indicate a MacOS-specific charmap and/or name entry.\n   *     See @TT_MAC_ID_XXX for corresponding `encoding_id' values.  Note that\n   *     most TrueType fonts contain an Apple roman charmap to be usable on\n   *     MacOS systems (even if they contain a Microsoft charmap as well).\n   *\n   *   TT_PLATFORM_ISO ::\n   *     This value was used to specify Unicode charmaps.  It is however\n   *     now deprecated.  See @TT_ISO_ID_XXX for a list of corresponding\n   *     `encoding_id' values.\n   *\n   *   TT_PLATFORM_MICROSOFT ::\n   *     Used by Microsoft to indicate Windows-specific charmaps.  See\n   *     @TT_MS_ID_XXX for a list of corresponding `encoding_id' values.\n   *     Note that most fonts contain a Unicode charmap using\n   *     (TT_PLATFORM_MICROSOFT, @TT_MS_ID_UNICODE_CS).\n   *\n   *   TT_PLATFORM_CUSTOM ::\n   *     Used to indicate application-specific charmaps.\n   *\n   *   TT_PLATFORM_ADOBE ::\n   *     This value isn't part of any font format specification, but is used\n   *     by FreeType to report Adobe-specific charmaps in an @FT_CharMapRec\n   *     structure.  See @TT_ADOBE_ID_XXX.\n   */\n\n#define TT_PLATFORM_APPLE_UNICODE  0\n#define TT_PLATFORM_MACINTOSH      1\n#define TT_PLATFORM_ISO            2 /* deprecated */\n#define TT_PLATFORM_MICROSOFT      3\n#define TT_PLATFORM_CUSTOM         4\n#define TT_PLATFORM_ADOBE          7 /* artificial */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_APPLE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_APPLE_UNICODE charmaps and name entries.\n   *\n   * @values:\n   *   TT_APPLE_ID_DEFAULT ::\n   *     Unicode version 1.0.\n   *\n   *   TT_APPLE_ID_UNICODE_1_1 ::\n   *     Unicode 1.1; specifies Hangul characters starting at U+34xx.\n   *\n   *   TT_APPLE_ID_ISO_10646 ::\n   *     Deprecated (identical to preceding).\n   *\n   *   TT_APPLE_ID_UNICODE_2_0 ::\n   *     Unicode 2.0 and beyond (UTF-16 BMP only).\n   *\n   *   TT_APPLE_ID_UNICODE_32 ::\n   *     Unicode 3.1 and beyond, using UTF-32.\n   */\n\n#define TT_APPLE_ID_DEFAULT      0 /* Unicode 1.0 */\n#define TT_APPLE_ID_UNICODE_1_1  1 /* specify Hangul at U+34xx */\n#define TT_APPLE_ID_ISO_10646    2 /* deprecated */\n#define TT_APPLE_ID_UNICODE_2_0  3 /* or later */\n#define TT_APPLE_ID_UNICODE_32   4 /* 2.0 or later, full repertoire */\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MAC_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MACINTOSH charmaps and name entries.\n   *\n   * @values:\n   *   TT_MAC_ID_ROMAN ::\n   *   TT_MAC_ID_JAPANESE ::\n   *   TT_MAC_ID_TRADITIONAL_CHINESE ::\n   *   TT_MAC_ID_KOREAN ::\n   *   TT_MAC_ID_ARABIC ::\n   *   TT_MAC_ID_HEBREW ::\n   *   TT_MAC_ID_GREEK ::\n   *   TT_MAC_ID_RUSSIAN ::\n   *   TT_MAC_ID_RSYMBOL ::\n   *   TT_MAC_ID_DEVANAGARI ::\n   *   TT_MAC_ID_GURMUKHI ::\n   *   TT_MAC_ID_GUJARATI ::\n   *   TT_MAC_ID_ORIYA ::\n   *   TT_MAC_ID_BENGALI ::\n   *   TT_MAC_ID_TAMIL ::\n   *   TT_MAC_ID_TELUGU ::\n   *   TT_MAC_ID_KANNADA ::\n   *   TT_MAC_ID_MALAYALAM ::\n   *   TT_MAC_ID_SINHALESE ::\n   *   TT_MAC_ID_BURMESE ::\n   *   TT_MAC_ID_KHMER ::\n   *   TT_MAC_ID_THAI ::\n   *   TT_MAC_ID_LAOTIAN ::\n   *   TT_MAC_ID_GEORGIAN ::\n   *   TT_MAC_ID_ARMENIAN ::\n   *   TT_MAC_ID_MALDIVIAN ::\n   *   TT_MAC_ID_SIMPLIFIED_CHINESE ::\n   *   TT_MAC_ID_TIBETAN ::\n   *   TT_MAC_ID_MONGOLIAN ::\n   *   TT_MAC_ID_GEEZ ::\n   *   TT_MAC_ID_SLAVIC ::\n   *   TT_MAC_ID_VIETNAMESE ::\n   *   TT_MAC_ID_SINDHI ::\n   *   TT_MAC_ID_UNINTERP ::\n   */\n\n#define TT_MAC_ID_ROMAN                 0\n#define TT_MAC_ID_JAPANESE              1\n#define TT_MAC_ID_TRADITIONAL_CHINESE   2\n#define TT_MAC_ID_KOREAN                3\n#define TT_MAC_ID_ARABIC                4\n#define TT_MAC_ID_HEBREW                5\n#define TT_MAC_ID_GREEK                 6\n#define TT_MAC_ID_RUSSIAN               7\n#define TT_MAC_ID_RSYMBOL               8\n#define TT_MAC_ID_DEVANAGARI            9\n#define TT_MAC_ID_GURMUKHI             10\n#define TT_MAC_ID_GUJARATI             11\n#define TT_MAC_ID_ORIYA                12\n#define TT_MAC_ID_BENGALI              13\n#define TT_MAC_ID_TAMIL                14\n#define TT_MAC_ID_TELUGU               15\n#define TT_MAC_ID_KANNADA              16\n#define TT_MAC_ID_MALAYALAM            17\n#define TT_MAC_ID_SINHALESE            18\n#define TT_MAC_ID_BURMESE              19\n#define TT_MAC_ID_KHMER                20\n#define TT_MAC_ID_THAI                 21\n#define TT_MAC_ID_LAOTIAN              22\n#define TT_MAC_ID_GEORGIAN             23\n#define TT_MAC_ID_ARMENIAN             24\n#define TT_MAC_ID_MALDIVIAN            25\n#define TT_MAC_ID_SIMPLIFIED_CHINESE   25\n#define TT_MAC_ID_TIBETAN              26\n#define TT_MAC_ID_MONGOLIAN            27\n#define TT_MAC_ID_GEEZ                 28\n#define TT_MAC_ID_SLAVIC               29\n#define TT_MAC_ID_VIETNAMESE           30\n#define TT_MAC_ID_SINDHI               31\n#define TT_MAC_ID_UNINTERP             32\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ISO_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ISO charmaps and name entries.\n   *\n   *   Their use is now deprecated.\n   *\n   * @values:\n   *   TT_ISO_ID_7BIT_ASCII ::\n   *     ASCII.\n   *   TT_ISO_ID_10646 ::\n   *     ISO/10646.\n   *   TT_ISO_ID_8859_1 ::\n   *     Also known as Latin-1.\n   */\n\n#define TT_ISO_ID_7BIT_ASCII  0\n#define TT_ISO_ID_10646       1\n#define TT_ISO_ID_8859_1      2\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_MS_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_MICROSOFT charmaps and name entries.\n   *\n   * @values:\n   *   TT_MS_ID_SYMBOL_CS ::\n   *     Corresponds to Microsoft symbol encoding. See\n   *     @FT_ENCODING_MS_SYMBOL.\n   *\n   *   TT_MS_ID_UNICODE_CS ::\n   *     Corresponds to a Microsoft WGL4 charmap, matching Unicode.  See\n   *     @FT_ENCODING_UNICODE.\n   *\n   *   TT_MS_ID_SJIS ::\n   *     Corresponds to SJIS Japanese encoding.  See @FT_ENCODING_SJIS.\n   *\n   *   TT_MS_ID_GB2312 ::\n   *     Corresponds to Simplified Chinese as used in Mainland China.  See\n   *     @FT_ENCODING_GB2312.\n   *\n   *   TT_MS_ID_BIG_5 ::\n   *     Corresponds to Traditional Chinese as used in Taiwan and Hong Kong.\n   *     See @FT_ENCODING_BIG5.\n   *\n   *   TT_MS_ID_WANSUNG ::\n   *     Corresponds to Korean Wansung encoding.  See @FT_ENCODING_WANSUNG.\n   *\n   *   TT_MS_ID_JOHAB ::\n   *     Corresponds to Johab encoding.  See @FT_ENCODING_JOHAB.\n   *\n   *   TT_MS_ID_UCS_4 ::\n   *     Corresponds to UCS-4 or UTF-32 charmaps.  This has been added to\n   *     the OpenType specification version 1.4 (mid-2001.)\n   */\n\n#define TT_MS_ID_SYMBOL_CS    0\n#define TT_MS_ID_UNICODE_CS   1\n#define TT_MS_ID_SJIS         2\n#define TT_MS_ID_GB2312       3\n#define TT_MS_ID_BIG_5        4\n#define TT_MS_ID_WANSUNG      5\n#define TT_MS_ID_JOHAB        6\n#define TT_MS_ID_UCS_4       10\n\n\n  /***********************************************************************\n   *\n   * @enum:\n   *   TT_ADOBE_ID_XXX\n   *\n   * @description:\n   *   A list of valid values for the `encoding_id' for\n   *   @TT_PLATFORM_ADOBE charmaps.  This is a FreeType-specific extension!\n   *\n   * @values:\n   *   TT_ADOBE_ID_STANDARD ::\n   *     Adobe standard encoding.\n   *   TT_ADOBE_ID_EXPERT ::\n   *     Adobe expert encoding.\n   *   TT_ADOBE_ID_CUSTOM ::\n   *     Adobe custom encoding.\n   */\n\n#define TT_ADOBE_ID_STANDARD  0\n#define TT_ADOBE_ID_EXPERT    1\n#define TT_ADOBE_ID_CUSTOM    2\n#define TT_ADOBE_ID_LATIN_1   3\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MACINTOSH.                                                */\n  /*                                                                       */\n  /* The canonical source for the Apple assigned Language ID's is at       */\n  /*                                                                       */\n  /*   http://fonts.apple.com/TTRefMan/RM06/Chap6name.html                 */\n  /*                                                                       */\n#define TT_MAC_LANGID_ENGLISH                       0\n#define TT_MAC_LANGID_FRENCH                        1\n#define TT_MAC_LANGID_GERMAN                        2\n#define TT_MAC_LANGID_ITALIAN                       3\n#define TT_MAC_LANGID_DUTCH                         4\n#define TT_MAC_LANGID_SWEDISH                       5\n#define TT_MAC_LANGID_SPANISH                       6\n#define TT_MAC_LANGID_DANISH                        7\n#define TT_MAC_LANGID_PORTUGUESE                    8\n#define TT_MAC_LANGID_NORWEGIAN                     9\n#define TT_MAC_LANGID_HEBREW                       10\n#define TT_MAC_LANGID_JAPANESE                     11\n#define TT_MAC_LANGID_ARABIC                       12\n#define TT_MAC_LANGID_FINNISH                      13\n#define TT_MAC_LANGID_GREEK                        14\n#define TT_MAC_LANGID_ICELANDIC                    15\n#define TT_MAC_LANGID_MALTESE                      16\n#define TT_MAC_LANGID_TURKISH                      17\n#define TT_MAC_LANGID_CROATIAN                     18\n#define TT_MAC_LANGID_CHINESE_TRADITIONAL          19\n#define TT_MAC_LANGID_URDU                         20\n#define TT_MAC_LANGID_HINDI                        21\n#define TT_MAC_LANGID_THAI                         22\n#define TT_MAC_LANGID_KOREAN                       23\n#define TT_MAC_LANGID_LITHUANIAN                   24\n#define TT_MAC_LANGID_POLISH                       25\n#define TT_MAC_LANGID_HUNGARIAN                    26\n#define TT_MAC_LANGID_ESTONIAN                     27\n#define TT_MAC_LANGID_LETTISH                      28\n#define TT_MAC_LANGID_SAAMISK                      29\n#define TT_MAC_LANGID_FAEROESE                     30\n#define TT_MAC_LANGID_FARSI                        31\n#define TT_MAC_LANGID_RUSSIAN                      32\n#define TT_MAC_LANGID_CHINESE_SIMPLIFIED           33\n#define TT_MAC_LANGID_FLEMISH                      34\n#define TT_MAC_LANGID_IRISH                        35\n#define TT_MAC_LANGID_ALBANIAN                     36\n#define TT_MAC_LANGID_ROMANIAN                     37\n#define TT_MAC_LANGID_CZECH                        38\n#define TT_MAC_LANGID_SLOVAK                       39\n#define TT_MAC_LANGID_SLOVENIAN                    40\n#define TT_MAC_LANGID_YIDDISH                      41\n#define TT_MAC_LANGID_SERBIAN                      42\n#define TT_MAC_LANGID_MACEDONIAN                   43\n#define TT_MAC_LANGID_BULGARIAN                    44\n#define TT_MAC_LANGID_UKRAINIAN                    45\n#define TT_MAC_LANGID_BYELORUSSIAN                 46\n#define TT_MAC_LANGID_UZBEK                        47\n#define TT_MAC_LANGID_KAZAKH                       48\n#define TT_MAC_LANGID_AZERBAIJANI                  49\n#define TT_MAC_LANGID_AZERBAIJANI_CYRILLIC_SCRIPT  49\n#define TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT    50\n#define TT_MAC_LANGID_ARMENIAN                     51\n#define TT_MAC_LANGID_GEORGIAN                     52\n#define TT_MAC_LANGID_MOLDAVIAN                    53\n#define TT_MAC_LANGID_KIRGHIZ                      54\n#define TT_MAC_LANGID_TAJIKI                       55\n#define TT_MAC_LANGID_TURKMEN                      56\n#define TT_MAC_LANGID_MONGOLIAN                    57\n#define TT_MAC_LANGID_MONGOLIAN_MONGOLIAN_SCRIPT   57\n#define TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT    58\n#define TT_MAC_LANGID_PASHTO                       59\n#define TT_MAC_LANGID_KURDISH                      60\n#define TT_MAC_LANGID_KASHMIRI                     61\n#define TT_MAC_LANGID_SINDHI                       62\n#define TT_MAC_LANGID_TIBETAN                      63\n#define TT_MAC_LANGID_NEPALI                       64\n#define TT_MAC_LANGID_SANSKRIT                     65\n#define TT_MAC_LANGID_MARATHI                      66\n#define TT_MAC_LANGID_BENGALI                      67\n#define TT_MAC_LANGID_ASSAMESE                     68\n#define TT_MAC_LANGID_GUJARATI                     69\n#define TT_MAC_LANGID_PUNJABI                      70\n#define TT_MAC_LANGID_ORIYA                        71\n#define TT_MAC_LANGID_MALAYALAM                    72\n#define TT_MAC_LANGID_KANNADA                      73\n#define TT_MAC_LANGID_TAMIL                        74\n#define TT_MAC_LANGID_TELUGU                       75\n#define TT_MAC_LANGID_SINHALESE                    76\n#define TT_MAC_LANGID_BURMESE                      77\n#define TT_MAC_LANGID_KHMER                        78\n#define TT_MAC_LANGID_LAO                          79\n#define TT_MAC_LANGID_VIETNAMESE                   80\n#define TT_MAC_LANGID_INDONESIAN                   81\n#define TT_MAC_LANGID_TAGALOG                      82\n#define TT_MAC_LANGID_MALAY_ROMAN_SCRIPT           83\n#define TT_MAC_LANGID_MALAY_ARABIC_SCRIPT          84\n#define TT_MAC_LANGID_AMHARIC                      85\n#define TT_MAC_LANGID_TIGRINYA                     86\n#define TT_MAC_LANGID_GALLA                        87\n#define TT_MAC_LANGID_SOMALI                       88\n#define TT_MAC_LANGID_SWAHILI                      89\n#define TT_MAC_LANGID_RUANDA                       90\n#define TT_MAC_LANGID_RUNDI                        91\n#define TT_MAC_LANGID_CHEWA                        92\n#define TT_MAC_LANGID_MALAGASY                     93\n#define TT_MAC_LANGID_ESPERANTO                    94\n#define TT_MAC_LANGID_WELSH                       128\n#define TT_MAC_LANGID_BASQUE                      129\n#define TT_MAC_LANGID_CATALAN                     130\n#define TT_MAC_LANGID_LATIN                       131\n#define TT_MAC_LANGID_QUECHUA                     132\n#define TT_MAC_LANGID_GUARANI                     133\n#define TT_MAC_LANGID_AYMARA                      134\n#define TT_MAC_LANGID_TATAR                       135\n#define TT_MAC_LANGID_UIGHUR                      136\n#define TT_MAC_LANGID_DZONGKHA                    137\n#define TT_MAC_LANGID_JAVANESE                    138\n#define TT_MAC_LANGID_SUNDANESE                   139\n\n\n#if 0  /* these seem to be errors that have been dropped */\n\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             140\n#define TT_MAC_LANGID_IRISH_GAELIC                141\n\n#endif\n\n\n  /* The following codes are new as of 2000-03-10 */\n#define TT_MAC_LANGID_GALICIAN                    140\n#define TT_MAC_LANGID_AFRIKAANS                   141\n#define TT_MAC_LANGID_BRETON                      142\n#define TT_MAC_LANGID_INUKTITUT                   143\n#define TT_MAC_LANGID_SCOTTISH_GAELIC             144\n#define TT_MAC_LANGID_MANX_GAELIC                 145\n#define TT_MAC_LANGID_IRISH_GAELIC                146\n#define TT_MAC_LANGID_TONGAN                      147\n#define TT_MAC_LANGID_GREEK_POLYTONIC             148\n#define TT_MAC_LANGID_GREELANDIC                  149\n#define TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT    150\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the language identifier field in the name records  */\n  /* of the TTF `name' table if the `platform' identifier code is          */\n  /* TT_PLATFORM_MICROSOFT.                                                */\n  /*                                                                       */\n  /* The canonical source for the MS assigned LCID's (seems to) be at      */\n  /*                                                                       */\n  /*   http://www.microsoft.com/globaldev/reference/lcid-all.mspx          */\n  /*                                                                       */\n  /* It used to be at various places, among them                           */\n  /*                                                                       */\n  /*   http://www.microsoft.com/typography/OTSPEC/lcid-cp.txt              */\n  /*   http://www.microsoft.com/globaldev/reference/loclanghome.asp        */\n  /*   http://support.microsoft.com/support/kb/articles/Q224/8/04.ASP      */\n  /*   http://msdn.microsoft.com/library/en-us/passport25/                 */\n  /*           NET_Passport_VBScript_Documentation/Single_Sign_In/         */\n  /*           Advanced_Single_Sign_In/Localization_and_LCIDs.asp          */\n  /*                                                                       */\n  /* Hopefully, it seems now that the Globaldev site prevails...           */\n  /*                                   (updated by Antoine, 2004-02-17)    */\n\n#define TT_MS_LANGID_ARABIC_GENERAL                    0x0001\n#define TT_MS_LANGID_ARABIC_SAUDI_ARABIA               0x0401\n#define TT_MS_LANGID_ARABIC_IRAQ                       0x0801\n#define TT_MS_LANGID_ARABIC_EGYPT                      0x0c01\n#define TT_MS_LANGID_ARABIC_LIBYA                      0x1001\n#define TT_MS_LANGID_ARABIC_ALGERIA                    0x1401\n#define TT_MS_LANGID_ARABIC_MOROCCO                    0x1801\n#define TT_MS_LANGID_ARABIC_TUNISIA                    0x1c01\n#define TT_MS_LANGID_ARABIC_OMAN                       0x2001\n#define TT_MS_LANGID_ARABIC_YEMEN                      0x2401\n#define TT_MS_LANGID_ARABIC_SYRIA                      0x2801\n#define TT_MS_LANGID_ARABIC_JORDAN                     0x2c01\n#define TT_MS_LANGID_ARABIC_LEBANON                    0x3001\n#define TT_MS_LANGID_ARABIC_KUWAIT                     0x3401\n#define TT_MS_LANGID_ARABIC_UAE                        0x3801\n#define TT_MS_LANGID_ARABIC_BAHRAIN                    0x3c01\n#define TT_MS_LANGID_ARABIC_QATAR                      0x4001\n#define TT_MS_LANGID_BULGARIAN_BULGARIA                0x0402\n#define TT_MS_LANGID_CATALAN_SPAIN                     0x0403\n#define TT_MS_LANGID_CHINESE_GENERAL                   0x0004\n#define TT_MS_LANGID_CHINESE_TAIWAN                    0x0404\n#define TT_MS_LANGID_CHINESE_PRC                       0x0804\n#define TT_MS_LANGID_CHINESE_HONG_KONG                 0x0c04\n#define TT_MS_LANGID_CHINESE_SINGAPORE                 0x1004\n\n#if 1  /* this looks like the correct value */\n#define TT_MS_LANGID_CHINESE_MACAU                     0x1404\n#else  /* but beware, Microsoft may change its mind...\n          the most recent Word reference has the following: */\n#define TT_MS_LANGID_CHINESE_MACAU  TT_MS_LANGID_CHINESE_HONG_KONG\n#endif\n\n#if 0  /* used only with .NET `cultures'; commented out */\n#define TT_MS_LANGID_CHINESE_TRADITIONAL               0x7C04\n#endif\n\n#define TT_MS_LANGID_CZECH_CZECH_REPUBLIC              0x0405\n#define TT_MS_LANGID_DANISH_DENMARK                    0x0406\n#define TT_MS_LANGID_GERMAN_GERMANY                    0x0407\n#define TT_MS_LANGID_GERMAN_SWITZERLAND                0x0807\n#define TT_MS_LANGID_GERMAN_AUSTRIA                    0x0c07\n#define TT_MS_LANGID_GERMAN_LUXEMBOURG                 0x1007\n#define TT_MS_LANGID_GERMAN_LIECHTENSTEI               0x1407\n#define TT_MS_LANGID_GREEK_GREECE                      0x0408\n\n  /* don't ask what this one means... It is commented out currently. */\n#if 0\n#define TT_MS_LANGID_GREEK_GREECE2                     0x2008\n#endif\n\n#define TT_MS_LANGID_ENGLISH_GENERAL                   0x0009\n#define TT_MS_LANGID_ENGLISH_UNITED_STATES             0x0409\n#define TT_MS_LANGID_ENGLISH_UNITED_KINGDOM            0x0809\n#define TT_MS_LANGID_ENGLISH_AUSTRALIA                 0x0c09\n#define TT_MS_LANGID_ENGLISH_CANADA                    0x1009\n#define TT_MS_LANGID_ENGLISH_NEW_ZEALAND               0x1409\n#define TT_MS_LANGID_ENGLISH_IRELAND                   0x1809\n#define TT_MS_LANGID_ENGLISH_SOUTH_AFRICA              0x1c09\n#define TT_MS_LANGID_ENGLISH_JAMAICA                   0x2009\n#define TT_MS_LANGID_ENGLISH_CARIBBEAN                 0x2409\n#define TT_MS_LANGID_ENGLISH_BELIZE                    0x2809\n#define TT_MS_LANGID_ENGLISH_TRINIDAD                  0x2c09\n#define TT_MS_LANGID_ENGLISH_ZIMBABWE                  0x3009\n#define TT_MS_LANGID_ENGLISH_PHILIPPINES               0x3409\n#define TT_MS_LANGID_ENGLISH_INDONESIA                 0x3809\n#define TT_MS_LANGID_ENGLISH_HONG_KONG                 0x3c09\n#define TT_MS_LANGID_ENGLISH_INDIA                     0x4009\n#define TT_MS_LANGID_ENGLISH_MALAYSIA                  0x4409\n#define TT_MS_LANGID_ENGLISH_SINGAPORE                 0x4809\n#define TT_MS_LANGID_SPANISH_SPAIN_TRADITIONAL_SORT    0x040a\n#define TT_MS_LANGID_SPANISH_MEXICO                    0x080a\n#define TT_MS_LANGID_SPANISH_SPAIN_INTERNATIONAL_SORT  0x0c0a\n#define TT_MS_LANGID_SPANISH_GUATEMALA                 0x100a\n#define TT_MS_LANGID_SPANISH_COSTA_RICA                0x140a\n#define TT_MS_LANGID_SPANISH_PANAMA                    0x180a\n#define TT_MS_LANGID_SPANISH_DOMINICAN_REPUBLIC        0x1c0a\n#define TT_MS_LANGID_SPANISH_VENEZUELA                 0x200a\n#define TT_MS_LANGID_SPANISH_COLOMBIA                  0x240a\n#define TT_MS_LANGID_SPANISH_PERU                      0x280a\n#define TT_MS_LANGID_SPANISH_ARGENTINA                 0x2c0a\n#define TT_MS_LANGID_SPANISH_ECUADOR                   0x300a\n#define TT_MS_LANGID_SPANISH_CHILE                     0x340a\n#define TT_MS_LANGID_SPANISH_URUGUAY                   0x380a\n#define TT_MS_LANGID_SPANISH_PARAGUAY                  0x3c0a\n#define TT_MS_LANGID_SPANISH_BOLIVIA                   0x400a\n#define TT_MS_LANGID_SPANISH_EL_SALVADOR               0x440a\n#define TT_MS_LANGID_SPANISH_HONDURAS                  0x480a\n#define TT_MS_LANGID_SPANISH_NICARAGUA                 0x4c0a\n#define TT_MS_LANGID_SPANISH_PUERTO_RICO               0x500a\n#define TT_MS_LANGID_SPANISH_UNITED_STATES             0x540a\n  /* The following ID blatantly violate MS specs by using a */\n  /* sublanguage > 0x1F.                                    */\n#define TT_MS_LANGID_SPANISH_LATIN_AMERICA             0xE40aU\n#define TT_MS_LANGID_FINNISH_FINLAND                   0x040b\n#define TT_MS_LANGID_FRENCH_FRANCE                     0x040c\n#define TT_MS_LANGID_FRENCH_BELGIUM                    0x080c\n#define TT_MS_LANGID_FRENCH_CANADA                     0x0c0c\n#define TT_MS_LANGID_FRENCH_SWITZERLAND                0x100c\n#define TT_MS_LANGID_FRENCH_LUXEMBOURG                 0x140c\n#define TT_MS_LANGID_FRENCH_MONACO                     0x180c\n#define TT_MS_LANGID_FRENCH_WEST_INDIES                0x1c0c\n#define TT_MS_LANGID_FRENCH_REUNION                    0x200c\n#define TT_MS_LANGID_FRENCH_CONGO                      0x240c\n  /* which was formerly: */\n#define TT_MS_LANGID_FRENCH_ZAIRE  TT_MS_LANGID_FRENCH_CONGO\n#define TT_MS_LANGID_FRENCH_SENEGAL                    0x280c\n#define TT_MS_LANGID_FRENCH_CAMEROON                   0x2c0c\n#define TT_MS_LANGID_FRENCH_COTE_D_IVOIRE              0x300c\n#define TT_MS_LANGID_FRENCH_MALI                       0x340c\n#define TT_MS_LANGID_FRENCH_MOROCCO                    0x380c\n#define TT_MS_LANGID_FRENCH_HAITI                      0x3c0c\n  /* and another violation of the spec (see 0xE40aU) */\n#define TT_MS_LANGID_FRENCH_NORTH_AFRICA               0xE40cU\n#define TT_MS_LANGID_HEBREW_ISRAEL                     0x040d\n#define TT_MS_LANGID_HUNGARIAN_HUNGARY                 0x040e\n#define TT_MS_LANGID_ICELANDIC_ICELAND                 0x040f\n#define TT_MS_LANGID_ITALIAN_ITALY                     0x0410\n#define TT_MS_LANGID_ITALIAN_SWITZERLAND               0x0810\n#define TT_MS_LANGID_JAPANESE_JAPAN                    0x0411\n#define TT_MS_LANGID_KOREAN_EXTENDED_WANSUNG_KOREA     0x0412\n#define TT_MS_LANGID_KOREAN_JOHAB_KOREA                0x0812\n#define TT_MS_LANGID_DUTCH_NETHERLANDS                 0x0413\n#define TT_MS_LANGID_DUTCH_BELGIUM                     0x0813\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_BOKMAL           0x0414\n#define TT_MS_LANGID_NORWEGIAN_NORWAY_NYNORSK          0x0814\n#define TT_MS_LANGID_POLISH_POLAND                     0x0415\n#define TT_MS_LANGID_PORTUGUESE_BRAZIL                 0x0416\n#define TT_MS_LANGID_PORTUGUESE_PORTUGAL               0x0816\n#define TT_MS_LANGID_RHAETO_ROMANIC_SWITZERLAND        0x0417\n#define TT_MS_LANGID_ROMANIAN_ROMANIA                  0x0418\n#define TT_MS_LANGID_MOLDAVIAN_MOLDAVIA                0x0818\n#define TT_MS_LANGID_RUSSIAN_RUSSIA                    0x0419\n#define TT_MS_LANGID_RUSSIAN_MOLDAVIA                  0x0819\n#define TT_MS_LANGID_CROATIAN_CROATIA                  0x041a\n#define TT_MS_LANGID_SERBIAN_SERBIA_LATIN              0x081a\n#define TT_MS_LANGID_SERBIAN_SERBIA_CYRILLIC           0x0c1a\n\n#if 0  /* this used to be this value, but it looks like we were wrong */\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x101a\n#else  /* current sources say */\n#define TT_MS_LANGID_CROATIAN_BOSNIA_HERZEGOVINA       0x101a\n#define TT_MS_LANGID_BOSNIAN_BOSNIA_HERZEGOVINA        0x141a\n       /* and XPsp2 Platform SDK added (2004-07-26) */\n       /* Names are shortened to be significant within 40 chars. */\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_LATIN         0x181a\n#define TT_MS_LANGID_SERBIAN_BOSNIA_HERZ_CYRILLIC      0x181a\n#endif\n\n#define TT_MS_LANGID_SLOVAK_SLOVAKIA                   0x041b\n#define TT_MS_LANGID_ALBANIAN_ALBANIA                  0x041c\n#define TT_MS_LANGID_SWEDISH_SWEDEN                    0x041d\n#define TT_MS_LANGID_SWEDISH_FINLAND                   0x081d\n#define TT_MS_LANGID_THAI_THAILAND                     0x041e\n#define TT_MS_LANGID_TURKISH_TURKEY                    0x041f\n#define TT_MS_LANGID_URDU_PAKISTAN                     0x0420\n#define TT_MS_LANGID_URDU_INDIA                        0x0820\n#define TT_MS_LANGID_INDONESIAN_INDONESIA              0x0421\n#define TT_MS_LANGID_UKRAINIAN_UKRAINE                 0x0422\n#define TT_MS_LANGID_BELARUSIAN_BELARUS                0x0423\n#define TT_MS_LANGID_SLOVENE_SLOVENIA                  0x0424\n#define TT_MS_LANGID_ESTONIAN_ESTONIA                  0x0425\n#define TT_MS_LANGID_LATVIAN_LATVIA                    0x0426\n#define TT_MS_LANGID_LITHUANIAN_LITHUANIA              0x0427\n#define TT_MS_LANGID_CLASSIC_LITHUANIAN_LITHUANIA      0x0827\n#define TT_MS_LANGID_TAJIK_TAJIKISTAN                  0x0428\n#define TT_MS_LANGID_FARSI_IRAN                        0x0429\n#define TT_MS_LANGID_VIETNAMESE_VIET_NAM               0x042a\n#define TT_MS_LANGID_ARMENIAN_ARMENIA                  0x042b\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_LATIN            0x042c\n#define TT_MS_LANGID_AZERI_AZERBAIJAN_CYRILLIC         0x082c\n#define TT_MS_LANGID_BASQUE_SPAIN                      0x042d\n#define TT_MS_LANGID_SORBIAN_GERMANY                   0x042e\n#define TT_MS_LANGID_MACEDONIAN_MACEDONIA              0x042f\n#define TT_MS_LANGID_SUTU_SOUTH_AFRICA                 0x0430\n#define TT_MS_LANGID_TSONGA_SOUTH_AFRICA               0x0431\n#define TT_MS_LANGID_TSWANA_SOUTH_AFRICA               0x0432\n#define TT_MS_LANGID_VENDA_SOUTH_AFRICA                0x0433\n#define TT_MS_LANGID_XHOSA_SOUTH_AFRICA                0x0434\n#define TT_MS_LANGID_ZULU_SOUTH_AFRICA                 0x0435\n#define TT_MS_LANGID_AFRIKAANS_SOUTH_AFRICA            0x0436\n#define TT_MS_LANGID_GEORGIAN_GEORGIA                  0x0437\n#define TT_MS_LANGID_FAEROESE_FAEROE_ISLANDS           0x0438\n#define TT_MS_LANGID_HINDI_INDIA                       0x0439\n#define TT_MS_LANGID_MALTESE_MALTA                     0x043a\n  /* Added by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SAMI_NORTHERN_NORWAY              0x043b\n#define TT_MS_LANGID_SAMI_NORTHERN_SWEDEN              0x083b\n#define TT_MS_LANGID_SAMI_NORTHERN_FINLAND             0x0C3b\n#define TT_MS_LANGID_SAMI_LULE_NORWAY                  0x103b\n#define TT_MS_LANGID_SAMI_LULE_SWEDEN                  0x143b\n#define TT_MS_LANGID_SAMI_SOUTHERN_NORWAY              0x183b\n#define TT_MS_LANGID_SAMI_SOUTHERN_SWEDEN              0x1C3b\n#define TT_MS_LANGID_SAMI_SKOLT_FINLAND                0x203b\n#define TT_MS_LANGID_SAMI_INARI_FINLAND                0x243b\n  /* ... and we also keep our old identifier... */\n#define TT_MS_LANGID_SAAMI_LAPONIA                     0x043b\n\n#if 0 /* this seems to be a previous inversion */\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#else\n#define TT_MS_LANGID_SCOTTISH_GAELIC_UNITED_KINGDOM    0x083c\n#define TT_MS_LANGID_IRISH_GAELIC_IRELAND              0x043c\n#endif\n\n#define TT_MS_LANGID_YIDDISH_GERMANY                   0x043d\n#define TT_MS_LANGID_MALAY_MALAYSIA                    0x043e\n#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM           0x083e\n#define TT_MS_LANGID_KAZAK_KAZAKSTAN                   0x043f\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN /* Cyrillic*/ 0x0440\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_KIRGHIZ_KIRGHIZ_REPUBLIC \\\n          TT_MS_LANGID_KIRGHIZ_KIRGHIZSTAN\n\n#define TT_MS_LANGID_SWAHILI_KENYA                     0x0441\n#define TT_MS_LANGID_TURKMEN_TURKMENISTAN              0x0442\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN            0x0443\n#define TT_MS_LANGID_UZBEK_UZBEKISTAN_CYRILLIC         0x0843\n#define TT_MS_LANGID_TATAR_TATARSTAN                   0x0444\n#define TT_MS_LANGID_BENGALI_INDIA                     0x0445\n#define TT_MS_LANGID_BENGALI_BANGLADESH                0x0845\n#define TT_MS_LANGID_PUNJABI_INDIA                     0x0446\n#define TT_MS_LANGID_PUNJABI_ARABIC_PAKISTAN           0x0846\n#define TT_MS_LANGID_GUJARATI_INDIA                    0x0447\n#define TT_MS_LANGID_ORIYA_INDIA                       0x0448\n#define TT_MS_LANGID_TAMIL_INDIA                       0x0449\n#define TT_MS_LANGID_TELUGU_INDIA                      0x044a\n#define TT_MS_LANGID_KANNADA_INDIA                     0x044b\n#define TT_MS_LANGID_MALAYALAM_INDIA                   0x044c\n#define TT_MS_LANGID_ASSAMESE_INDIA                    0x044d\n#define TT_MS_LANGID_MARATHI_INDIA                     0x044e\n#define TT_MS_LANGID_SANSKRIT_INDIA                    0x044f\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA /* Cyrillic */ 0x0450\n#define TT_MS_LANGID_MONGOLIAN_MONGOLIA_MONGOLIAN      0x0850\n#define TT_MS_LANGID_TIBETAN_CHINA                     0x0451\n  /* Don't use the next constant!  It has            */\n  /*   (1) the wrong spelling (Dzonghka)             */\n  /*   (2) Microsoft doesn't officially define it -- */\n  /*       at least it is not in the List of Local   */\n  /*       ID Values.                                */\n  /*   (3) Dzongkha is not the same language as      */\n  /*       Tibetan, so merging it is wrong anyway.   */\n  /*                                                 */\n  /* TT_MS_LANGID_TIBETAN_BHUTAN is correct, BTW.    */\n#define TT_MS_LANGID_DZONGHKA_BHUTAN                   0x0851\n\n#if 0\n  /* the following used to be defined */\n#define TT_MS_LANGID_TIBETAN_BHUTAN                    0x0451\n  /* ... but it was changed; */\n#else\n  /* So we will continue to #define it, but with the correct value */\n#define TT_MS_LANGID_TIBETAN_BHUTAN   TT_MS_LANGID_DZONGHKA_BHUTAN\n#endif\n\n#define TT_MS_LANGID_WELSH_WALES                       0x0452\n#define TT_MS_LANGID_KHMER_CAMBODIA                    0x0453\n#define TT_MS_LANGID_LAO_LAOS                          0x0454\n#define TT_MS_LANGID_BURMESE_MYANMAR                   0x0455\n#define TT_MS_LANGID_GALICIAN_SPAIN                    0x0456\n#define TT_MS_LANGID_KONKANI_INDIA                     0x0457\n#define TT_MS_LANGID_MANIPURI_INDIA  /* Bengali */     0x0458\n#define TT_MS_LANGID_SINDHI_INDIA /* Arabic */         0x0459\n#define TT_MS_LANGID_SINDHI_PAKISTAN                   0x0859\n  /* Missing a LCID for Sindhi in Devanagari script */\n#define TT_MS_LANGID_SYRIAC_SYRIA                      0x045a\n#define TT_MS_LANGID_SINHALESE_SRI_LANKA               0x045b\n#define TT_MS_LANGID_CHEROKEE_UNITED_STATES            0x045c\n#define TT_MS_LANGID_INUKTITUT_CANADA                  0x045d\n#define TT_MS_LANGID_AMHARIC_ETHIOPIA                  0x045e\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO /* Arabic */    0x045f\n#define TT_MS_LANGID_TAMAZIGHT_MOROCCO_LATIN           0x085f\n  /* Missing a LCID for Tifinagh script */\n#define TT_MS_LANGID_KASHMIRI_PAKISTAN /* Arabic */    0x0460\n  /* Spelled this way by XPsp2 Platform SDK (2004-07-26) */\n  /* script is yet unclear... might be Arabic, Nagari or Sharada */\n#define TT_MS_LANGID_KASHMIRI_SASIA                    0x0860\n  /* ... and aliased (by MS) for compatibility reasons. */\n#define TT_MS_LANGID_KASHMIRI_INDIA TT_MS_LANGID_KASHMIRI_SASIA\n#define TT_MS_LANGID_NEPALI_NEPAL                      0x0461\n#define TT_MS_LANGID_NEPALI_INDIA                      0x0861\n#define TT_MS_LANGID_FRISIAN_NETHERLANDS               0x0462\n#define TT_MS_LANGID_PASHTO_AFGHANISTAN                0x0463\n#define TT_MS_LANGID_FILIPINO_PHILIPPINES              0x0464\n#define TT_MS_LANGID_DHIVEHI_MALDIVES                  0x0465\n  /* alias declared in Windows 2000 */\n#define TT_MS_LANGID_DIVEHI_MALDIVES  TT_MS_LANGID_DHIVEHI_MALDIVES\n#define TT_MS_LANGID_EDO_NIGERIA                       0x0466\n#define TT_MS_LANGID_FULFULDE_NIGERIA                  0x0467\n#define TT_MS_LANGID_HAUSA_NIGERIA                     0x0468\n#define TT_MS_LANGID_IBIBIO_NIGERIA                    0x0469\n#define TT_MS_LANGID_YORUBA_NIGERIA                    0x046a\n#define TT_MS_LANGID_QUECHUA_BOLIVIA                   0x046b\n#define TT_MS_LANGID_QUECHUA_ECUADOR                   0x086b\n#define TT_MS_LANGID_QUECHUA_PERU                      0x0c6b\n#define TT_MS_LANGID_SEPEDI_SOUTH_AFRICA               0x046c\n  /* Also spelled by XPsp2 Platform SDK (2004-07-26) */\n#define TT_MS_LANGID_SOTHO_SOUTHERN_SOUTH_AFRICA \\\n          TT_MS_LANGID_SEPEDI_SOUTH_AFRICA\n  /* language codes 0x046d, 0x046e and 0x046f are (still) unknown. */\n#define TT_MS_LANGID_IGBO_NIGERIA                      0x0470\n#define TT_MS_LANGID_KANURI_NIGERIA                    0x0471\n#define TT_MS_LANGID_OROMO_ETHIOPIA                    0x0472\n#define TT_MS_LANGID_TIGRIGNA_ETHIOPIA                 0x0473\n#define TT_MS_LANGID_TIGRIGNA_ERYTHREA                 0x0873\n  /* also spelled in the `Passport SDK' list as: */\n#define TT_MS_LANGID_TIGRIGNA_ERYTREA  TT_MS_LANGID_TIGRIGNA_ERYTHREA\n#define TT_MS_LANGID_GUARANI_PARAGUAY                  0x0474\n#define TT_MS_LANGID_HAWAIIAN_UNITED_STATES            0x0475\n#define TT_MS_LANGID_LATIN                             0x0476\n#define TT_MS_LANGID_SOMALI_SOMALIA                    0x0477\n  /* Note: Yi does not have a (proper) ISO 639-2 code, since it is mostly */\n  /*       not written (but OTOH the peculiar writing system is worth     */\n  /*       studying).                                                     */\n#define TT_MS_LANGID_YI_CHINA                          0x0478\n#define TT_MS_LANGID_PAPIAMENTU_NETHERLANDS_ANTILLES   0x0479\n  /* language codes from 0x047a to 0x047f are (still) unknown. */\n#define TT_MS_LANGID_UIGHUR_CHINA                      0x0480\n#define TT_MS_LANGID_MAORI_NEW_ZEALAND                 0x0481\n\n#if 0  /* not deemed useful for fonts */\n#define TT_MS_LANGID_HUMAN_INTERFACE_DEVICE            0x04ff\n#endif\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Possible values of the `name' identifier field in the name records of */\n  /* the TTF `name' table.  These values are platform independent.         */\n  /*                                                                       */\n#define TT_NAME_ID_COPYRIGHT            0\n#define TT_NAME_ID_FONT_FAMILY          1\n#define TT_NAME_ID_FONT_SUBFAMILY       2\n#define TT_NAME_ID_UNIQUE_ID            3\n#define TT_NAME_ID_FULL_NAME            4\n#define TT_NAME_ID_VERSION_STRING       5\n#define TT_NAME_ID_PS_NAME              6\n#define TT_NAME_ID_TRADEMARK            7\n\n  /* the following values are from the OpenType spec */\n#define TT_NAME_ID_MANUFACTURER         8\n#define TT_NAME_ID_DESIGNER             9\n#define TT_NAME_ID_DESCRIPTION          10\n#define TT_NAME_ID_VENDOR_URL           11\n#define TT_NAME_ID_DESIGNER_URL         12\n#define TT_NAME_ID_LICENSE              13\n#define TT_NAME_ID_LICENSE_URL          14\n  /* number 15 is reserved */\n#define TT_NAME_ID_PREFERRED_FAMILY     16\n#define TT_NAME_ID_PREFERRED_SUBFAMILY  17\n#define TT_NAME_ID_MAC_FULL_NAME        18\n\n  /* The following code is new as of 2000-01-21 */\n#define TT_NAME_ID_SAMPLE_TEXT          19\n\n  /* This is new in OpenType 1.3 */\n#define TT_NAME_ID_CID_FINDFONT_NAME    20\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Bit mask values for the Unicode Ranges from the TTF `OS2 ' table.     */\n  /*                                                                       */\n  /* Updated 02-Jul-2000.                                                  */\n  /*                                                                       */\n\n  /* General Scripts Area */\n\n  /* Bit  0   Basic Latin */\n#define TT_UCR_BASIC_LATIN                     (1L <<  0) /* U+0020-U+007E */\n  /* Bit  1   C1 Controls and Latin-1 Supplement */\n#define TT_UCR_LATIN1_SUPPLEMENT               (1L <<  1) /* U+0080-U+00FF */\n  /* Bit  2   Latin Extended-A */\n#define TT_UCR_LATIN_EXTENDED_A                (1L <<  2) /* U+0100-U+017F */\n  /* Bit  3   Latin Extended-B */\n#define TT_UCR_LATIN_EXTENDED_B                (1L <<  3) /* U+0180-U+024F */\n  /* Bit  4   IPA Extensions */\n#define TT_UCR_IPA_EXTENSIONS                  (1L <<  4) /* U+0250-U+02AF */\n  /* Bit  5   Spacing Modifier Letters */\n#define TT_UCR_SPACING_MODIFIER                (1L <<  5) /* U+02B0-U+02FF */\n  /* Bit  6   Combining Diacritical Marks */\n#define TT_UCR_COMBINING_DIACRITICS            (1L <<  6) /* U+0300-U+036F */\n  /* Bit  7   Greek and Coptic */\n#define TT_UCR_GREEK                           (1L <<  7) /* U+0370-U+03FF */\n  /* Bit  8 is reserved (was: Greek Symbols and Coptic) */\n  /* Bit  9   Cyrillic               + */\n  /*          Cyrillic Supplementary   */\n#define TT_UCR_CYRILLIC                        (1L <<  9) /* U+0400-U+04FF */\n                                                          /* U+0500-U+052F */\n  /* Bit 10   Armenian */\n#define TT_UCR_ARMENIAN                        (1L << 10) /* U+0530-U+058F */\n  /* Bit 11   Hebrew */\n#define TT_UCR_HEBREW                          (1L << 11) /* U+0590-U+05FF */\n  /* Bit 12 is reserved (was: Hebrew Extended) */\n  /* Bit 13   Arabic */\n#define TT_UCR_ARABIC                          (1L << 13) /* U+0600-U+06FF */\n  /* Bit 14 is reserved (was: Arabic Extended) */\n  /* Bit 15   Devanagari */\n#define TT_UCR_DEVANAGARI                      (1L << 15) /* U+0900-U+097F */\n  /* Bit 16   Bengali */\n#define TT_UCR_BENGALI                         (1L << 16) /* U+0980-U+09FF */\n  /* Bit 17   Gurmukhi */\n#define TT_UCR_GURMUKHI                        (1L << 17) /* U+0A00-U+0A7F */\n  /* Bit 18   Gujarati */\n#define TT_UCR_GUJARATI                        (1L << 18) /* U+0A80-U+0AFF */\n  /* Bit 19   Oriya */\n#define TT_UCR_ORIYA                           (1L << 19) /* U+0B00-U+0B7F */\n  /* Bit 20   Tamil */\n#define TT_UCR_TAMIL                           (1L << 20) /* U+0B80-U+0BFF */\n  /* Bit 21   Telugu */\n#define TT_UCR_TELUGU                          (1L << 21) /* U+0C00-U+0C7F */\n  /* Bit 22   Kannada */\n#define TT_UCR_KANNADA                         (1L << 22) /* U+0C80-U+0CFF */\n  /* Bit 23   Malayalam */\n#define TT_UCR_MALAYALAM                       (1L << 23) /* U+0D00-U+0D7F */\n  /* Bit 24   Thai */\n#define TT_UCR_THAI                            (1L << 24) /* U+0E00-U+0E7F */\n  /* Bit 25   Lao */\n#define TT_UCR_LAO                             (1L << 25) /* U+0E80-U+0EFF */\n  /* Bit 26   Georgian */\n#define TT_UCR_GEORGIAN                        (1L << 26) /* U+10A0-U+10FF */\n  /* Bit 27 is reserved (was Georgian Extended) */\n  /* Bit 28   Hangul Jamo */\n#define TT_UCR_HANGUL_JAMO                     (1L << 28) /* U+1100-U+11FF */\n  /* Bit 29   Latin Extended Additional */\n#define TT_UCR_LATIN_EXTENDED_ADDITIONAL       (1L << 29) /* U+1E00-U+1EFF */\n  /* Bit 30   Greek Extended */\n#define TT_UCR_GREEK_EXTENDED                  (1L << 30) /* U+1F00-U+1FFF */\n\n  /* Symbols Area */\n\n  /* Bit 31   General Punctuation */\n#define TT_UCR_GENERAL_PUNCTUATION             (1L << 31) /* U+2000-U+206F */\n  /* Bit 32   Superscripts And Subscripts */\n#define TT_UCR_SUPERSCRIPTS_SUBSCRIPTS         (1L <<  0) /* U+2070-U+209F */\n  /* Bit 33   Currency Symbols */\n#define TT_UCR_CURRENCY_SYMBOLS                (1L <<  1) /* U+20A0-U+20CF */\n  /* Bit 34   Combining Diacritical Marks For Symbols */\n#define TT_UCR_COMBINING_DIACRITICS_SYMB       (1L <<  2) /* U+20D0-U+20FF */\n  /* Bit 35   Letterlike Symbols */\n#define TT_UCR_LETTERLIKE_SYMBOLS              (1L <<  3) /* U+2100-U+214F */\n  /* Bit 36   Number Forms */\n#define TT_UCR_NUMBER_FORMS                    (1L <<  4) /* U+2150-U+218F */\n  /* Bit 37   Arrows                + */\n  /*          Supplemental Arrows-A + */\n  /*          Supplemental Arrows-B   */\n#define TT_UCR_ARROWS                          (1L <<  5) /* U+2190-U+21FF */\n                                                          /* U+27F0-U+27FF */\n                                                          /* U+2900-U+297F */\n  /* Bit 38   Mathematical Operators               + */\n  /*          Supplemental Mathematical Operators  + */\n  /*          Miscellaneous Mathematical Symbols-A + */\n  /*          Miscellaneous Mathematical Symbols-B   */\n#define TT_UCR_MATHEMATICAL_OPERATORS          (1L <<  6) /* U+2200-U+22FF */\n                                                          /* U+2A00-U+2AFF */\n                                                          /* U+27C0-U+27EF */\n                                                          /* U+2980-U+29FF */\n  /* Bit 39 Miscellaneous Technical */\n#define TT_UCR_MISCELLANEOUS_TECHNICAL         (1L <<  7) /* U+2300-U+23FF */\n  /* Bit 40   Control Pictures */\n#define TT_UCR_CONTROL_PICTURES                (1L <<  8) /* U+2400-U+243F */\n  /* Bit 41   Optical Character Recognition */\n#define TT_UCR_OCR                             (1L <<  9) /* U+2440-U+245F */\n  /* Bit 42   Enclosed Alphanumerics */\n#define TT_UCR_ENCLOSED_ALPHANUMERICS          (1L << 10) /* U+2460-U+24FF */\n  /* Bit 43   Box Drawing */\n#define TT_UCR_BOX_DRAWING                     (1L << 11) /* U+2500-U+257F */\n  /* Bit 44   Block Elements */\n#define TT_UCR_BLOCK_ELEMENTS                  (1L << 12) /* U+2580-U+259F */\n  /* Bit 45   Geometric Shapes */\n#define TT_UCR_GEOMETRIC_SHAPES                (1L << 13) /* U+25A0-U+25FF */\n  /* Bit 46   Miscellaneous Symbols */\n#define TT_UCR_MISCELLANEOUS_SYMBOLS           (1L << 14) /* U+2600-U+26FF */\n  /* Bit 47   Dingbats */\n#define TT_UCR_DINGBATS                        (1L << 15) /* U+2700-U+27BF */\n\n  /* CJK Phonetics and Symbols Area */\n\n  /* Bit 48   CJK Symbols and Punctuation */\n#define TT_UCR_CJK_SYMBOLS                     (1L << 16) /* U+3000-U+303F */\n  /* Bit 49   Hiragana */\n#define TT_UCR_HIRAGANA                        (1L << 17) /* U+3040-U+309F */\n  /* Bit 50   Katakana                     + */\n  /*          Katakana Phonetic Extensions   */\n#define TT_UCR_KATAKANA                        (1L << 18) /* U+30A0-U+30FF */\n                                                          /* U+31F0-U+31FF */\n  /* Bit 51   Bopomofo          + */\n  /*          Bopomofo Extended   */\n#define TT_UCR_BOPOMOFO                        (1L << 19) /* U+3100-U+312F */\n                                                          /* U+31A0-U+31BF */\n  /* Bit 52   Hangul Compatibility Jamo */\n#define TT_UCR_HANGUL_COMPATIBILITY_JAMO       (1L << 20) /* U+3130-U+318F */\n  /* Bit 53   Kanbun */\n#define TT_UCR_CJK_MISC                        (1L << 21) /* U+3190-U+319F */\n#define TT_UCR_KANBUN  TT_UCR_CJK_MISC\n  /* Bit 54   Enclosed CJK Letters and Months */\n#define TT_UCR_ENCLOSED_CJK_LETTERS_MONTHS     (1L << 22) /* U+3200-U+32FF */\n  /* Bit 55   CJK Compatibility */\n#define TT_UCR_CJK_COMPATIBILITY               (1L << 23) /* U+3300-U+33FF */\n\n  /* Hangul Syllables Area */\n\n  /* Bit 56   Hangul */\n#define TT_UCR_HANGUL                          (1L << 24) /* U+AC00-U+D7A3 */\n\n  /* Surrogates Area */\n\n  /* Bit 57   High Surrogates             + */\n  /*          High Private Use Surrogates + */\n  /*          Low Surrogates                */\n#define TT_UCR_SURROGATES                      (1L << 25) /* U+D800-U+DB7F */\n                                                          /* U+DB80-U+DBFF */\n                                                          /* U+DC00-U+DFFF */\n  /* According to OpenType specs v.1.3+, setting bit 57 implies that there */\n  /* is at least one codepoint beyond the Basic Multilingual Plane that is */\n  /* supported by this font.  So it really means:            >= U+10000    */\n\n  /* Bit 58 is reserved for Unicode SubRanges */\n\n  /* CJK Ideographs Area */\n\n  /* Bit 59   CJK Unified Ideographs             + */\n  /*          CJK Radicals Supplement            + */\n  /*          Kangxi Radicals                    + */\n  /*          Ideographic Description Characters + */\n  /*          CJK Unified Ideographs Extension A   */\n  /*          CJK Unified Ideographs Extension A + */\n  /*          CJK Unified Ideographs Extension B + */\n  /*          Kanbun                               */\n#define TT_UCR_CJK_UNIFIED_IDEOGRAPHS          (1L << 27) /* U+4E00-U+9FFF */\n                                                          /* U+2E80-U+2EFF */\n                                                          /* U+2F00-U+2FDF */\n                                                          /* U+2FF0-U+2FFF */\n                                                          /* U+3400-U+4DB5 */\n                                                          /*U+20000-U+2A6DF*/\n                                                          /* U+3190-U+319F */\n\n  /* Private Use Area */\n\n  /* Bit 60   Private Use */\n#define TT_UCR_PRIVATE_USE                     (1L << 28) /* U+E000-U+F8FF */\n\n  /* Compatibility Area and Specials */\n\n  /* Bit 61   CJK Compatibility Ideographs            + */\n  /*          CJK Compatibility Ideographs Supplement   */\n#define TT_UCR_CJK_COMPATIBILITY_IDEOGRAPHS    (1L << 29) /* U+F900-U+FAFF */\n                                                          /*U+2F800-U+2FA1F*/\n  /* Bit 62   Alphabetic Presentation Forms */\n#define TT_UCR_ALPHABETIC_PRESENTATION_FORMS   (1L << 30) /* U+FB00-U+FB4F */\n  /* Bit 63   Arabic Presentation Forms-A */\n#define TT_UCR_ARABIC_PRESENTATIONS_A          (1L << 31) /* U+FB50-U+FDFF */\n  /* Bit 64   Combining Half Marks */\n#define TT_UCR_COMBINING_HALF_MARKS            (1L <<  0) /* U+FE20-U+FE2F */\n  /* Bit 65   CJK Compatibility Forms */\n#define TT_UCR_CJK_COMPATIBILITY_FORMS         (1L <<  1) /* U+FE30-U+FE4F */\n  /* Bit 66   Small Form Variants */\n#define TT_UCR_SMALL_FORM_VARIANTS             (1L <<  2) /* U+FE50-U+FE6F */\n  /* Bit 67   Arabic Presentation Forms-B */\n#define TT_UCR_ARABIC_PRESENTATIONS_B          (1L <<  3) /* U+FE70-U+FEFE */\n  /* Bit 68   Halfwidth and Fullwidth Forms */\n#define TT_UCR_HALFWIDTH_FULLWIDTH_FORMS       (1L <<  4) /* U+FF00-U+FFEF */\n  /* Bit 69   Specials */\n#define TT_UCR_SPECIALS                        (1L <<  5) /* U+FFF0-U+FFFD */\n  /* Bit 70   Tibetan */\n#define TT_UCR_TIBETAN                         (1L <<  6) /* U+0F00-U+0FFF */\n  /* Bit 71   Syriac */\n#define TT_UCR_SYRIAC                          (1L <<  7) /* U+0700-U+074F */\n  /* Bit 72   Thaana */\n#define TT_UCR_THAANA                          (1L <<  8) /* U+0780-U+07BF */\n  /* Bit 73   Sinhala */\n#define TT_UCR_SINHALA                         (1L <<  9) /* U+0D80-U+0DFF */\n  /* Bit 74   Myanmar */\n#define TT_UCR_MYANMAR                         (1L << 10) /* U+1000-U+109F */\n  /* Bit 75   Ethiopic */\n#define TT_UCR_ETHIOPIC                        (1L << 11) /* U+1200-U+137F */\n  /* Bit 76   Cherokee */\n#define TT_UCR_CHEROKEE                        (1L << 12) /* U+13A0-U+13FF */\n  /* Bit 77   Unified Canadian Aboriginal Syllabics */\n#define TT_UCR_CANADIAN_ABORIGINAL_SYLLABICS   (1L << 13) /* U+1400-U+167F */\n  /* Bit 78   Ogham */\n#define TT_UCR_OGHAM                           (1L << 14) /* U+1680-U+169F */\n  /* Bit 79   Runic */\n#define TT_UCR_RUNIC                           (1L << 15) /* U+16A0-U+16FF */\n  /* Bit 80   Khmer */\n#define TT_UCR_KHMER                           (1L << 16) /* U+1780-U+17FF */\n  /* Bit 81   Mongolian */\n#define TT_UCR_MONGOLIAN                       (1L << 17) /* U+1800-U+18AF */\n  /* Bit 82   Braille Patterns */\n#define TT_UCR_BRAILLE                         (1L << 18) /* U+2800-U+28FF */\n  /* Bit 83   Yi Syllables + */\n  /*          Yi Radicals    */\n#define TT_UCR_YI                              (1L << 19) /* U+A000-U+A48F */\n                                                          /* U+A490-U+A4CF */\n  /* Bit 84   Tagalog  + */\n  /*          Hanunoo  + */\n  /*          Buhid    + */\n  /*          Tagbanwa   */\n#define TT_UCR_PHILIPPINE                      (1L << 20) /* U+1700-U+171F */\n                                                          /* U+1720-U+173F */\n                                                          /* U+1740-U+175F */\n                                                          /* U+1760-U+177F */\n  /* Bit 85   Old Italic */\n#define TT_UCR_OLD_ITALIC                      (1L << 21) /*U+10300-U+1032F*/\n  /* Bit 86   Gothic */\n#define TT_UCR_GOTHIC                          (1L << 22) /*U+10330-U+1034F*/\n  /* Bit 87   Deseret */\n#define TT_UCR_DESERET                         (1L << 23) /*U+10400-U+1044F*/\n  /* Bit 88   Byzantine Musical Symbols + */\n  /*          Musical Symbols             */\n#define TT_UCR_MUSICAL_SYMBOLS                 (1L << 24) /*U+1D000-U+1D0FF*/\n                                                          /*U+1D100-U+1D1FF*/\n  /* Bit 89   Mathematical Alphanumeric Symbols */\n#define TT_UCR_MATH_ALPHANUMERIC_SYMBOLS       (1L << 25) /*U+1D400-U+1D7FF*/\n  /* Bit 90   Private Use (plane 15) + */\n  /*          Private Use (plane 16)   */\n#define TT_UCR_PRIVATE_USE_SUPPLEMENTARY       (1L << 26) /*U+F0000-U+FFFFD*/\n                                                        /*U+100000-U+10FFFD*/\n  /* Bit 91   Variation Selectors */\n#define TT_UCR_VARIATION_SELECTORS             (1L << 27) /* U+FE00-U+FE0F */\n  /* Bit 92   Tags */\n#define TT_UCR_TAGS                            (1L << 28) /*U+E0000-U+E007F*/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Some compilers have a very limited length of identifiers.             */\n  /*                                                                       */\n#if defined( __TURBOC__ ) && __TURBOC__ < 0x0410 || defined( __PACIFIC__ )\n#define HAVE_LIMIT_ON_IDENTS\n#endif\n\n\n#ifndef HAVE_LIMIT_ON_IDENTS\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* Here some alias #defines in order to be clearer.                      */\n  /*                                                                       */\n  /* These are not always #defined to stay within the 31 character limit   */\n  /* which some compilers have.                                            */\n  /*                                                                       */\n  /* Credits go to Dave Hoo <dhoo@flash.net> for pointing out that modern  */\n  /* Borland compilers (read: from BC++ 3.1 on) can increase this limit.   */\n  /* If you get a warning with such a compiler, use the -i40 switch.       */\n  /*                                                                       */\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_A      \\\n         TT_UCR_ARABIC_PRESENTATIONS_A\n#define TT_UCR_ARABIC_PRESENTATION_FORMS_B      \\\n         TT_UCR_ARABIC_PRESENTATIONS_B\n\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS      \\\n         TT_UCR_COMBINING_DIACRITICS\n#define TT_UCR_COMBINING_DIACRITICAL_MARKS_SYMB \\\n         TT_UCR_COMBINING_DIACRITICS_SYMB\n\n\n#endif /* !HAVE_LIMIT_ON_IDENTS */\n\n\nFT_END_HEADER\n\n#endif /* __TTNAMEID_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/tttables.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttables.h                                                             */\n/*                                                                         */\n/*    Basic SFNT/TrueType tables definitions and interface                 */\n/*    (specification only).                                                */\n/*                                                                         */\n/*  Copyright 1996-2001, 2002, 2003, 2004, 2005 by                         */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTTABLES_H__\n#define __TTTABLES_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Section>                                                             */\n  /*    truetype_tables                                                    */\n  /*                                                                       */\n  /* <Title>                                                               */\n  /*    TrueType Tables                                                    */\n  /*                                                                       */\n  /* <Abstract>                                                            */\n  /*    TrueType specific table types and functions.                       */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    This section contains the definition of TrueType-specific tables   */\n  /*    as well as some routines used to access and process them.          */\n  /*                                                                       */\n  /*************************************************************************/\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Header                                                          */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType font header table.  All       */\n  /*    fields follow the TrueType specification.                          */\n  /*                                                                       */\n  typedef struct  TT_Header_\n  {\n    FT_Fixed   Table_Version;\n    FT_Fixed   Font_Revision;\n\n    FT_Long    CheckSum_Adjust;\n    FT_Long    Magic_Number;\n\n    FT_UShort  Flags;\n    FT_UShort  Units_Per_EM;\n\n    FT_Long    Created [2];\n    FT_Long    Modified[2];\n\n    FT_Short   xMin;\n    FT_Short   yMin;\n    FT_Short   xMax;\n    FT_Short   yMax;\n\n    FT_UShort  Mac_Style;\n    FT_UShort  Lowest_Rec_PPEM;\n\n    FT_Short   Font_Direction;\n    FT_Short   Index_To_Loc_Format;\n    FT_Short   Glyph_Data_Format;\n\n  } TT_Header;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_HoriHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType horizontal header, the `hhea' */\n  /*    table, as well as the corresponding horizontal metrics table,      */\n  /*    i.e., the `hmtx' table.                                            */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                :: The table version.                       */\n  /*                                                                       */\n  /*    Ascender               :: The font's ascender, i.e., the distance  */\n  /*                              from the baseline to the top-most of all */\n  /*                              glyph points found in the font.          */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoAscender' field */\n  /*                              of the OS/2 table instead if you want    */\n  /*                              the correct one.                         */\n  /*                                                                       */\n  /*    Descender              :: The font's descender, i.e., the distance */\n  /*                              from the baseline to the bottom-most of  */\n  /*                              all glyph points found in the font.  It  */\n  /*                              is negative.                             */\n  /*                                                                       */\n  /*                              This value is invalid in many fonts, as  */\n  /*                              it is usually set by the font designer,  */\n  /*                              and often reflects only a portion of the */\n  /*                              glyphs found in the font (maybe ASCII).  */\n  /*                                                                       */\n  /*                              You should use the `sTypoDescender'      */\n  /*                              field of the OS/2 table instead if you   */\n  /*                              want the correct one.                    */\n  /*                                                                       */\n  /*    Line_Gap               :: The font's line gap, i.e., the distance  */\n  /*                              to add to the ascender and descender to  */\n  /*                              get the BTB, i.e., the                   */\n  /*                              baseline-to-baseline distance for the    */\n  /*                              font.                                    */\n  /*                                                                       */\n  /*    advance_Width_Max      :: This field is the maximum of all advance */\n  /*                              widths found in the font.  It can be     */\n  /*                              used to compute the maximum width of an  */\n  /*                              arbitrary string of text.                */\n  /*                                                                       */\n  /*    min_Left_Side_Bearing  :: The minimum left side bearing of all     */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    min_Right_Side_Bearing :: The minimum right side bearing of all    */\n  /*                              glyphs within the font.                  */\n  /*                                                                       */\n  /*    xMax_Extent            :: The maximum horizontal extent (i.e., the */\n  /*                              `width' of a glyph's bounding box) for   */\n  /*                              all glyphs in the font.                  */\n  /*                                                                       */\n  /*    caret_Slope_Rise       :: The rise coefficient of the cursor's     */\n  /*                              slope of the cursor (slope=rise/run).    */\n  /*                                                                       */\n  /*    caret_Slope_Run        :: The run coefficient of the cursor's      */\n  /*                              slope.                                   */\n  /*                                                                       */\n  /*    Reserved               :: 10 reserved bytes.                       */\n  /*                                                                       */\n  /*    metric_Data_Format     :: Always 0.                                */\n  /*                                                                       */\n  /*    number_Of_HMetrics     :: Number of HMetrics entries in the `hmtx' */\n  /*                              table -- this value can be smaller than  */\n  /*                              the total number of glyphs in the font.  */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `hmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_HoriHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Width_Max;      /* advance width maximum */\n\n    FT_Short   min_Left_Side_Bearing;  /* minimum left-sb       */\n    FT_Short   min_Right_Side_Bearing; /* minimum right-sb      */\n    FT_Short   xMax_Extent;            /* xmax extents          */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_HMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they are used to connect the metrics header to the relevant    */\n    /* `HMTX' table.                                                      */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_HoriHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_VertHeader                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType vertical header, the `vhea'   */\n  /*    table, as well as the corresponding vertical metrics table, i.e.,  */\n  /*    the `vmtx' table.                                                  */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    Version                 :: The table version.                      */\n  /*                                                                       */\n  /*    Ascender                :: The font's ascender, i.e., the distance */\n  /*                               from the baseline to the top-most of    */\n  /*                               all glyph points found in the font.     */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoAscender'      */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Descender               :: The font's descender, i.e., the         */\n  /*                               distance from the baseline to the       */\n  /*                               bottom-most of all glyph points found   */\n  /*                               in the font.  It is negative.           */\n  /*                                                                       */\n  /*                               This value is invalid in many fonts, as */\n  /*                               it is usually set by the font designer, */\n  /*                               and often reflects only a portion of    */\n  /*                               the glyphs found in the font (maybe     */\n  /*                               ASCII).                                 */\n  /*                                                                       */\n  /*                               You should use the `sTypoDescender'     */\n  /*                               field of the OS/2 table instead if you  */\n  /*                               want the correct one.                   */\n  /*                                                                       */\n  /*    Line_Gap                :: The font's line gap, i.e., the distance */\n  /*                               to add to the ascender and descender to */\n  /*                               get the BTB, i.e., the                  */\n  /*                               baseline-to-baseline distance for the   */\n  /*                               font.                                   */\n  /*                                                                       */\n  /*    advance_Height_Max      :: This field is the maximum of all        */\n  /*                               advance heights found in the font.  It  */\n  /*                               can be used to compute the maximum      */\n  /*                               height of an arbitrary string of text.  */\n  /*                                                                       */\n  /*    min_Top_Side_Bearing    :: The minimum top side bearing of all     */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    min_Bottom_Side_Bearing :: The minimum bottom side bearing of all  */\n  /*                               glyphs within the font.                 */\n  /*                                                                       */\n  /*    yMax_Extent             :: The maximum vertical extent (i.e., the  */\n  /*                               `height' of a glyph's bounding box) for */\n  /*                               all glyphs in the font.                 */\n  /*                                                                       */\n  /*    caret_Slope_Rise        :: The rise coefficient of the cursor's    */\n  /*                               slope of the cursor (slope=rise/run).   */\n  /*                                                                       */\n  /*    caret_Slope_Run         :: The run coefficient of the cursor's     */\n  /*                               slope.                                  */\n  /*                                                                       */\n  /*    caret_Offset            :: The cursor's offset for slanted fonts.  */\n  /*                               This value is `reserved' in vmtx        */\n  /*                               version 1.0.                            */\n  /*                                                                       */\n  /*    Reserved                :: 8 reserved bytes.                       */\n  /*                                                                       */\n  /*    metric_Data_Format      :: Always 0.                               */\n  /*                                                                       */\n  /*    number_Of_HMetrics      :: Number of VMetrics entries in the       */\n  /*                               `vmtx' table -- this value can be       */\n  /*                               smaller than the total number of glyphs */\n  /*                               in the font.                            */\n  /*                                                                       */\n  /*    long_metrics           :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /*    short_metrics          :: A pointer into the `vmtx' table.         */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    IMPORTANT: The TT_HoriHeader and TT_VertHeader structures should   */\n  /*               be identical except for the names of their fields which */\n  /*               are different.                                          */\n  /*                                                                       */\n  /*               This ensures that a single function in the `ttload'     */\n  /*               module is able to read both the horizontal and vertical */\n  /*               headers.                                                */\n  /*                                                                       */\n  typedef struct  TT_VertHeader_\n  {\n    FT_Fixed   Version;\n    FT_Short   Ascender;\n    FT_Short   Descender;\n    FT_Short   Line_Gap;\n\n    FT_UShort  advance_Height_Max;      /* advance height maximum */\n\n    FT_Short   min_Top_Side_Bearing;    /* minimum left-sb or top-sb       */\n    FT_Short   min_Bottom_Side_Bearing; /* minimum right-sb or bottom-sb   */\n    FT_Short   yMax_Extent;             /* xmax or ymax extents            */\n    FT_Short   caret_Slope_Rise;\n    FT_Short   caret_Slope_Run;\n    FT_Short   caret_Offset;\n\n    FT_Short   Reserved[4];\n\n    FT_Short   metric_Data_Format;\n    FT_UShort  number_Of_VMetrics;\n\n    /* The following fields are not defined by the TrueType specification */\n    /* but they're used to connect the metrics header to the relevant     */\n    /* `HMTX' or `VMTX' table.                                            */\n\n    void*      long_metrics;\n    void*      short_metrics;\n\n  } TT_VertHeader;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_OS2                                                             */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType OS/2 table. This is the long  */\n  /*    table version.  All fields comply to the TrueType specification.   */\n  /*                                                                       */\n  /*    Note that we now support old Mac fonts which do not include an     */\n  /*    OS/2 table.  In this case, the `version' field is always set to    */\n  /*    0xFFFF.                                                            */\n  /*                                                                       */\n  typedef struct  TT_OS2_\n  {\n    FT_UShort  version;                /* 0x0001 - more or 0xFFFF */\n    FT_Short   xAvgCharWidth;\n    FT_UShort  usWeightClass;\n    FT_UShort  usWidthClass;\n    FT_Short   fsType;\n    FT_Short   ySubscriptXSize;\n    FT_Short   ySubscriptYSize;\n    FT_Short   ySubscriptXOffset;\n    FT_Short   ySubscriptYOffset;\n    FT_Short   ySuperscriptXSize;\n    FT_Short   ySuperscriptYSize;\n    FT_Short   ySuperscriptXOffset;\n    FT_Short   ySuperscriptYOffset;\n    FT_Short   yStrikeoutSize;\n    FT_Short   yStrikeoutPosition;\n    FT_Short   sFamilyClass;\n\n    FT_Byte    panose[10];\n\n    FT_ULong   ulUnicodeRange1;        /* Bits 0-31   */\n    FT_ULong   ulUnicodeRange2;        /* Bits 32-63  */\n    FT_ULong   ulUnicodeRange3;        /* Bits 64-95  */\n    FT_ULong   ulUnicodeRange4;        /* Bits 96-127 */\n\n    FT_Char    achVendID[4];\n\n    FT_UShort  fsSelection;\n    FT_UShort  usFirstCharIndex;\n    FT_UShort  usLastCharIndex;\n    FT_Short   sTypoAscender;\n    FT_Short   sTypoDescender;\n    FT_Short   sTypoLineGap;\n    FT_UShort  usWinAscent;\n    FT_UShort  usWinDescent;\n\n    /* only version 1 tables: */\n\n    FT_ULong   ulCodePageRange1;       /* Bits 0-31   */\n    FT_ULong   ulCodePageRange2;       /* Bits 32-63  */\n\n    /* only version 2 tables: */\n\n    FT_Short   sxHeight;\n    FT_Short   sCapHeight;\n    FT_UShort  usDefaultChar;\n    FT_UShort  usBreakChar;\n    FT_UShort  usMaxContext;\n\n  } TT_OS2;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_Postscript                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType Postscript table.  All fields */\n  /*    comply to the TrueType specification.  This structure does not     */\n  /*    reference the Postscript glyph names, which can be nevertheless    */\n  /*    accessed with the `ttpost' module.                                 */\n  /*                                                                       */\n  typedef struct  TT_Postscript_\n  {\n    FT_Fixed  FormatType;\n    FT_Fixed  italicAngle;\n    FT_Short  underlinePosition;\n    FT_Short  underlineThickness;\n    FT_ULong  isFixedPitch;\n    FT_ULong  minMemType42;\n    FT_ULong  maxMemType42;\n    FT_ULong  minMemType1;\n    FT_ULong  maxMemType1;\n\n    /* Glyph names follow in the file, but we don't   */\n    /* load them by default.  See the ttpost.c file.  */\n\n  } TT_Postscript;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_PCLT                                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    A structure used to model a TrueType PCLT table.  All fields       */\n  /*    comply to the TrueType specification.                              */\n  /*                                                                       */\n  typedef struct  TT_PCLT_\n  {\n    FT_Fixed   Version;\n    FT_ULong   FontNumber;\n    FT_UShort  Pitch;\n    FT_UShort  xHeight;\n    FT_UShort  Style;\n    FT_UShort  TypeFamily;\n    FT_UShort  CapHeight;\n    FT_UShort  SymbolSet;\n    FT_Char    TypeFace[16];\n    FT_Char    CharacterComplement[8];\n    FT_Char    FileName[6];\n    FT_Char    StrokeWeight;\n    FT_Char    WidthType;\n    FT_Byte    SerifStyle;\n    FT_Byte    Reserved;\n\n  } TT_PCLT;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Struct>                                                              */\n  /*    TT_MaxProfile                                                      */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    The maximum profile is a table containing many max values which    */\n  /*    can be used to pre-allocate arrays.  This ensures that no memory   */\n  /*    allocation occurs during a glyph load.                             */\n  /*                                                                       */\n  /* <Fields>                                                              */\n  /*    version               :: The version number.                       */\n  /*                                                                       */\n  /*    numGlyphs             :: The number of glyphs in this TrueType     */\n  /*                             font.                                     */\n  /*                                                                       */\n  /*    maxPoints             :: The maximum number of points in a         */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositePoints'.                     */\n  /*                                                                       */\n  /*    maxContours           :: The maximum number of contours in a       */\n  /*                             non-composite TrueType glyph.  See also   */\n  /*                             the structure element                     */\n  /*                             `maxCompositeContours'.                   */\n  /*                                                                       */\n  /*    maxCompositePoints    :: The maximum number of points in a         */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxPoints'.            */\n  /*                                                                       */\n  /*    maxCompositeContours  :: The maximum number of contours in a       */\n  /*                             composite TrueType glyph.  See also the   */\n  /*                             structure element `maxContours'.          */\n  /*                                                                       */\n  /*    maxZones              :: The maximum number of zones used for      */\n  /*                             glyph hinting.                            */\n  /*                                                                       */\n  /*    maxTwilightPoints     :: The maximum number of points in the       */\n  /*                             twilight zone used for glyph hinting.     */\n  /*                                                                       */\n  /*    maxStorage            :: The maximum number of elements in the     */\n  /*                             storage area used for glyph hinting.      */\n  /*                                                                       */\n  /*    maxFunctionDefs       :: The maximum number of function            */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxInstructionDefs    :: The maximum number of instruction         */\n  /*                             definitions in the TrueType bytecode for  */\n  /*                             this font.                                */\n  /*                                                                       */\n  /*    maxStackElements      :: The maximum number of stack elements used */\n  /*                             during bytecode interpretation.           */\n  /*                                                                       */\n  /*    maxSizeOfInstructions :: The maximum number of TrueType opcodes    */\n  /*                             used for glyph hinting.                   */\n  /*                                                                       */\n  /*    maxComponentElements  :: The maximum number of simple (i.e., non-  */\n  /*                             composite) glyphs in a composite glyph.   */\n  /*                                                                       */\n  /*    maxComponentDepth     :: The maximum nesting depth of composite    */\n  /*                             glyphs.                                   */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    This structure is only used during font loading.                   */\n  /*                                                                       */\n  typedef struct  TT_MaxProfile_\n  {\n    FT_Fixed   version;\n    FT_UShort  numGlyphs;\n    FT_UShort  maxPoints;\n    FT_UShort  maxContours;\n    FT_UShort  maxCompositePoints;\n    FT_UShort  maxCompositeContours;\n    FT_UShort  maxZones;\n    FT_UShort  maxTwilightPoints;\n    FT_UShort  maxStorage;\n    FT_UShort  maxFunctionDefs;\n    FT_UShort  maxInstructionDefs;\n    FT_UShort  maxStackElements;\n    FT_UShort  maxSizeOfInstructions;\n    FT_UShort  maxComponentElements;\n    FT_UShort  maxComponentDepth;\n\n  } TT_MaxProfile;\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Enum>                                                                */\n  /*    FT_Sfnt_Tag                                                        */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    An enumeration used to specify the index of an SFNT table.         */\n  /*    Used in the @FT_Get_Sfnt_Table API function.                       */\n  /*                                                                       */\n  typedef enum\n  {\n    ft_sfnt_head = 0,\n    ft_sfnt_maxp = 1,\n    ft_sfnt_os2  = 2,\n    ft_sfnt_hhea = 3,\n    ft_sfnt_vhea = 4,\n    ft_sfnt_post = 5,\n    ft_sfnt_pclt = 6,\n\n    sfnt_max   /* internal end mark */\n\n  } FT_Sfnt_Tag;\n\n  /* */\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_Sfnt_Table                                                  */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Returns a pointer to a given SFNT table within a face.             */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    face :: A handle to the source.                                    */\n  /*                                                                       */\n  /*    tag  :: The index of the SFNT table.                               */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    A type-less pointer to the table.  This will be 0 in case of       */\n  /*    error, or if the corresponding table was not found *OR* loaded     */\n  /*    from the file.                                                     */\n  /*                                                                       */\n  /* <Note>                                                                */\n  /*    The table is owned by the face object and disappears with it.      */\n  /*                                                                       */\n  /*    This function is only useful to access SFNT tables that are loaded */\n  /*    by the sfnt, truetype, and opentype drivers.  See @FT_Sfnt_Tag for */\n  /*    a list.                                                            */\n  /*                                                                       */\n  FT_EXPORT( void* )\n  FT_Get_Sfnt_Table( FT_Face      face,\n                     FT_Sfnt_Tag  tag );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Load_Sfnt_Table\n  *\n  * @description:\n  *   Loads any font table into client memory.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   tag ::\n  *     The four-byte tag of the table to load.  Use the value 0 if you want\n  *     to access the whole font file.  Otherwise, you can use one of the\n  *     definitions found in the @FT_TRUETYPE_TAGS_H file, or forge a new\n  *     one with @FT_MAKE_TAG.\n  *\n  *   offset ::\n  *     The starting offset in the table (or file if tag == 0).\n  *\n  * @output:\n  *   buffer ::\n  *     The target buffer address.  The client must ensure that the memory\n  *     array is big enough to hold the data.\n  *\n  * @inout:\n  *   length ::\n  *     If the `length' parameter is NULL, then try to load the whole table.\n  *     Return an error code if it fails.\n  *\n  *     Else, if `*length' is 0, exit immediately while returning the\n  *     table's (or file) full size in it.\n  *\n  *     Else the number of bytes to read from the table or file, from the\n  *     starting offset.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   If you need to determine the table's length you should first call this\n  *   function with `*length' set to 0, as in the following example:\n  *\n  *     {\n  *       FT_ULong  length = 0;\n  *\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length );\n  *       if ( error ) { ... table does not exist ... }\n  *\n  *       buffer = malloc( length );\n  *       if ( buffer == NULL ) { ... not enough memory ... }\n  *\n  *       error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length );\n  *       if ( error ) { ... could not load table ... }\n  *     }\n  */\n  FT_EXPORT( FT_Error )\n  FT_Load_Sfnt_Table( FT_Face    face,\n                      FT_ULong   tag,\n                      FT_Long    offset,\n                      FT_Byte*   buffer,\n                      FT_ULong*  length );\n\n\n /**************************************************************************\n  *\n  * @function:\n  *   FT_Sfnt_Table_Info\n  *\n  * @description:\n  *   Returns information on an SFNT table.\n  *\n  * @input:\n  *   face ::\n  *     A handle to the source face.\n  *\n  *   table_index ::\n  *     The index of an SFNT table.  The function returns\n  *     FT_Err_Table_Missing for an invalid value.\n  *\n  * @output:\n  *   tag ::\n  *     The name tag of the SFNT table.\n  *\n  *   length ::\n  *     The length of the SFNT table.\n  *\n  * @return:\n  *   FreeType error code.  0 means success.\n  *\n  * @note:\n  *   SFNT tables with length zero are treated as missing by Windows.\n  *\n  */\n  FT_EXPORT( FT_Error )\n  FT_Sfnt_Table_Info( FT_Face    face,\n                      FT_UInt    table_index,\n                      FT_ULong  *tag,\n                      FT_ULong  *length );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Language_ID                                            */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap language ID.  Definitions of    */\n  /*    language ID values are in `freetype/ttnameid.h'.                   */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The language ID of `charmap'.  If `charmap' doesn't belong to a    */\n  /*    TrueType/sfnt face, just return 0 as the default value.            */\n  /*                                                                       */\n  FT_EXPORT( FT_ULong )\n  FT_Get_CMap_Language_ID( FT_CharMap  charmap );\n\n\n  /*************************************************************************/\n  /*                                                                       */\n  /* <Function>                                                            */\n  /*    FT_Get_CMap_Format                                                 */\n  /*                                                                       */\n  /* <Description>                                                         */\n  /*    Return TrueType/sfnt specific cmap format.                         */\n  /*                                                                       */\n  /* <Input>                                                               */\n  /*    charmap ::                                                         */\n  /*      The target charmap.                                              */\n  /*                                                                       */\n  /* <Return>                                                              */\n  /*    The format of `charmap'.  If `charmap' doesn't belong to a         */\n  /*    TrueType/sfnt face, return -1.                                     */\n  /*                                                                       */\n  FT_EXPORT( FT_Long )\n  FT_Get_CMap_Format( FT_CharMap  charmap );\n\n  /* */\n\n\nFT_END_HEADER\n\n#endif /* __TTTABLES_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/tttags.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  tttags.h                                                               */\n/*                                                                         */\n/*    Tags for TrueType and OpenType tables (specification only).          */\n/*                                                                         */\n/*  Copyright 1996-2001, 2004, 2005 by                                     */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTAGS_H__\n#define __TTAGS_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n#define TTAG_avar  FT_MAKE_TAG( 'a', 'v', 'a', 'r' )\n#define TTAG_BASE  FT_MAKE_TAG( 'B', 'A', 'S', 'E' )\n#define TTAG_bdat  FT_MAKE_TAG( 'b', 'd', 'a', 't' )\n#define TTAG_BDF   FT_MAKE_TAG( 'B', 'D', 'F', ' ' )\n#define TTAG_bhed  FT_MAKE_TAG( 'b', 'h', 'e', 'd' )\n#define TTAG_bloc  FT_MAKE_TAG( 'b', 'l', 'o', 'c' )\n#define TTAG_bsln  FT_MAKE_TAG( 'b', 's', 'l', 'n' )\n#define TTAG_CFF   FT_MAKE_TAG( 'C', 'F', 'F', ' ' )\n#define TTAG_cmap  FT_MAKE_TAG( 'c', 'm', 'a', 'p' )\n#define TTAG_cvar  FT_MAKE_TAG( 'c', 'v', 'a', 'r' )\n#define TTAG_cvt   FT_MAKE_TAG( 'c', 'v', 't', ' ' )\n#define TTAG_DSIG  FT_MAKE_TAG( 'D', 'S', 'I', 'G' )\n#define TTAG_EBDT  FT_MAKE_TAG( 'E', 'B', 'D', 'T' )\n#define TTAG_EBLC  FT_MAKE_TAG( 'E', 'B', 'L', 'C' )\n#define TTAG_EBSC  FT_MAKE_TAG( 'E', 'B', 'S', 'C' )\n#define TTAG_feat  FT_MAKE_TAG( 'f', 'e', 'a', 't' )\n#define TTAG_fpgm  FT_MAKE_TAG( 'f', 'p', 'g', 'm' )\n#define TTAG_fvar  FT_MAKE_TAG( 'f', 'v', 'a', 'r' )\n#define TTAG_gasp  FT_MAKE_TAG( 'g', 'a', 's', 'p' )\n#define TTAG_GDEF  FT_MAKE_TAG( 'G', 'D', 'E', 'F' )\n#define TTAG_glyf  FT_MAKE_TAG( 'g', 'l', 'y', 'f' )\n#define TTAG_GPOS  FT_MAKE_TAG( 'G', 'P', 'O', 'S' )\n#define TTAG_GSUB  FT_MAKE_TAG( 'G', 'S', 'U', 'B' )\n#define TTAG_gvar  FT_MAKE_TAG( 'g', 'v', 'a', 'r' )\n#define TTAG_hdmx  FT_MAKE_TAG( 'h', 'd', 'm', 'x' )\n#define TTAG_head  FT_MAKE_TAG( 'h', 'e', 'a', 'd' )\n#define TTAG_hhea  FT_MAKE_TAG( 'h', 'h', 'e', 'a' )\n#define TTAG_hmtx  FT_MAKE_TAG( 'h', 'm', 't', 'x' )\n#define TTAG_JSTF  FT_MAKE_TAG( 'J', 'S', 'T', 'F' )\n#define TTAG_just  FT_MAKE_TAG( 'j', 'u', 's', 't' )\n#define TTAG_kern  FT_MAKE_TAG( 'k', 'e', 'r', 'n' )\n#define TTAG_lcar  FT_MAKE_TAG( 'l', 'c', 'a', 'r' )\n#define TTAG_loca  FT_MAKE_TAG( 'l', 'o', 'c', 'a' )\n#define TTAG_LTSH  FT_MAKE_TAG( 'L', 'T', 'S', 'H' )\n#define TTAG_maxp  FT_MAKE_TAG( 'm', 'a', 'x', 'p' )\n#define TTAG_META  FT_MAKE_TAG( 'M', 'E', 'T', 'A' )\n#define TTAG_MMFX  FT_MAKE_TAG( 'M', 'M', 'F', 'X' )\n#define TTAG_MMSD  FT_MAKE_TAG( 'M', 'M', 'S', 'D' )\n#define TTAG_mort  FT_MAKE_TAG( 'm', 'o', 'r', 't' )\n#define TTAG_morx  FT_MAKE_TAG( 'm', 'o', 'r', 'x' )\n#define TTAG_name  FT_MAKE_TAG( 'n', 'a', 'm', 'e' )\n#define TTAG_opbd  FT_MAKE_TAG( 'o', 'p', 'b', 'd' )\n#define TTAG_OS2   FT_MAKE_TAG( 'O', 'S', '/', '2' )\n#define TTAG_OTTO  FT_MAKE_TAG( 'O', 'T', 'T', 'O' )\n#define TTAG_PCLT  FT_MAKE_TAG( 'P', 'C', 'L', 'T' )\n#define TTAG_post  FT_MAKE_TAG( 'p', 'o', 's', 't' )\n#define TTAG_prep  FT_MAKE_TAG( 'p', 'r', 'e', 'p' )\n#define TTAG_prop  FT_MAKE_TAG( 'p', 'r', 'o', 'p' )\n#define TTAG_SING  FT_MAKE_TAG( 'S', 'I', 'N', 'G' )\n#define TTAG_trak  FT_MAKE_TAG( 't', 'r', 'a', 'k' )\n#define TTAG_true  FT_MAKE_TAG( 't', 'r', 'u', 'e' )\n#define TTAG_ttc   FT_MAKE_TAG( 't', 't', 'c', ' ' )\n#define TTAG_ttcf  FT_MAKE_TAG( 't', 't', 'c', 'f' )\n#define TTAG_VDMX  FT_MAKE_TAG( 'V', 'D', 'M', 'X' )\n#define TTAG_vhea  FT_MAKE_TAG( 'v', 'h', 'e', 'a' )\n#define TTAG_vmtx  FT_MAKE_TAG( 'v', 'm', 't', 'x' )\n\n\nFT_END_HEADER\n\n#endif /* __TTAGS_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/freetype/ttunpat.h",
    "content": "/***************************************************************************/\n/*                                                                         */\n/*  ttunpat.h                                                              */\n/*                                                                         */\n/*    Definitions for the unpatented TrueType hinting system               */\n/*                                                                         */\n/*  Copyright 2003, 2006 by                                                */\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\n/*                                                                         */\n/*  Written by Graham Asher <graham.asher@btinternet.com>                  */\n/*                                                                         */\n/*  This file is part of the FreeType project, and may only be used,       */\n/*  modified, and distributed under the terms of the FreeType project      */\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\n/*  this file you indicate that you have read the license and              */\n/*  understand and accept it fully.                                        */\n/*                                                                         */\n/***************************************************************************/\n\n\n#ifndef __TTUNPAT_H__\n#define __TTUNPAT_H__\n\n\n#include <ft2build.h>\n#include FT_FREETYPE_H\n\n#ifdef FREETYPE_H\n#error \"freetype.h of FreeType 1 has been loaded!\"\n#error \"Please fix the directory search order for header files\"\n#error \"so that freetype.h of FreeType 2 is found first.\"\n#endif\n\n\nFT_BEGIN_HEADER\n\n\n /***************************************************************************\n  *\n  * @constant:\n  *   FT_PARAM_TAG_UNPATENTED_HINTING\n  *\n  * @description:\n  *   A constant used as the tag of an @FT_Parameter structure to indicate\n  *   that unpatented methods only should be used by the TrueType bytecode\n  *   interpreter for a typeface opened by @FT_Open_Face.\n  *\n  */\n#define FT_PARAM_TAG_UNPATENTED_HINTING  FT_MAKE_TAG( 'u', 'n', 'p', 'a' )\n\n /* */\n\nFT_END_HEADER\n\n\n#endif /* __TTUNPAT_H__ */\n\n\n/* END */\n"
  },
  {
    "path": "libIGraph/include/ft2build.h",
    "content": "/***************************************************************************/\r\n/*                                                                         */\r\n/*  ft2build.h                                                             */\r\n/*                                                                         */\r\n/*    FreeType 2 build and setup macros.                                   */\r\n/*    (Generic version)                                                    */\r\n/*                                                                         */\r\n/*  Copyright 1996-2001, 2006 by                                           */\r\n/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */\r\n/*                                                                         */\r\n/*  This file is part of the FreeType project, and may only be used,       */\r\n/*  modified, and distributed under the terms of the FreeType project      */\r\n/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */\r\n/*  this file you indicate that you have read the license and              */\r\n/*  understand and accept it fully.                                        */\r\n/*                                                                         */\r\n/***************************************************************************/\r\n\r\n\r\n  /*************************************************************************/\r\n  /*                                                                       */\r\n  /* This file corresponds to the default `ft2build.h' file for            */\r\n  /* FreeType 2.  It uses the `freetype' include root.                     */\r\n  /*                                                                       */\r\n  /* Note that specific platforms might use a different configuration.     */\r\n  /* See builds/unix/ft2unix.h for an example.                             */\r\n  /*                                                                       */\r\n  /*************************************************************************/\r\n\r\n\r\n#ifndef __FT2_BUILD_GENERIC_H__\r\n#define __FT2_BUILD_GENERIC_H__\r\n\r\n#include <freetype/config/ftheader.h>\r\n\r\n#endif /* __FT2_BUILD_GENERIC_H__ */\r\n\r\n\r\n/* END */\r\n"
  },
  {
    "path": "libIGraph/jidctflt.c",
    "content": "/*\n * jidctflt.c\n *\n * Copyright (C) 1994-1998, Thomas G. Lane.\n * This file is part of the Independent JPEG Group's software.\n *\n * The authors make NO WARRANTY or representation, either express or implied,\n * with respect to this software, its quality, accuracy, merchantability, or \n * fitness for a particular purpose.  This software is provided \"AS IS\", and you,\n * its user, assume the entire risk as to its quality and accuracy.\n *\n * This software is copyright (C) 1991-1998, Thomas G. Lane.\n * All Rights Reserved except as specified below.\n *\n * Permission is hereby granted to use, copy, modify, and distribute this\n * software (or portions thereof) for any purpose, without fee, subject to these\n * conditions:\n * (1) If any part of the source code for this software is distributed, then this\n * README file must be included, with this copyright and no-warranty notice\n * unaltered; and any additions, deletions, or changes to the original files\n * must be clearly indicated in accompanying documentation.\n * (2) If only executable code is distributed, then the accompanying\n * documentation must state that \"this software is based in part on the work of\n * the Independent JPEG Group\".\n * (3) Permission for use of this software is granted only if the user accepts\n * full responsibility for any undesirable consequences; the authors accept\n * NO LIABILITY for damages of any kind.\n * \n * These conditions apply to any software derived from or based on the IJG code,\n * not just to the unmodified library.  If you use our work, you ought to\n * acknowledge us.\n * \n * Permission is NOT granted for the use of any IJG author's name or company name\n * in advertising or publicity relating to this software or products derived from\n * it.  This software may be referred to only as \"the Independent JPEG Group's\n * software\".\n * \n * We specifically permit and encourage the use of this software as the basis of\n * commercial products, provided that all warranty or liability claims are\n * assumed by the product vendor.\n *\n *\n * This file contains a floating-point implementation of the\n * inverse DCT (Discrete Cosine Transform).  In the IJG code, this routine\n * must also perform dequantization of the input coefficients.\n *\n * This implementation should be more accurate than either of the integer\n * IDCT implementations.  However, it may not give the same results on all\n * machines because of differences in roundoff behavior.  Speed will depend\n * on the hardware's floating point capacity.\n *\n * A 2-D IDCT can be done by 1-D IDCT on each column followed by 1-D IDCT\n * on each row (or vice versa, but it's more convenient to emit a row at\n * a time).  Direct algorithms are also available, but they are much more\n * complex and seem not to be any faster when reduced to code.\n *\n * This implementation is based on Arai, Agui, and Nakajima's algorithm for\n * scaled DCT.  Their original paper (Trans. IEICE E-71(11):1095) is in\n * Japanese, but the algorithm is described in the Pennebaker & Mitchell\n * JPEG textbook (see REFERENCES section in file README).  The following code\n * is based directly on figure 4-8 in P&M.\n * While an 8-point DCT cannot be done in less than 11 multiplies, it is\n * possible to arrange the computation so that many of the multiplies are\n * simple scalings of the final outputs.  These multiplies can then be\n * folded into the multiplications or divisions by the JPEG quantization\n * table entries.  The AA&N method leaves only 5 multiplies and 29 adds\n * to be done in the DCT itself.\n * The primary disadvantage of this method is that with a fixed-point\n * implementation, accuracy is lost due to imprecise representation of the\n * scaled quantization values.  However, that problem does not arise if\n * we use floating point arithmetic.\n */\n\n#include \"libIGraph.h\"\n\n#include \"tinyjpeg-internal.h\"\n\n#define DCTSIZE\t   8\n#define DCTSIZE2   (DCTSIZE*DCTSIZE)\n\n#define DEQUANTIZE(coef,quantval)  DCT_DESCALE1(((int)coef) * (quantval))\n\nstatic unsigned char descale_and_clamp(int x, int shift)\n{\n  x += (1UL<<(shift-1));\n  if (x<0)\n    x = (x >> shift) | ((~(0UL)) << (32-(shift)));\n  else\n    x >>= shift;\n  x += 128;\n  if (x>255)\n    return 255;\n  else if (x<0)\n    return 0;\n  else \n    return x;\n}\n\n/*\n * Perform dequantization and inverse DCT on one block of coefficients.\nNote: This has been hacked to use integer fixed-point calculations\n      as many embedded platforms don't have fast floating point units (if they have them at all)\n */\n\nvoid\ntinyjpeg_idct_float (struct component *compptr, uint8_t *output_buf, int stride)\n{\n  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;\n  int tmp10, tmp11, tmp12, tmp13;\n  int z5, z10, z11, z12, z13;\n  int16_t *inptr;\n  int *quantptr;\n  int *wsptr;\n  uint8_t *outptr;\n  int ctr;\n  int workspace[DCTSIZE2]; /* buffers data between passes */\n\n  /* Pass 1: process columns from input, store into work array. */\n\n  inptr = compptr->DCT;\n  quantptr = compptr->Q_table;\n  wsptr = workspace;\n  for (ctr = DCTSIZE; ctr > 0; ctr--) {\n    /* Due to quantization, we will usually find that many of the input\n     * coefficients are zero, especially the AC terms.  We can exploit this\n     * by short-circuiting the IDCT calculation for any column in which all\n     * the AC terms are zero.  In that case each output is equal to the\n     * DC coefficient (with scale factor as needed).\n     * With typical images and quantization tables, half or more of the\n     * column DCT calculations can be simplified this way.\n     */\n    \n    if (inptr[DCTSIZE*1] == 0 && inptr[DCTSIZE*2] == 0 &&\n\tinptr[DCTSIZE*3] == 0 && inptr[DCTSIZE*4] == 0 &&\n\tinptr[DCTSIZE*5] == 0 && inptr[DCTSIZE*6] == 0 &&\n\tinptr[DCTSIZE*7] == 0) {\n      /* AC terms all zero */\n      int dcval = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n      \n      wsptr[DCTSIZE*0] = dcval;\n      wsptr[DCTSIZE*1] = dcval;\n      wsptr[DCTSIZE*2] = dcval;\n      wsptr[DCTSIZE*3] = dcval;\n      wsptr[DCTSIZE*4] = dcval;\n      wsptr[DCTSIZE*5] = dcval;\n      wsptr[DCTSIZE*6] = dcval;\n      wsptr[DCTSIZE*7] = dcval;\n      \n      inptr++;\t\t\t/* advance pointers to next column */\n      quantptr++;\n      wsptr++;\n      continue;\n    }\n    \n    /* Even part */\n\n    tmp0 = DEQUANTIZE(inptr[DCTSIZE*0], quantptr[DCTSIZE*0]);\n    tmp1 = DEQUANTIZE(inptr[DCTSIZE*2], quantptr[DCTSIZE*2]);\n    tmp2 = DEQUANTIZE(inptr[DCTSIZE*4], quantptr[DCTSIZE*4]);\n    tmp3 = DEQUANTIZE(inptr[DCTSIZE*6], quantptr[DCTSIZE*6]);\n\n    tmp10 = tmp0 + tmp2;\t/* phase 3 */\n    tmp11 = tmp0 - tmp2;\n\n    tmp13 = tmp1 + tmp3;\t/* phases 5-3 */\n    tmp12 = DCT_DESCALE1((tmp1 - tmp3) * (DCT_FIX(1.414213562))) - tmp13; /* 2*c4 */\n\n    tmp0 = tmp10 + tmp13;\t/* phase 2 */\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n    \n    /* Odd part */\n\n    tmp4 = DEQUANTIZE(inptr[DCTSIZE*1], quantptr[DCTSIZE*1]);\n    tmp5 = DEQUANTIZE(inptr[DCTSIZE*3], quantptr[DCTSIZE*3]);\n    tmp6 = DEQUANTIZE(inptr[DCTSIZE*5], quantptr[DCTSIZE*5]);\n    tmp7 = DEQUANTIZE(inptr[DCTSIZE*7], quantptr[DCTSIZE*7]);\n\n    z13 = tmp6 + tmp5;\t\t/* phase 6 */\n    z10 = tmp6 - tmp5;\n    z11 = tmp4 + tmp7;\n    z12 = tmp4 - tmp7;\n\n    tmp7 = z11 + z13;\t\t/* phase 5 */\n    tmp11 = DCT_DESCALE1((z11 - z13) * (DCT_FIX(1.414213562))); /* 2*c4 */\n\n    z5 = DCT_DESCALE1((z10 + z12) * (DCT_FIX(1.847759065))); /* 2*c2 */\n    tmp10 = DCT_DESCALE1((DCT_FIX(1.082392200)) * z12) - z5; /* 2*(c2-c6) */\n    tmp12 = DCT_DESCALE1((DCT_FIX(-2.613125930)) * z10) + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\t/* phase 2 */\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    wsptr[DCTSIZE*0] = tmp0 + tmp7;\n    wsptr[DCTSIZE*7] = tmp0 - tmp7;\n    wsptr[DCTSIZE*1] = tmp1 + tmp6;\n    wsptr[DCTSIZE*6] = tmp1 - tmp6;\n    wsptr[DCTSIZE*2] = tmp2 + tmp5;\n    wsptr[DCTSIZE*5] = tmp2 - tmp5;\n    wsptr[DCTSIZE*4] = tmp3 + tmp4;\n    wsptr[DCTSIZE*3] = tmp3 - tmp4;\n\n    inptr++;\t\t\t/* advance pointers to next column */\n    quantptr++;\n    wsptr++;\n  }\n  \n  /* Pass 2: process rows from work array, store into output array. */\n  /* Note that we must descale the results by a factor of 8 == 2**3. */\n\n  wsptr = workspace;\n  outptr = output_buf;\n  for (ctr = 0; ctr < DCTSIZE; ctr++) {\n    /* Rows of zeroes can be exploited in the same way as we did with columns.\n     * However, the column calculation has created many nonzero AC terms, so\n     * the simplification applies less often (typically 5% to 10% of the time).\n     * And testing floats for zero is relatively expensive, so we don't bother.\n     */\n    \n    /* Even part */\n\n    tmp10 = wsptr[0] + wsptr[4];\n    tmp11 = wsptr[0] - wsptr[4];\n\n    tmp13 = wsptr[2] + wsptr[6];\n    tmp12 = DCT_DESCALE1((wsptr[2] - wsptr[6]) * (DCT_FIX(1.414213562))) - tmp13;\n\n    tmp0 = tmp10 + tmp13;\n    tmp3 = tmp10 - tmp13;\n    tmp1 = tmp11 + tmp12;\n    tmp2 = tmp11 - tmp12;\n\n    /* Odd part */\n\n    z13 = wsptr[5] + wsptr[3];\n    z10 = wsptr[5] - wsptr[3];\n    z11 = wsptr[1] + wsptr[7];\n    z12 = wsptr[1] - wsptr[7];\n\n    tmp7 = z11 + z13;\n    tmp11 = DCT_DESCALE1((z11 - z13) * (DCT_FIX(1.414213562)));\n\n    z5 = DCT_DESCALE1((z10 + z12) * (DCT_FIX(1.847759065))); /* 2*c2 */\n    tmp10 = DCT_DESCALE1((DCT_FIX(1.082392200)) * z12) - z5; /* 2*(c2-c6) */\n    tmp12 = DCT_DESCALE1((DCT_FIX(-2.613125930)) * z10) + z5; /* -2*(c2+c6) */\n\n    tmp6 = tmp12 - tmp7;\n    tmp5 = tmp11 - tmp6;\n    tmp4 = tmp10 + tmp5;\n\n    /* Final output stage: scale down by a factor of 8 and range-limit */\n\n    outptr[0] = descale_and_clamp((int)(tmp0 + tmp7), 3);\n    outptr[7] = descale_and_clamp((int)(tmp0 - tmp7), 3);\n    outptr[1] = descale_and_clamp((int)(tmp1 + tmp6), 3);\n    outptr[6] = descale_and_clamp((int)(tmp1 - tmp6), 3);\n    outptr[2] = descale_and_clamp((int)(tmp2 + tmp5), 3);\n    outptr[5] = descale_and_clamp((int)(tmp2 - tmp5), 3);\n    outptr[4] = descale_and_clamp((int)(tmp3 + tmp4), 3);\n    outptr[3] = descale_and_clamp((int)(tmp3 - tmp4), 3);\n\n    \n    wsptr += DCTSIZE;\t\t/* advance pointer to next row */\n    outptr += stride;\n  }\n}\n\n"
  },
  {
    "path": "libIGraph/libIGraph.c",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#include \"libIGraph.h\"\n"
  },
  {
    "path": "libIGraph/libIGraph.def",
    "content": "LIBRARY\t\"libIGraph\"\nEXPORTS\n\tGetScreen\t\t\t\t\t@1\n\tDisposeGraphics\t\t\t\t@2\n\tClear\t\t\t\t\t\t@3\n\tCreatePen_Color\t\t\t\t@4\n\tDisposePen\t\t\t\t\t@5\n\tDrawLine_Ints\t\t\t\t@6\n\tFillRectangle_Ints\t\t\t@7\n\tCreateBrush_Solid\t\t\t@8\n\tDisposeBrush\t\t\t\t@9\n\tCreateFontFamily_Name\t\t@10\n\t_CreateFont\t\t\t\t\t@11\n\tDrawString\t\t\t\t\t@12\n\tDisposeFont\t\t\t\t\t@13\n\tDisposeFontFamily\t\t\t@14\n\tCreateStringFormat\t\t\t@15\n\tDisposeStringFormat\t\t\t@16\n\tStringFormat_SetTrimming\t@17\n\tTextRenderingHint_Set\t\t@18\n\t_CreateBitmap\t\t\t\t@19\n\tGetGraphicsFromImage\t\t@20\n\tDrawImageUnscaled\t\t\t@21\n\tDisposeImage\t\t\t\t@22\n\tBitmapFromFile\t\t\t\t@23\n\tStringFormat_SetAlignment\t@24\n\tStringFormat_SetLineAlignment @25\n\tStringFormat_SetFormatFlags\t@26\n\tCreateBrush_Hatch\t\t\t@27\n\tIsKeyDown_Internal\t\t\t@28\n\tLatestKeyUp_Internal\t\t@29\n\tLatestKeyDown_Internal\t\t@30\n\tCreateBrush_LinearGradient\t@31\n\tCreateRegion_Rect\t\t\t@32\n\tDisposeRegion\t\t\t\t@33\n\tGraphics_SetClip\t\t\t@34\n\tCreateRegion_Infinite\t\t@35\n\tMeasureString\t\t\t\t@36\n\tDrawEllipse_Ints\t\t\t@37\n\tFillEllipse_Ints\t\t\t@38\n\tGraphics_CopyFromScreen\t\t@39"
  },
  {
    "path": "libIGraph/libIGraph.h",
    "content": "// Copyright (c) 2012 DotNetAnywhere\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __LIBIGRAPH_H\n#define __LIBIGRAPH_H\n\n#include \"Config.h\"\n\n// Bitmap format indexes used in the function look-ups.\n#define FMT_NUM 2\n#define FMT_4BPP_GRAY 0\n#define FMT_32BPP_ARGB 1\n\n#define TMALLOC(type) (type*)malloc(sizeof(type))\n\n#define PT_TO_PIXEL_X(pt) ((I32)(((pt) * 84) / 57))\n#define PT_TO_PIXEL_Y(pt) ((I32)(((pt) * 84) / 57))\n\n#define ABS(x) (((x)<0)?(-(x)):(x))\n#define SWAP_I32(a,b) {I32 __tmp = a;a=b;b=__tmp;}\n\n#define A(col) ((col) >> 24)\n#define R(col) (((col) >> 16) & 0xff)\n#define G(col) (((col) >> 8) & 0xff)\n#define B(col) ((col) & 0xff)\n#define ARGB(a,r,g,b) ((U32)(((a) << 24) | (((r) & 0xff) << 16) | (((g) & 0xff) << 8) | ((b) & 0xff)))\n\n// A crude approximation of R*0.3 + G*0.59 + B*0.11\n#define COL2GRAY(col) ((R(col) >> 2) + (G(col) >> 1) + (B(col) >> 2))\n\ntypedef unsigned char* STRING;\ntypedef unsigned short* STRING2;\n\n#ifdef WIN32\n\n#pragma warning(disable:4996)\n\ntypedef int I32;\ntypedef unsigned int U32;\ntypedef short I16;\ntypedef unsigned short U16;\ntypedef char I8;\ntypedef unsigned char U8;\n\ntypedef U16 uint16_t;\ntypedef I16 int16_t;\ntypedef U8 uint8_t;\ntypedef I8 int8_t;\n\n#define EXPORT(returnType) __declspec(dllexport) returnType __stdcall\n\n#undef INVERT_4BPP_GRAY\n\n#define DIR_SEPARATOR \"\\\\\"\n\n#include <windows.h>\n#include <io.h>\n\n#define snprintf _snprintf\n\n#else\n\n#include <sys/types.h>\n#include <sys/mman.h>\n#include <unistd.h>\n\n#define EXPORT(returnType) returnType\n\n#define INVERT_4BPP_GRAY\n\n#define DIR_SEPARATOR \"/\"\n\n#define O_BINARY 0\n\ntypedef U16 uint16_t;\ntypedef U8 uint8_t;\n\n#endif\n\n#define inline\n\n#define FONT_DIR \".\" DIR_SEPARATOR \"Fonts\" DIR_SEPARATOR\n\n#include <stdlib.h>\n#include <stdio.h>\n#include <fcntl.h>\n\n#endif\n"
  },
  {
    "path": "libIGraph/libIGraph.vcproj",
    "content": "<?xml version=\"1.0\" encoding=\"Windows-1252\"?>\r\n<VisualStudioProject\r\n\tProjectType=\"Visual C++\"\r\n\tVersion=\"9.00\"\r\n\tName=\"libIGraph\"\r\n\tProjectGUID=\"{E8C90D0B-0F97-485C-8765-FC14202EF252}\"\r\n\tRootNamespace=\"libIGraph\"\r\n\tKeyword=\"Win32Proj\"\r\n\tTargetFrameworkVersion=\"131072\"\r\n\t>\r\n\t<Platforms>\r\n\t\t<Platform\r\n\t\t\tName=\"Win32\"\r\n\t\t/>\r\n\t</Platforms>\r\n\t<ToolFiles>\r\n\t</ToolFiles>\r\n\t<Configurations>\r\n\t\t<Configuration\r\n\t\t\tName=\"Debug|Win32\"\r\n\t\t\tOutputDirectory=\"$(ProjectDir)$(ConfigurationName)\"\r\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\r\n\t\t\tConfigurationType=\"2\"\r\n\t\t\tCharacterSet=\"1\"\r\n\t\t\t>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPreBuildEventTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCCustomBuildTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCMIDLTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCCLCompilerTool\"\r\n\t\t\t\tOptimization=\"0\"\r\n\t\t\t\tAdditionalIncludeDirectories=\"include;include/freetype2\"\r\n\t\t\t\tPreprocessorDefinitions=\"WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBIGRAPH_EXPORTS\"\r\n\t\t\t\tMinimalRebuild=\"true\"\r\n\t\t\t\tBasicRuntimeChecks=\"3\"\r\n\t\t\t\tRuntimeLibrary=\"3\"\r\n\t\t\t\tUsePrecompiledHeader=\"0\"\r\n\t\t\t\tWarningLevel=\"3\"\r\n\t\t\t\tDetect64BitPortabilityProblems=\"true\"\r\n\t\t\t\tDebugInformationFormat=\"4\"\r\n\t\t\t\tCompileAs=\"1\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCResourceCompilerTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPreLinkEventTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCLinkerTool\"\r\n\t\t\t\tAdditionalDependencies=\"lib\\freetype.lib\"\r\n\t\t\t\tLinkIncremental=\"2\"\r\n\t\t\t\tModuleDefinitionFile=\"libIGraph.def\"\r\n\t\t\t\tGenerateDebugInformation=\"true\"\r\n\t\t\t\tSubSystem=\"2\"\r\n\t\t\t\tRandomizedBaseAddress=\"1\"\r\n\t\t\t\tDataExecutionPrevention=\"0\"\r\n\t\t\t\tTargetMachine=\"1\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCALinkTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCManifestTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCXDCMakeTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCBscMakeTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCFxCopTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCAppVerifierTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPostBuildEventTool\"\r\n\t\t\t\tCommandLine=\"copy $(TargetDir)$(TargetFileName) $(SolutionDir)Builds\\$(ConfigurationName)\\&#x0D;&#x0A;copy $(ProjectDir)\\freetype.dll $(SolutionDir)Builds\\$(ConfigurationName)\\\"\r\n\t\t\t/>\r\n\t\t</Configuration>\r\n\t\t<Configuration\r\n\t\t\tName=\"Release|Win32\"\r\n\t\t\tOutputDirectory=\"$(ProjectDir)$(ConfigurationName)\"\r\n\t\t\tIntermediateDirectory=\"$(ConfigurationName)\"\r\n\t\t\tConfigurationType=\"2\"\r\n\t\t\tCharacterSet=\"1\"\r\n\t\t\tWholeProgramOptimization=\"1\"\r\n\t\t\t>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPreBuildEventTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCCustomBuildTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCXMLDataGeneratorTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCMIDLTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCCLCompilerTool\"\r\n\t\t\t\tAdditionalIncludeDirectories=\"include;include/freetype2\"\r\n\t\t\t\tPreprocessorDefinitions=\"WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBIGRAPH_EXPORTS\"\r\n\t\t\t\tRuntimeLibrary=\"2\"\r\n\t\t\t\tUsePrecompiledHeader=\"0\"\r\n\t\t\t\tWarningLevel=\"3\"\r\n\t\t\t\tDetect64BitPortabilityProblems=\"true\"\r\n\t\t\t\tDebugInformationFormat=\"3\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCManagedResourceCompilerTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCResourceCompilerTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPreLinkEventTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCLinkerTool\"\r\n\t\t\t\tAdditionalDependencies=\"lib\\freetype.lib\"\r\n\t\t\t\tLinkIncremental=\"1\"\r\n\t\t\t\tModuleDefinitionFile=\"libIGraph.def\"\r\n\t\t\t\tGenerateDebugInformation=\"true\"\r\n\t\t\t\tSubSystem=\"2\"\r\n\t\t\t\tOptimizeReferences=\"2\"\r\n\t\t\t\tEnableCOMDATFolding=\"2\"\r\n\t\t\t\tRandomizedBaseAddress=\"1\"\r\n\t\t\t\tDataExecutionPrevention=\"0\"\r\n\t\t\t\tTargetMachine=\"1\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCALinkTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCManifestTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCXDCMakeTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCBscMakeTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCFxCopTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCAppVerifierTool\"\r\n\t\t\t/>\r\n\t\t\t<Tool\r\n\t\t\t\tName=\"VCPostBuildEventTool\"\r\n\t\t\t\tCommandLine=\"copy $(TargetPath) $(SolutionDir)\\dna\\\"\r\n\t\t\t/>\r\n\t\t</Configuration>\r\n\t</Configurations>\r\n\t<References>\r\n\t</References>\r\n\t<Files>\r\n\t\t<Filter\r\n\t\t\tName=\"Source Files\"\r\n\t\t\tFilter=\"cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx\"\r\n\t\t\tUniqueIdentifier=\"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}\"\r\n\t\t\t>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Bitmap.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\BitmapLoader.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Brush.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\DrawEllipses.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\DrawLines.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\DrawRectangles.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Exports.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Font.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\FontFamily.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\GetScreen.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Graphics.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Image.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\libIGraph.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\libIGraph.def\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Pen.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Pixels.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Region.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\StringFormat.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Text.c\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<Filter\r\n\t\t\t\tName=\"JPEG\"\r\n\t\t\t\t>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\jidctflt.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\tinyjpeg.c\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t</Filter>\r\n\t\t</Filter>\r\n\t\t<Filter\r\n\t\t\tName=\"Header Files\"\r\n\t\t\tFilter=\"h;hpp;hxx;hm;inl;inc;xsd\"\r\n\t\t\tUniqueIdentifier=\"{93995380-89BD-4b04-88EB-625FBE52EBFB}\"\r\n\t\t\t>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Bitmap.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Brush.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Config.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\DrawEllipses.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\DrawLines.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\DrawRectangles.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Font.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\FontFamily.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\GetScreen.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Graphics.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\HatchBrushDefs.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Image.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\libIGraph.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Pen.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Pixels.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Region.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\StringFormat.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<File\r\n\t\t\t\tRelativePath=\".\\Text.h\"\r\n\t\t\t\t>\r\n\t\t\t</File>\r\n\t\t\t<Filter\r\n\t\t\t\tName=\"JPEG\"\r\n\t\t\t\t>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\tinyjpeg-internal.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t\t<File\r\n\t\t\t\t\tRelativePath=\".\\tinyjpeg.h\"\r\n\t\t\t\t\t>\r\n\t\t\t\t</File>\r\n\t\t\t</Filter>\r\n\t\t</Filter>\r\n\t\t<Filter\r\n\t\t\tName=\"Resource Files\"\r\n\t\t\tFilter=\"rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav\"\r\n\t\t\tUniqueIdentifier=\"{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}\"\r\n\t\t\t>\r\n\t\t</Filter>\r\n\t</Files>\r\n\t<Globals>\r\n\t</Globals>\r\n</VisualStudioProject>\r\n"
  },
  {
    "path": "libIGraph/tinyjpeg-internal.h",
    "content": "/*\n * Small jpeg decoder library (Internal header)\n *\n * Copyright (c) 2006, Luc Saillard <luc@saillard.org>\n * All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * \n * - Redistributions of source code must retain the above copyright notice,\n *  this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright notice,\n *  this list of conditions and the following disclaimer in the documentation\n *  and/or other materials provided with the distribution.\n *\n * - Neither the name of the author nor the names of its contributors may be\n *  used to endorse or promote products derived from this software without\n *  specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n */\n\n\n#ifndef __TINYJPEG_INTERNAL_H_\n#define __TINYJPEG_INTERNAL_H_\n\n#include <setjmp.h>\n\n#define SANITY_CHECK 1\n\nstruct jdec_private;\n\n#define DCT_SCALE 10\n#define DCT_FIX(x) ((int)(x * (1 << DCT_SCALE)))\n#define DCT_DESCALE1(x) (x >> DCT_SCALE)\n\n#define HUFFMAN_BITS_SIZE  256\n#define HUFFMAN_HASH_NBITS 9\n#define HUFFMAN_HASH_SIZE  (1UL<<HUFFMAN_HASH_NBITS)\n#define HUFFMAN_HASH_MASK  (HUFFMAN_HASH_SIZE-1)\n\n#define HUFFMAN_TABLES\t   4\n#define COMPONENTS\t   3\n#define JPEG_MAX_WIDTH\t   2048\n#define JPEG_MAX_HEIGHT\t   2048\n\nstruct huffman_table\n{\n  /* Fast look up table, using HUFFMAN_HASH_NBITS bits we can have directly the symbol,\n   * if the symbol is <0, then we need to look into the tree table */\n  short int lookup[HUFFMAN_HASH_SIZE];\n  /* code size: give the number of bits of a symbol is encoded */\n  unsigned char code_size[HUFFMAN_HASH_SIZE];\n  /* some place to store value that is not encoded in the lookup table \n   * FIXME: Calculate if 256 value is enough to store all values\n   */\n  uint16_t slowtable[16-HUFFMAN_HASH_NBITS][256];\n};\n\nstruct component \n{\n  unsigned int Hfactor;\n  unsigned int Vfactor;\n  int *Q_table;\t\t/* Pointer to the quantisation table to use */\n  struct huffman_table *AC_table;\n  struct huffman_table *DC_table;\n  short int previous_DC;\t/* Previous DC coefficient */\n  short int DCT[64];\t\t/* DCT coef */\n#if SANITY_CHECK\n  unsigned int cid;\n#endif\n};\n\n\ntypedef void (*decode_MCU_fct) (struct jdec_private *priv);\ntypedef void (*convert_colorspace_fct) (struct jdec_private *priv);\n\nstruct jdec_private\n{\n  /* Public variables */\n  uint8_t *components[COMPONENTS];\n  unsigned int width, height;\t/* Size of the image */\n  unsigned int flags;\n\n  /* Private variables */\n  const unsigned char *stream_begin, *stream_end;\n  unsigned int stream_length;\n\n  const unsigned char *stream;\t/* Pointer to the current stream */\n  unsigned int reservoir, nbits_in_reservoir;\n\n  struct component component_infos[COMPONENTS];\n  int Q_tables[COMPONENTS][64];\t\t/* quantization tables */\n  struct huffman_table HTDC[HUFFMAN_TABLES];\t/* DC huffman tables   */\n  struct huffman_table HTAC[HUFFMAN_TABLES];\t/* AC huffman tables   */\n  int default_huffman_table_initialized;\n  int restart_interval;\n  int restarts_to_go;\t\t\t\t/* MCUs left in this restart interval */\n  int last_rst_marker_seen;\t\t\t/* Rst marker is incremented each time */\n\n  /* Temp space used after the IDCT to store each components */\n  uint8_t Y[64*4], Cr[64], Cb[64];\n\n  jmp_buf jump_state;\n  /* Internal Pointer use for colorspace conversion, do not modify it !!! */\n  uint8_t *plane[COMPONENTS];\n\n};\n\n#if defined(__GNUC__) && (__GNUC__ > 3) && defined(__OPTIMIZE__)\n#define __likely(x)       __builtin_expect(!!(x), 1)\n#define __unlikely(x)     __builtin_expect(!!(x), 0)\n#else\n#define __likely(x)       (x)\n#define __unlikely(x)     (x)\n#endif\n\n#define IDCT tinyjpeg_idct_float\nvoid tinyjpeg_idct_float (struct component *compptr, uint8_t *output_buf, int stride);\n\n#endif\n\n"
  },
  {
    "path": "libIGraph/tinyjpeg.c",
    "content": "/*\n* Small jpeg decoder library\n*\n* Copyright (c) 2006, Luc Saillard <luc@saillard.org>\n* All rights reserved.\n* Redistribution and use in source and binary forms, with or without\n* modification, are permitted provided that the following conditions are met:\n* \n* - Redistributions of source code must retain the above copyright notice,\n*  this list of conditions and the following disclaimer.\n*\n* - Redistributions in binary form must reproduce the above copyright notice,\n*  this list of conditions and the following disclaimer in the documentation\n*  and/or other materials provided with the distribution.\n*\n* - Neither the name of the author nor the names of its contributors may be\n*  used to endorse or promote products derived from this software without\n*  specific prior written permission.\n* \n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n* POSSIBILITY OF SUCH DAMAGE.\n*\n*/\n\n#include \"libIGraph.h\"\n\n#include \"tinyjpeg.h\"\n#include \"tinyjpeg-internal.h\"\n\nenum std_markers {\n\tDQT  = 0xDB, /* Define Quantization Table */\n\tSOF  = 0xC0, /* Start of Frame (size information) */\n\tDHT  = 0xC4, /* Huffman Table */\n\tSOI  = 0xD8, /* Start of Image */\n\tSOS  = 0xDA, /* Start of Scan */\n\tRST  = 0xD0, /* Reset Marker d0 -> .. */\n\tRST7 = 0xD7, /* Reset Marker .. -> d7 */\n\tEOI  = 0xD9, /* End of Image */\n\tDRI  = 0xDD, /* Define Restart Interval */\n\tAPP0 = 0xE0,\n};\n\n#define cY\t0\n#define cCb\t1\n#define cCr\t2\n\n#define BLACK_Y 0\n#define BLACK_U 127\n#define BLACK_V 127\n\n/*#if DEBUG\n#define trace(fmt, args...) do { \\\nfprintf(stderr, fmt, ## args); \\\nfflush(stderr); \\\n} while(0)\n#else\n#define trace(fmt, args...) do { } while (0)\n#endif*/\n#define error0(fmt) do { \\\n\tsnprintf(error_string, sizeof(error_string), fmt); \\\n\treturn -1; \\\n\t} while(0)\n#define error1(fmt, a) do { \\\n\tsnprintf(error_string, sizeof(error_string), fmt, a); \\\n\treturn -1; \\\n\t} while(0)\n#define error2(fmt, a, b) do { \\\n\tsnprintf(error_string, sizeof(error_string), fmt, a, b); \\\n\treturn -1; \\\n\t} while(0)\n#define error4(fmt, a, b, c, d) do { \\\n\tsnprintf(error_string, sizeof(error_string), fmt, a, b, c, d); \\\n\treturn -1; \\\n\t} while(0)\n\n\n#if 0\nstatic char *print_bits(unsigned int value, char *bitstr)\n{\n\tint i, j;\n\ti=31;\n\twhile (i>0)\n\t{\n\t\tif (value & (1UL<<i))\n\t\t\tbreak;\n\t\ti--;\n\t}\n\tj=0;\n\twhile (i>=0)\n\t{\n\t\tbitstr[j++] = (value & (1UL<<i))?'1':'0';\n\t\ti--;\n\t}\n\tbitstr[j] = 0;\n\treturn bitstr;\n}\n\nstatic void print_next_16bytes(int offset, const unsigned char *stream)\n{\n\ttrace(\"%4.4x: %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\\n\",\n\t\toffset,\n\t\tstream[0], stream[1], stream[2], stream[3], \n\t\tstream[4], stream[5], stream[6], stream[7],\n\t\tstream[8], stream[9], stream[10], stream[11], \n\t\tstream[12], stream[13], stream[14], stream[15]);\n}\n\n#endif\n\n/* Global variable to return the last error found while deconding */\nstatic char error_string[256];\n\nstatic const unsigned char zigzag[64] = \n{\n\t0,  1,  5,  6, 14, 15, 27, 28,\n\t2,  4,  7, 13, 16, 26, 29, 42,\n\t3,  8, 12, 17, 25, 30, 41, 43,\n\t9, 11, 18, 24, 31, 40, 44, 53,\n\t10, 19, 23, 32, 39, 45, 52, 54,\n\t20, 22, 33, 38, 46, 51, 55, 60,\n\t21, 34, 37, 47, 50, 56, 59, 61,\n\t35, 36, 48, 49, 57, 58, 62, 63\n};\n\n/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */\n/* IMPORTANT: these are only valid for 8-bit data precision! */\nstatic const unsigned char bits_dc_luminance[17] =\n{ \n\t0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 \n};\nstatic const unsigned char val_dc_luminance[] =\n{\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 \n};\n\nstatic const unsigned char bits_dc_chrominance[17] =\n{\n\t0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 \n};\nstatic const unsigned char val_dc_chrominance[] = \n{\n\t0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 \n};\n\nstatic const unsigned char bits_ac_luminance[17] =\n{\n\t0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d \n};\nstatic const unsigned char val_ac_luminance[] =\n{\n\t0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,\n\t0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,\n\t0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,\n\t0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,\n\t0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,\n\t0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,\n\t0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,\n\t0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,\n\t0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,\n\t0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,\n\t0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,\n\t0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,\n\t0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,\n\t0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,\n\t0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,\n\t0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,\n\t0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,\n\t0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,\n\t0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,\n\t0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n\t0xf9, 0xfa\n};\n\nstatic const unsigned char bits_ac_chrominance[17] =\n{ \n\t0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77 \n};\n\nstatic const unsigned char val_ac_chrominance[] =\n{\n\t0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,\n\t0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,\n\t0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,\n\t0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,\n\t0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,\n\t0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,\n\t0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,\n\t0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,\n\t0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,\n\t0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,\n\t0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,\n\t0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,\n\t0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,\n\t0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,\n\t0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,\n\t0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,\n\t0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,\n\t0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,\n\t0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,\n\t0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,\n\t0xf9, 0xfa\n};\n\n\n/*\n* 4 functions to manage the stream\n*\n*  fill_nbits: put at least nbits in the reservoir of bits.\n*              But convert any 0xff,0x00 into 0xff\n*  get_nbits: read nbits from the stream, and put it in result,\n*             bits is removed from the stream and the reservoir is filled\n*             automaticaly. The result is signed according to the number of\n*             bits.\n*  look_nbits: read nbits from the stream without marking as read.\n*  skip_nbits: read nbits from the stream but do not return the result.\n* \n* stream: current pointer in the jpeg data (read bytes per bytes)\n* nbits_in_reservoir: number of bits filled into the reservoir\n* reservoir: register that contains bits information. Only nbits_in_reservoir\n*            is valid.\n*                          nbits_in_reservoir\n*                        <--    17 bits    -->\n*            Ex: 0000 0000 1010 0000 1111 0000   <== reservoir\n*                        ^\n*                        bit 1\n*            To get two bits from this example\n*                 result = (reservoir >> 15) & 3\n*\n*/\n#define fill_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \\\n\twhile (nbits_in_reservoir<nbits_wanted) \\\n{ \\\n\tunsigned char c; \\\n\tif (stream >= priv->stream_end) \\\n\tlongjmp(priv->jump_state, -EOI); \\\n\tc = *stream++; \\\n\treservoir <<= 8; \\\n\tif (c == 0xff && *stream == 0x00) \\\n\tstream++; \\\n\treservoir |= c; \\\n\tnbits_in_reservoir+=8; \\\n\t} \\\n\t}  while(0);\n\n/* Signed version !!!! */\n#define get_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted,result) do { \\\n\tfill_nbits(reservoir,nbits_in_reservoir,stream,(nbits_wanted)); \\\n\tresult = ((reservoir)>>(nbits_in_reservoir-(nbits_wanted))); \\\n\tnbits_in_reservoir -= (nbits_wanted);  \\\n\treservoir &= ((1U<<nbits_in_reservoir)-1); \\\n\tif ((unsigned int)result < (1UL<<((nbits_wanted)-1))) \\\n\tresult += (0xFFFFFFFFUL<<(nbits_wanted))+1; \\\n\t}  while(0);\n\n#define look_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted,result) do { \\\n\tfill_nbits(reservoir,nbits_in_reservoir,stream,(nbits_wanted)); \\\n\tresult = ((reservoir)>>(nbits_in_reservoir-(nbits_wanted))); \\\n\t}  while(0);\n\n/* To speed up the decoding, we assume that the reservoir have enough bit \n* slow version:\n* #define skip_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \\\n*   fill_nbits(reservoir,nbits_in_reservoir,stream,(nbits_wanted)); \\\n*   nbits_in_reservoir -= (nbits_wanted); \\\n*   reservoir &= ((1U<<nbits_in_reservoir)-1); \\\n* }  while(0);\n*/\n#define skip_nbits(reservoir,nbits_in_reservoir,stream,nbits_wanted) do { \\\n\tnbits_in_reservoir -= (nbits_wanted); \\\n\treservoir &= ((1U<<nbits_in_reservoir)-1); \\\n\t}  while(0);\n\n\n#define be16_to_cpu(x) (((x)[0]<<8)|(x)[1])\n\nstatic void resync(struct jdec_private *priv);\n\n/**\n* Get the next (valid) huffman code in the stream.\n*\n* To speedup the procedure, we look HUFFMAN_HASH_NBITS bits and the code is\n* lower than HUFFMAN_HASH_NBITS we have automaticaly the length of the code\n* and the value by using two lookup table.\n* Else if the value is not found, just search (linear) into an array for each\n* bits is the code is present.\n*\n* If the code is not present for any reason, -1 is return.\n*/\nstatic int get_next_huffman_code(struct jdec_private *priv, struct huffman_table *huffman_table)\n{\n\tint value, hcode;\n\tunsigned int extra_nbits, nbits;\n\tuint16_t *slowtable;\n\n\tlook_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, HUFFMAN_HASH_NBITS, hcode);\n\tvalue = huffman_table->lookup[hcode];\n\tif (__likely(value >= 0))\n\t{ \n\t\tunsigned int code_size = huffman_table->code_size[value];\n\t\tskip_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, code_size);\n\t\treturn value;\n\t}\n\n\t/* Decode more bits each time ... */\n\tfor (extra_nbits=0; extra_nbits<16-HUFFMAN_HASH_NBITS; extra_nbits++)\n\t{\n\t\tnbits = HUFFMAN_HASH_NBITS + 1 + extra_nbits;\n\n\t\tlook_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, nbits, hcode);\n\t\tslowtable = huffman_table->slowtable[extra_nbits];\n\t\t/* Search if the code is in this array */\n\t\twhile (slowtable[0]) {\n\t\t\tif (slowtable[0] == hcode) {\n\t\t\t\tskip_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, nbits);\n\t\t\t\treturn slowtable[1];\n\t\t\t}\n\t\t\tslowtable+=2;\n\t\t}\n\t}\n\treturn 0;\n}\n\n\n\n\n/**\n*\n* Decode a single block that contains the DCT coefficients.\n* The table coefficients is already dezigzaged at the end of the operation.\n*\n*/\nstatic void process_Huffman_data_unit(struct jdec_private *priv, int component)\n{\n\tunsigned char j;\n\tunsigned int huff_code;\n\tunsigned char size_val, count_0;\n\n\tstruct component *c = &priv->component_infos[component];\n\tshort int DCT[64];\n\n\n\t/* Initialize the DCT coef table */\n\tmemset(DCT, 0, sizeof(DCT));\n\n\t/* DC coefficient decoding */\n\thuff_code = get_next_huffman_code(priv, c->DC_table);\n\t//trace(\"+ %x\\n\", huff_code);\n\tif (huff_code) {\n\t\tget_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, huff_code, DCT[0]);\n\t\tDCT[0] += c->previous_DC;\n\t\tc->previous_DC = DCT[0];\n\t} else {\n\t\tDCT[0] = c->previous_DC;\n\t}\n\n\t/* AC coefficient decoding */\n\tj = 1;\n\twhile (j<64)\n\t{\n\t\thuff_code = get_next_huffman_code(priv, c->AC_table);\n\t\t//trace(\"- %x\\n\", huff_code);\n\n\t\tsize_val = huff_code & 0xF;\n\t\tcount_0 = huff_code >> 4;\n\n\t\tif (size_val == 0)\n\t\t{ /* RLE */\n\t\t\tif (count_0 == 0)\n\t\t\t\tbreak;\t/* EOB found, go out */\n\t\t\telse if (count_0 == 0xF)\n\t\t\t\tj += 16;\t/* skip 16 zeros */\n\t\t}\n\t\telse\n\t\t{\n\t\t\tj += count_0;\t/* skip count_0 zeroes */\n\t\t\tif (__unlikely(j >= 64))\n\t\t\t{\n\t\t\t\tsnprintf(error_string, sizeof(error_string), \"Bad huffman data (buffer overflow)\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tget_nbits(priv->reservoir, priv->nbits_in_reservoir, priv->stream, size_val, DCT[j]);\n\t\t\tj++;\n\t\t}\n\t}\n\n\tfor (j = 0; j < 64; j++)\n\t\tc->DCT[j] = DCT[zigzag[j]];\n}\n\n/*\n* Takes two array of bits, and build the huffman table for size, and code\n* \n* lookup will return the symbol if the code is less or equal than HUFFMAN_HASH_NBITS.\n* code_size will be used to known how many bits this symbol is encoded.\n* slowtable will be used when the first lookup didn't give the result.\n*/\nstatic void build_huffman_table(const unsigned char *bits, const unsigned char *vals, struct huffman_table *table)\n{\n\tunsigned int i, j, code, code_size, val, nbits;\n\tunsigned char huffsize[HUFFMAN_BITS_SIZE+1], *hz;\n\tunsigned int huffcode[HUFFMAN_BITS_SIZE+1], *hc;\n\tint next_free_entry;\n\n\t/*\n\t* Build a temp array \n\t*   huffsize[X] => numbers of bits to write vals[X]\n\t*/\n\thz = huffsize;\n\tfor (i=1; i<=16; i++)\n\t{\n\t\tfor (j=1; j<=bits[i]; j++)\n\t\t\t*hz++ = i;\n\t}\n\t*hz = 0;\n\n\tmemset(table->lookup, 0xff, sizeof(table->lookup));\n\tfor (i=0; i<(16-HUFFMAN_HASH_NBITS); i++)\n\t\ttable->slowtable[i][0] = 0;\n\n\t/* Build a temp array\n\t*   huffcode[X] => code used to write vals[X]\n\t*/\n\tcode = 0;\n\thc = huffcode;\n\thz = huffsize;\n\tnbits = *hz;\n\twhile (*hz)\n\t{\n\t\twhile (*hz == nbits)\n\t\t{\n\t\t\t*hc++ = code++;\n\t\t\thz++;\n\t\t}\n\t\tcode <<= 1;\n\t\tnbits++;\n\t}\n\n\t/*\n\t* Build the lookup table, and the slowtable if needed.\n\t*/\n\tnext_free_entry = -1;\n\tfor (i=0; huffsize[i]; i++)\n\t{\n\t\tval = vals[i];\n\t\tcode = huffcode[i];\n\t\tcode_size = huffsize[i];\n\n\t\t//trace(\"val=%2.2x code=%8.8x codesize=%2.2d\\n\", val, code, code_size);\n\n\t\ttable->code_size[val] = code_size;\n\t\tif (code_size <= HUFFMAN_HASH_NBITS)\n\t\t{\n\t\t\t/*\n\t\t\t* Good: val can be put in the lookup table, so fill all value of this\n\t\t\t* column with value val \n\t\t\t*/\n\t\t\tint repeat = 1UL<<(HUFFMAN_HASH_NBITS - code_size);\n\t\t\tcode <<= HUFFMAN_HASH_NBITS - code_size;\n\t\t\twhile ( repeat-- )\n\t\t\t\ttable->lookup[code++] = val;\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/* Perhaps sorting the array will be an optimization */\n\t\t\tuint16_t *slowtable = table->slowtable[code_size-HUFFMAN_HASH_NBITS-1];\n\t\t\twhile(slowtable[0])\n\t\t\t\tslowtable+=2;\n\t\t\tslowtable[0] = code;\n\t\t\tslowtable[1] = val;\n\t\t\tslowtable[2] = 0;\n\t\t\t/* TODO: NEED TO CHECK FOR AN OVERFLOW OF THE TABLE */\n\t\t}\n\n\t}\n}\n\nstatic void build_default_huffman_tables(struct jdec_private *priv)\n{\n\tif (   (priv->flags & TINYJPEG_FLAGS_MJPEG_TABLE) \n\t\t&& priv->default_huffman_table_initialized)\n\t\treturn;\n\n\tbuild_huffman_table(bits_dc_luminance, val_dc_luminance, &priv->HTDC[0]);\n\tbuild_huffman_table(bits_ac_luminance, val_ac_luminance, &priv->HTAC[0]);\n\n\tbuild_huffman_table(bits_dc_chrominance, val_dc_chrominance, &priv->HTDC[1]);\n\tbuild_huffman_table(bits_ac_chrominance, val_ac_chrominance, &priv->HTAC[1]);\n\n\tpriv->default_huffman_table_initialized = 1;\n}\n\n\n\n/*******************************************************************************\n*\n* Colorspace conversion routine\n*\n*\n* Note:\n* YCbCr is defined per CCIR 601-1, except that Cb and Cr are\n* normalized to the range 0..MAXJSAMPLE rather than -0.5 .. 0.5.\n* The conversion equations to be implemented are therefore\n*      R = Y                + 1.40200 * Cr\n*      G = Y - 0.34414 * Cb - 0.71414 * Cr\n*      B = Y + 1.77200 * Cb\n* \n******************************************************************************/\n\nstatic unsigned char clamp(int i)\n{\n\tif (i<0)\n\t\treturn 0;\n\telse if (i>255)\n\t\treturn 255;\n\telse\n\t\treturn i;\n}   \n\n\n/**\n*  YCrCb -> YUV420P (1x1)\n*  .---.\n*  | 1 |\n*  `---'\n*/\nstatic void YCrCB_to_YUV420P_1x1(struct jdec_private *priv)\n{\n\tconst unsigned char *s, *y;\n\tunsigned char *p;\n\tint i,j;\n\n\tp = priv->plane[0];\n\ty = priv->Y;\n\tfor (i=0; i<8; i++)\n\t{\n\t\tmemcpy(p, y, 8);\n\t\tp+=priv->width;\n\t\ty+=8;\n\t}\n\n\tp = priv->plane[1];\n\ts = priv->Cb;\n\tfor (i=0; i<8; i+=2)\n\t{\n\t\tfor (j=0; j<8; j+=2, s+=2)\n\t\t\t*p++ = *s;\n\t\ts += 8; /* Skip one line */\n\t\tp += priv->width/2 - 4;\n\t}\n\n\tp = priv->plane[2];\n\ts = priv->Cr;\n\tfor (i=0; i<8; i+=2)\n\t{\n\t\tfor (j=0; j<8; j+=2, s+=2)\n\t\t\t*p++ = *s;\n\t\ts += 8; /* Skip one line */\n\t\tp += priv->width/2 - 4;\n\t}\n}\n\n/**\n*  YCrCb -> YUV420P (2x1)\n*  .-------.\n*  | 1 | 2 |\n*  `-------'\n*/\nstatic void YCrCB_to_YUV420P_2x1(struct jdec_private *priv)\n{\n\tunsigned char *p;\n\tconst unsigned char *s, *y1;\n\tunsigned int i;\n\n\tp = priv->plane[0];\n\ty1 = priv->Y;\n\tfor (i=0; i<8; i++)\n\t{\n\t\tmemcpy(p, y1, 16);\n\t\tp += priv->width;\n\t\ty1 += 16;\n\t}\n\n\tp = priv->plane[1];\n\ts = priv->Cb;\n\tfor (i=0; i<8; i+=2)\n\t{\n\t\tmemcpy(p, s, 8);\n\t\ts += 16; /* Skip one line */\n\t\tp += priv->width/2;\n\t}\n\n\tp = priv->plane[2];\n\ts = priv->Cr;\n\tfor (i=0; i<8; i+=2)\n\t{\n\t\tmemcpy(p, s, 8);\n\t\ts += 16; /* Skip one line */\n\t\tp += priv->width/2;\n\t}\n}\n\n\n/**\n*  YCrCb -> YUV420P (1x2)\n*  .---.\n*  | 1 |\n*  |---|\n*  | 2 |\n*  `---'\n*/\nstatic void YCrCB_to_YUV420P_1x2(struct jdec_private *priv)\n{\n\tconst unsigned char *s, *y;\n\tunsigned char *p;\n\tint i,j;\n\n\tp = priv->plane[0];\n\ty = priv->Y;\n\tfor (i=0; i<16; i++)\n\t{\n\t\tmemcpy(p, y, 8);\n\t\tp+=priv->width;\n\t\ty+=8;\n\t}\n\n\tp = priv->plane[1];\n\ts = priv->Cb;\n\tfor (i=0; i<8; i++)\n\t{\n\t\tfor (j=0; j<8; j+=2, s+=2)\n\t\t\t*p++ = *s;\n\t\tp += priv->width/2 - 4;\n\t}\n\n\tp = priv->plane[2];\n\ts = priv->Cr;\n\tfor (i=0; i<8; i++)\n\t{\n\t\tfor (j=0; j<8; j+=2, s+=2)\n\t\t\t*p++ = *s;\n\t\tp += priv->width/2 - 4;\n\t}\n}\n\n/**\n*  YCrCb -> YUV420P (2x2)\n*  .-------.\n*  | 1 | 2 |\n*  |---+---|\n*  | 3 | 4 |\n*  `-------'\n*/\nstatic void YCrCB_to_YUV420P_2x2(struct jdec_private *priv)\n{\n\tunsigned char *p;\n\tconst unsigned char *s, *y1;\n\tunsigned int i;\n\n\tp = priv->plane[0];\n\ty1 = priv->Y;\n\tfor (i=0; i<16; i++)\n\t{\n\t\tmemcpy(p, y1, 16);\n\t\tp += priv->width;\n\t\ty1 += 16;\n\t}\n\n\tp = priv->plane[1];\n\ts = priv->Cb;\n\tfor (i=0; i<8; i++)\n\t{\n\t\tmemcpy(p, s, 8);\n\t\ts += 8;\n\t\tp += priv->width/2;\n\t}\n\n\tp = priv->plane[2];\n\ts = priv->Cr;\n\tfor (i=0; i<8; i++)\n\t{\n\t\tmemcpy(p, s, 8);\n\t\ts += 8;\n\t\tp += priv->width/2;\n\t}\n}\n\n/**\n*  YCrCb -> RGB24 (1x1)\n*  .---.\n*  | 1 |\n*  `---'\n*/\nstatic void YCrCB_to_RGB24_1x1(struct jdec_private *priv)\n{\n\tconst unsigned char *Y, *Cb, *Cr;\n\tunsigned char *p;\n\tint i,j;\n\tint offset_to_next_row;\n\n#define SCALEBITS       10\n#define ONE_HALF        (1UL << (SCALEBITS-1))\n#define FIX(x)          ((int)((x) * (1UL<<SCALEBITS) + 0.5))\n\n\tp = priv->plane[0];\n\tY = priv->Y;\n\tCb = priv->Cb;\n\tCr = priv->Cr;\n\toffset_to_next_row = priv->width*3 - 8*3;\n\tfor (i=0; i<8; i++) {\n\n\t\tfor (j=0; j<8; j++) {\n\n\t\t\tint y, cb, cr;\n\t\t\tint add_r, add_g, add_b;\n\t\t\tint r, g , b;\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tcb = *Cb++ - 128;\n\t\t\tcr = *Cr++ - 128;\n\t\t\tadd_r = FIX(1.40200) * cr + ONE_HALF;\n\t\t\tadd_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\n\t\t\tadd_b = FIX(1.77200) * cb + ONE_HALF;\n\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\n\t\t}\n\n\t\tp += offset_to_next_row;\n\t}\n\n#undef SCALEBITS\n#undef ONE_HALF\n#undef FIX\n\n}\n\n/**\n*  YCrCb -> BGR24 (1x1)\n*  .---.\n*  | 1 |\n*  `---'\n*/\nstatic void YCrCB_to_BGR24_1x1(struct jdec_private *priv)\n{\n\tconst unsigned char *Y, *Cb, *Cr;\n\tunsigned char *p;\n\tint i,j;\n\tint offset_to_next_row;\n\n#define SCALEBITS       10\n#define ONE_HALF        (1UL << (SCALEBITS-1))\n#define FIX(x)          ((int)((x) * (1UL<<SCALEBITS) + 0.5))\n\n\tp = priv->plane[0];\n\tY = priv->Y;\n\tCb = priv->Cb;\n\tCr = priv->Cr;\n\toffset_to_next_row = priv->width*3 - 8*3;\n\tfor (i=0; i<8; i++) {\n\n\t\tfor (j=0; j<8; j++) {\n\n\t\t\tint y, cb, cr;\n\t\t\tint add_r, add_g, add_b;\n\t\t\tint r, g , b;\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tcb = *Cb++ - 128;\n\t\t\tcr = *Cr++ - 128;\n\t\t\tadd_r = FIX(1.40200) * cr + ONE_HALF;\n\t\t\tadd_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\n\t\t\tadd_b = FIX(1.77200) * cb + ONE_HALF;\n\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\n\t\t}\n\n\t\tp += offset_to_next_row;\n\t}\n\n#undef SCALEBITS\n#undef ONE_HALF\n#undef FIX\n\n}\n\n\n/**\n*  YCrCb -> RGB24 (2x1)\n*  .-------.\n*  | 1 | 2 |\n*  `-------'\n*/\nstatic void YCrCB_to_RGB24_2x1(struct jdec_private *priv)\n{\n\tconst unsigned char *Y, *Cb, *Cr;\n\tunsigned char *p;\n\tint i,j;\n\tint offset_to_next_row;\n\n#define SCALEBITS       10\n#define ONE_HALF        (1UL << (SCALEBITS-1))\n#define FIX(x)          ((int)((x) * (1UL<<SCALEBITS) + 0.5))\n\n\tp = priv->plane[0];\n\tY = priv->Y;\n\tCb = priv->Cb;\n\tCr = priv->Cr;\n\toffset_to_next_row = priv->width*3 - 16*3;\n\tfor (i=0; i<8; i++) {\n\n\t\tfor (j=0; j<8; j++) {\n\n\t\t\tint y, cb, cr;\n\t\t\tint add_r, add_g, add_b;\n\t\t\tint r, g , b;\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tcb = *Cb++ - 128;\n\t\t\tcr = *Cr++ - 128;\n\t\t\tadd_r = FIX(1.40200) * cr + ONE_HALF;\n\t\t\tadd_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\n\t\t\tadd_b = FIX(1.77200) * cb + ONE_HALF;\n\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\n\t\t}\n\n\t\tp += offset_to_next_row;\n\t}\n\n#undef SCALEBITS\n#undef ONE_HALF\n#undef FIX\n\n}\n\n/*\n*  YCrCb -> BGR24 (2x1)\n*  .-------.\n*  | 1 | 2 |\n*  `-------'\n*/\nstatic void YCrCB_to_BGR24_2x1(struct jdec_private *priv)\n{\n\tconst unsigned char *Y, *Cb, *Cr;\n\tunsigned char *p;\n\tint i,j;\n\tint offset_to_next_row;\n\n#define SCALEBITS       10\n#define ONE_HALF        (1UL << (SCALEBITS-1))\n#define FIX(x)          ((int)((x) * (1UL<<SCALEBITS) + 0.5))\n\n\tp = priv->plane[0];\n\tY = priv->Y;\n\tCb = priv->Cb;\n\tCr = priv->Cr;\n\toffset_to_next_row = priv->width*3 - 16*3;\n\tfor (i=0; i<8; i++) {\n\n\t\tfor (j=0; j<8; j++) {\n\n\t\t\tint y, cb, cr;\n\t\t\tint add_r, add_g, add_b;\n\t\t\tint r, g , b;\n\n\t\t\tcb = *Cb++ - 128;\n\t\t\tcr = *Cr++ - 128;\n\t\t\tadd_r = FIX(1.40200) * cr + ONE_HALF;\n\t\t\tadd_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\n\t\t\tadd_b = FIX(1.77200) * cb + ONE_HALF;\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\n\t\t}\n\n\t\tp += offset_to_next_row;\n\t}\n\n#undef SCALEBITS\n#undef ONE_HALF\n#undef FIX\n\n}\n\n/**\n*  YCrCb -> RGB24 (1x2)\n*  .---.\n*  | 1 |\n*  |---|\n*  | 2 |\n*  `---'\n*/\nstatic void YCrCB_to_RGB24_1x2(struct jdec_private *priv)\n{\n\tconst unsigned char *Y, *Cb, *Cr;\n\tunsigned char *p, *p2;\n\tint i,j;\n\tint offset_to_next_row;\n\n#define SCALEBITS       10\n#define ONE_HALF        (1UL << (SCALEBITS-1))\n#define FIX(x)          ((int)((x) * (1UL<<SCALEBITS) + 0.5))\n\n\tp = priv->plane[0];\n\tp2 = priv->plane[0] + priv->width*3;\n\tY = priv->Y;\n\tCb = priv->Cb;\n\tCr = priv->Cr;\n\toffset_to_next_row = 2*priv->width*3 - 8*3;\n\tfor (i=0; i<8; i++) {\n\n\t\tfor (j=0; j<8; j++) {\n\n\t\t\tint y, cb, cr;\n\t\t\tint add_r, add_g, add_b;\n\t\t\tint r, g , b;\n\n\t\t\tcb = *Cb++ - 128;\n\t\t\tcr = *Cr++ - 128;\n\t\t\tadd_r = FIX(1.40200) * cr + ONE_HALF;\n\t\t\tadd_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\n\t\t\tadd_b = FIX(1.77200) * cb + ONE_HALF;\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\n\t\t\ty  = (Y[8-1]) << SCALEBITS;\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p2++ = clamp(r);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p2++ = clamp(g);\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p2++ = clamp(b);\n\n\t\t}\n\t\tY += 8;\n\t\tp += offset_to_next_row;\n\t\tp2 += offset_to_next_row;\n\t}\n\n#undef SCALEBITS\n#undef ONE_HALF\n#undef FIX\n\n}\n\n/*\n*  YCrCb -> BGR24 (1x2)\n*  .---.\n*  | 1 |\n*  |---|\n*  | 2 |\n*  `---'\n*/\nstatic void YCrCB_to_BGR24_1x2(struct jdec_private *priv)\n{\n\tconst unsigned char *Y, *Cb, *Cr;\n\tunsigned char *p, *p2;\n\tint i,j;\n\tint offset_to_next_row;\n\n#define SCALEBITS       10\n#define ONE_HALF        (1UL << (SCALEBITS-1))\n#define FIX(x)          ((int)((x) * (1UL<<SCALEBITS) + 0.5))\n\n\tp = priv->plane[0];\n\tp2 = priv->plane[0] + priv->width*3;\n\tY = priv->Y;\n\tCb = priv->Cb;\n\tCr = priv->Cr;\n\toffset_to_next_row = 2*priv->width*3 - 8*3;\n\tfor (i=0; i<8; i++) {\n\n\t\tfor (j=0; j<8; j++) {\n\n\t\t\tint y, cb, cr;\n\t\t\tint add_r, add_g, add_b;\n\t\t\tint r, g , b;\n\n\t\t\tcb = *Cb++ - 128;\n\t\t\tcr = *Cr++ - 128;\n\t\t\tadd_r = FIX(1.40200) * cr + ONE_HALF;\n\t\t\tadd_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\n\t\t\tadd_b = FIX(1.77200) * cb + ONE_HALF;\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\n\t\t\ty  = (Y[8-1]) << SCALEBITS;\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p2++ = clamp(b);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p2++ = clamp(g);\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p2++ = clamp(r);\n\n\t\t}\n\t\tY += 8;\n\t\tp += offset_to_next_row;\n\t\tp2 += offset_to_next_row;\n\t}\n\n#undef SCALEBITS\n#undef ONE_HALF\n#undef FIX\n\n}\n\n\n/**\n*  YCrCb -> RGB24 (2x2)\n*  .-------.\n*  | 1 | 2 |\n*  |---+---|\n*  | 3 | 4 |\n*  `-------'\n*/\nstatic void YCrCB_to_RGB24_2x2(struct jdec_private *priv)\n{\n\tconst unsigned char *Y, *Cb, *Cr;\n\tunsigned char *p, *p2;\n\tint i,j;\n\tint offset_to_next_row;\n\n#define SCALEBITS       10\n#define ONE_HALF        (1UL << (SCALEBITS-1))\n#define FIX(x)          ((int)((x) * (1UL<<SCALEBITS) + 0.5))\n\n\tp = priv->plane[0];\n\tp2 = priv->plane[0] + priv->width*3;\n\tY = priv->Y;\n\tCb = priv->Cb;\n\tCr = priv->Cr;\n\toffset_to_next_row = (priv->width*3*2) - 16*3;\n\tfor (i=0; i<8; i++) {\n\n\t\tfor (j=0; j<8; j++) {\n\n\t\t\tint y, cb, cr;\n\t\t\tint add_r, add_g, add_b;\n\t\t\tint r, g , b;\n\n\t\t\tcb = *Cb++ - 128;\n\t\t\tcr = *Cr++ - 128;\n\t\t\tadd_r = FIX(1.40200) * cr + ONE_HALF;\n\t\t\tadd_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\n\t\t\tadd_b = FIX(1.77200) * cb + ONE_HALF;\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\n\t\t\ty  = (Y[16-2]) << SCALEBITS;\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p2++ = clamp(r);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p2++ = clamp(g);\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p2++ = clamp(b);\n\n\t\t\ty  = (Y[16-1]) << SCALEBITS;\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p2++ = clamp(r);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p2++ = clamp(g);\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p2++ = clamp(b);\n\t\t}\n\t\tY  += 16;\n\t\tp  += offset_to_next_row;\n\t\tp2 += offset_to_next_row;\n\t}\n\n#undef SCALEBITS\n#undef ONE_HALF\n#undef FIX\n\n}\n\n\n/*\n*  YCrCb -> BGR24 (2x2)\n*  .-------.\n*  | 1 | 2 |\n*  |---+---|\n*  | 3 | 4 |\n*  `-------'\n*/\nstatic void YCrCB_to_BGR24_2x2(struct jdec_private *priv)\n{\n\tconst unsigned char *Y, *Cb, *Cr;\n\tunsigned char *p, *p2;\n\tint i,j;\n\tint offset_to_next_row;\n\n#define SCALEBITS       10\n#define ONE_HALF        (1UL << (SCALEBITS-1))\n#define FIX(x)          ((int)((x) * (1UL<<SCALEBITS) + 0.5))\n\n\tp = priv->plane[0];\n\tp2 = priv->plane[0] + priv->width*3;\n\tY = priv->Y;\n\tCb = priv->Cb;\n\tCr = priv->Cr;\n\toffset_to_next_row = (priv->width*3*2) - 16*3;\n\tfor (i=0; i<8; i++) {\n\n\t\tfor (j=0; j<8; j++) {\n\n\t\t\tint y, cb, cr;\n\t\t\tint add_r, add_g, add_b;\n\t\t\tint r, g , b;\n\n\t\t\tcb = *Cb++ - 128;\n\t\t\tcr = *Cr++ - 128;\n\t\t\tadd_r = FIX(1.40200) * cr + ONE_HALF;\n\t\t\tadd_g = - FIX(0.34414) * cb - FIX(0.71414) * cr + ONE_HALF;\n\t\t\tadd_b = FIX(1.77200) * cb + ONE_HALF;\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\n\t\t\ty  = (*Y++) << SCALEBITS;\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p++ = clamp(b);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p++ = clamp(g);\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p++ = clamp(r);\n\n\t\t\ty  = (Y[16-2]) << SCALEBITS;\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p2++ = clamp(b);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p2++ = clamp(g);\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p2++ = clamp(r);\n\n\t\t\ty  = (Y[16-1]) << SCALEBITS;\n\t\t\tb = (y + add_b) >> SCALEBITS;\n\t\t\t*p2++ = clamp(b);\n\t\t\tg = (y + add_g) >> SCALEBITS;\n\t\t\t*p2++ = clamp(g);\n\t\t\tr = (y + add_r) >> SCALEBITS;\n\t\t\t*p2++ = clamp(r);\n\t\t}\n\t\tY  += 16;\n\t\tp  += offset_to_next_row;\n\t\tp2 += offset_to_next_row;\n\t}\n\n#undef SCALEBITS\n#undef ONE_HALF\n#undef FIX\n\n}\n\n\n\n/**\n*  YCrCb -> Grey (1x1)\n*  .---.\n*  | 1 |\n*  `---'\n*/\nstatic void YCrCB_to_Grey_1x1(struct jdec_private *priv)\n{\n\tconst unsigned char *y;\n\tunsigned char *p;\n\tunsigned int i;\n\tint offset_to_next_row;\n\n\tp = priv->plane[0];\n\ty = priv->Y;\n\toffset_to_next_row = priv->width;\n\n\tfor (i=0; i<8; i++) {\n\t\tmemcpy(p, y, 8);\n\t\ty+=8;\n\t\tp += offset_to_next_row;\n\t}\n}\n\n/**\n*  YCrCb -> Grey (2x1)\n*  .-------.\n*  | 1 | 2 |\n*  `-------'\n*/\nstatic void YCrCB_to_Grey_2x1(struct jdec_private *priv)\n{\n\tconst unsigned char *y;\n\tunsigned char *p;\n\tunsigned int i;\n\n\tp = priv->plane[0];\n\ty = priv->Y;\n\n\tfor (i=0; i<8; i++) {\n\t\tmemcpy(p, y, 16);\n\t\ty += 16;\n\t\tp += priv->width;\n\t}\n}\n\n\n/**\n*  YCrCb -> Grey (1x2)\n*  .---.\n*  | 1 |\n*  |---|\n*  | 2 |\n*  `---'\n*/\nstatic void YCrCB_to_Grey_1x2(struct jdec_private *priv)\n{\n\tconst unsigned char *y;\n\tunsigned char *p;\n\tunsigned int i;\n\n\tp = priv->plane[0];\n\ty = priv->Y;\n\n\tfor (i=0; i<16; i++) {\n\t\tmemcpy(p, y, 8);\n\t\ty += 8;\n\t\tp += priv->width;\n\t}\n}\n\n/**\n*  YCrCb -> Grey (2x2)\n*  .-------.\n*  | 1 | 2 |\n*  |---+---|\n*  | 3 | 4 |\n*  `-------'\n*/\nstatic void YCrCB_to_Grey_2x2(struct jdec_private *priv)\n{\n\tconst unsigned char *y;\n\tunsigned char *p;\n\tunsigned int i;\n\n\tp = priv->plane[0];\n\ty = priv->Y;\n\n\tfor (i=0; i<16; i++) {\n\t\tmemcpy(p, y, 16);\n\t\ty += 16;\n\t\tp += priv->width;\n\t}\n}\n\n\n/*\n* Decode all the 3 components for 1x1 \n*/\nstatic void decode_MCU_1x1_3planes(struct jdec_private *priv)\n{\n\t// Y\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y, 8);\n\n\t// Cb\n\tprocess_Huffman_data_unit(priv, cCb);\n\tIDCT(&priv->component_infos[cCb], priv->Cb, 8);\n\n\t// Cr\n\tprocess_Huffman_data_unit(priv, cCr);\n\tIDCT(&priv->component_infos[cCr], priv->Cr, 8);\n}\n\n/*\n* Decode a 1x1 directly in 1 color\n*/\nstatic void decode_MCU_1x1_1plane(struct jdec_private *priv)\n{\n\t// Y\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y, 8);\n\n\t// Cb\n\tprocess_Huffman_data_unit(priv, cCb);\n\tIDCT(&priv->component_infos[cCb], priv->Cb, 8);\n\n\t// Cr\n\tprocess_Huffman_data_unit(priv, cCr);\n\tIDCT(&priv->component_infos[cCr], priv->Cr, 8);\n}\n\n\n/*\n* Decode a 2x1\n*  .-------.\n*  | 1 | 2 |\n*  `-------'\n*/\nstatic void decode_MCU_2x1_3planes(struct jdec_private *priv)\n{\n\t// Y\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y, 16);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+8, 16);\n\n\t// Cb\n\tprocess_Huffman_data_unit(priv, cCb);\n\tIDCT(&priv->component_infos[cCb], priv->Cb, 8);\n\n\t// Cr\n\tprocess_Huffman_data_unit(priv, cCr);\n\tIDCT(&priv->component_infos[cCr], priv->Cr, 8);\n}\n\n/*\n* Decode a 2x1\n*  .-------.\n*  | 1 | 2 |\n*  `-------'\n*/\nstatic void decode_MCU_2x1_1plane(struct jdec_private *priv)\n{\n\t// Y\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y, 16);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+8, 16);\n\n\t// Cb\n\tprocess_Huffman_data_unit(priv, cCb);\n\n\t// Cr\n\tprocess_Huffman_data_unit(priv, cCr);\n}\n\n\n/*\n* Decode a 2x2\n*  .-------.\n*  | 1 | 2 |\n*  |---+---|\n*  | 3 | 4 |\n*  `-------'\n*/\nstatic void decode_MCU_2x2_3planes(struct jdec_private *priv)\n{\n\t// Y\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y, 16);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+8, 16);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+64*2, 16);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+64*2+8, 16);\n\n\t// Cb\n\tprocess_Huffman_data_unit(priv, cCb);\n\tIDCT(&priv->component_infos[cCb], priv->Cb, 8);\n\n\t// Cr\n\tprocess_Huffman_data_unit(priv, cCr);\n\tIDCT(&priv->component_infos[cCr], priv->Cr, 8);\n}\n\n/*\n* Decode a 2x2 directly in GREY format (8bits)\n*  .-------.\n*  | 1 | 2 |\n*  |---+---|\n*  | 3 | 4 |\n*  `-------'\n*/\nstatic void decode_MCU_2x2_1plane(struct jdec_private *priv)\n{\n\t// Y\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y, 16);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+8, 16);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+64*2, 16);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+64*2+8, 16);\n\n\t// Cb\n\tprocess_Huffman_data_unit(priv, cCb);\n\n\t// Cr\n\tprocess_Huffman_data_unit(priv, cCr);\n}\n\n/*\n* Decode a 1x2 mcu\n*  .---.\n*  | 1 |\n*  |---|\n*  | 2 |\n*  `---'\n*/\nstatic void decode_MCU_1x2_3planes(struct jdec_private *priv)\n{\n\t// Y\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y, 8);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+64, 8);\n\n\t// Cb\n\tprocess_Huffman_data_unit(priv, cCb);\n\tIDCT(&priv->component_infos[cCb], priv->Cb, 8);\n\n\t// Cr\n\tprocess_Huffman_data_unit(priv, cCr);\n\tIDCT(&priv->component_infos[cCr], priv->Cr, 8);\n}\n\n/*\n* Decode a 1x2 mcu\n*  .---.\n*  | 1 |\n*  |---|\n*  | 2 |\n*  `---'\n*/\nstatic void decode_MCU_1x2_1plane(struct jdec_private *priv)\n{\n\t// Y\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y, 8);\n\tprocess_Huffman_data_unit(priv, cY);\n\tIDCT(&priv->component_infos[cY], priv->Y+64, 8);\n\n\t// Cb\n\tprocess_Huffman_data_unit(priv, cCb);\n\n\t// Cr\n\tprocess_Huffman_data_unit(priv, cCr);\n}\n\nstatic void print_SOF(const unsigned char *stream)\n{\n\tint width, height, nr_components, precision;\n#if DEBUG\n\tconst char *nr_components_to_string[] = {\n\t\t\"????\",\n\t\t\"Grayscale\",\n\t\t\"????\",\n\t\t\"YCbCr\",\n\t\t\"CYMK\"\n\t};\n#endif\n\n\tprecision = stream[2];\n\theight = be16_to_cpu(stream+3);\n\twidth  = be16_to_cpu(stream+5);\n\tnr_components = stream[7];\n\n\t/*trace(\"> SOF marker\\n\");\n\ttrace(\"Size:%dx%d nr_components:%d (%s)  precision:%d\\n\", \n\twidth, height,\n\tnr_components, nr_components_to_string[nr_components],\n\tprecision);*/\n}\n\n/*******************************************************************************\n*\n* JPEG/JFIF Parsing functions\n*\n* Note: only a small subset of the jpeg file format is supported. No markers,\n* nor progressive stream is supported.\n*\n******************************************************************************/\n\nstatic void build_quantization_table(int *qtable, const unsigned char *ref_table)\n{\n\t/* Taken from libjpeg. Copyright Independent JPEG Group's LLM idct.\n\t* For float AA&N IDCT method, divisors are equal to quantization\n\t* coefficients scaled by scalefactor[row]*scalefactor[col], where\n\t*   scalefactor[0] = 1\n\t*   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7\n\t* We apply a further scale factor of 8.\n\t* What's actually stored is 1/divisor so that the inner loop can\n\t* use a multiplication rather than a division.\n\t*/\n\tint i, j;\n\t/*static const double aanscalefactor[8] = {\n\t1.0, 1.387039845, 1.306562965, 1.175875602,\n\t1.0, 0.785694958, 0.541196100, 0.275899379\n\t};*/\n\tstatic const int aanscalefactor[8] = {\n\t\tDCT_FIX(1.0), DCT_FIX(1.387039845), DCT_FIX(1.306562965), DCT_FIX(1.175875602),\n\t\tDCT_FIX(1.0), DCT_FIX(0.785694958), DCT_FIX(0.541196100), DCT_FIX(0.275899379)\n\t};\n\tconst unsigned char *zz = zigzag;\n\n\tfor (i=0; i<8; i++) {\n\t\tfor (j=0; j<8; j++) {\n\t\t\t//*qtable++ = (float)(ref_table[*zz++] * aanscalefactor[i] * aanscalefactor[j]);\n\t\t\t//float f = (float)(ref_table[*zz++] * aanscalefactor[i] * aanscalefactor[j]);\n\t\t\tint value = ref_table[*zz++];\n\t\t\tvalue *= aanscalefactor[i];\n\t\t\tvalue *= aanscalefactor[j];\n\t\t\t*qtable++ = DCT_DESCALE1(value);\n\t\t}\n\t}\n\n}\n\nstatic int parse_DQT(struct jdec_private *priv, const unsigned char *stream)\n{\n\tint qi;\n\tint *table;\n\tconst unsigned char *dqt_block_end;\n\n\t//trace(\"> DQT marker\\n\");\n\tdqt_block_end = stream + be16_to_cpu(stream);\n\tstream += 2;\t/* Skip length */\n\n\twhile (stream < dqt_block_end)\n\t{\n\t\tqi = *stream++;\n#if SANITY_CHECK\n\t\tif (qi>>4) {\n\t\t\t//error(\"16 bits quantization table is not supported\\n\");\n\t\t\tsnprintf(error_string, sizeof(error_string), \"16 bits quantization table is not supported\\n\");\n\t\t\treturn -1;\n\t\t}\n\t\tif (qi>4) {\n\t\t\t//error(\"No more 4 quantization table is supported (got %d)\\n\", qi);\n\t\t\tsnprintf(error_string, sizeof(error_string), \"No more 4 quantization table is supported (got %d)\\n\", qi);\n\t\t\treturn -1;\n\t\t}\n#endif\n\t\ttable = priv->Q_tables[qi];\n\t\tbuild_quantization_table(table, stream);\n\t\tstream += 64;\n\t}\n\t//trace(\"< DQT marker\\n\");\n\treturn 0;\n}\n\nstatic int parse_SOF(struct jdec_private *priv, const unsigned char *stream)\n{\n\tint i, width, height, nr_components, cid, sampling_factor;\n\tint Q_table;\n\tstruct component *c;\n\n\t//  trace(\"> SOF marker\\n\");\n\tprint_SOF(stream);\n\n\theight = be16_to_cpu(stream+3);\n\twidth  = be16_to_cpu(stream+5);\n\tnr_components = stream[7];\n#if SANITY_CHECK\n\tif (stream[2] != 8) {\n\t\terror0(\"Precision other than 8 is not supported\\n\");\n\t}\n\tif (width>JPEG_MAX_WIDTH || height>JPEG_MAX_HEIGHT)\n\t\terror2(\"Width and Height (%dx%d) seems suspicious\\n\", width, height);\n\tif (nr_components != 3)\n\t\terror0(\"We only support YUV images\\n\");\n\tif (height%16)\n\t\terror1(\"Height need to be a multiple of 16 (current height is %d)\\n\", height);\n\tif (width%16)\n\t\terror1(\"Width need to be a multiple of 16 (current Width is %d)\\n\", width);\n#endif\n\tstream += 8;\n\tfor (i=0; i<nr_components; i++) {\n\t\tcid = *stream++;\n\t\tsampling_factor = *stream++;\n\t\tQ_table = *stream++;\n\t\tc = &priv->component_infos[i];\n#if SANITY_CHECK\n\t\tc->cid = cid;\n\t\tif (Q_table >= COMPONENTS)\n\t\t\terror2(\"Bad Quantization table index (got %d, max allowed %d)\\n\", Q_table, COMPONENTS-1);\n#endif\n\t\tc->Vfactor = sampling_factor&0xf;\n\t\tc->Hfactor = sampling_factor>>4;\n\t\tc->Q_table = priv->Q_tables[Q_table];\n\t\t//trace(\"Component:%d  factor:%dx%d  Quantization table:%d\\n\",\n\t\t//    cid, c->Hfactor, c->Hfactor, Q_table );\n\n\t}\n\tpriv->width = width;\n\tpriv->height = height;\n\n\t//trace(\"< SOF marker\\n\");\n\n\treturn 0;\n}\n\nstatic int parse_SOS(struct jdec_private *priv, const unsigned char *stream)\n{\n\tunsigned int i, cid, table;\n\tunsigned int nr_components = stream[2];\n\n\t//  trace(\"> SOS marker\\n\");\n\n#if SANITY_CHECK\n\tif (nr_components != 3)\n\t\terror0(\"We only support YCbCr image\\n\");\n#endif\n\n\tstream += 3;\n\tfor (i=0;i<nr_components;i++) {\n\t\tcid = *stream++;\n\t\ttable = *stream++;\n#if SANITY_CHECK\n\t\tif ((table&0xf)>=4)\n\t\t\terror0(\"We do not support more than 2 AC Huffman table\\n\");\n\t\tif ((table>>4)>=4)\n\t\t\terror0(\"We do not support more than 2 DC Huffman table\\n\");\n\t\tif (cid != priv->component_infos[i].cid)\n\t\t\terror4(\"SOS cid order (%d:%d) isn't compatible with the SOF marker (%d:%d)\\n\",\n\t\t\ti, cid, i, priv->component_infos[i].cid);\n\t\t//trace(\"ComponentId:%d  tableAC:%d tableDC:%d\\n\", cid, table&0xf, table>>4);\n#endif\n\t\tpriv->component_infos[i].AC_table = &priv->HTAC[table&0xf];\n\t\tpriv->component_infos[i].DC_table = &priv->HTDC[table>>4];\n\t}\n\tpriv->stream = stream+3;\n\t//trace(\"< SOS marker\\n\");\n\treturn 0;\n}\n\nstatic int parse_DHT(struct jdec_private *priv, const unsigned char *stream)\n{\n\tunsigned int count, i;\n\tunsigned char huff_bits[17];\n\tint length, index;\n\n\tlength = be16_to_cpu(stream) - 2;\n\tstream += 2;\t/* Skip length */\n\n\t// trace(\"> DHT marker (length=%d)\\n\", length);\n\n\twhile (length>0) {\n\t\tindex = *stream++;\n\n\t\t/* We need to calculate the number of bytes 'vals' will takes */\n\t\thuff_bits[0] = 0;\n\t\tcount = 0;\n\t\tfor (i=1; i<17; i++) {\n\t\t\thuff_bits[i] = *stream++;\n\t\t\tcount += huff_bits[i];\n\t\t}\n#if SANITY_CHECK\n\t\tif (count >= HUFFMAN_BITS_SIZE)\n\t\t\terror1(\"No more than %d bytes is allowed to describe a huffman table\", HUFFMAN_BITS_SIZE);\n\t\tif ( (index &0xf) >= HUFFMAN_TABLES)\n\t\t\terror2(\"No more than %d Huffman tables is supported (got %d)\\n\", HUFFMAN_TABLES, index&0xf);\n\t\t//trace(\"Huffman table %s[%d] length=%d\\n\", (index&0xf0)?\"AC\":\"DC\", index&0xf, count);\n#endif\n\n\t\tif (index & 0xf0 )\n\t\t\tbuild_huffman_table(huff_bits, stream, &priv->HTAC[index&0xf]);\n\t\telse\n\t\t\tbuild_huffman_table(huff_bits, stream, &priv->HTDC[index&0xf]);\n\n\t\tlength -= 1;\n\t\tlength -= 16;\n\t\tlength -= count;\n\t\tstream += count;\n\t}\n\t//trace(\"< DHT marker\\n\");\n\treturn 0;\n}\n\nstatic int parse_DRI(struct jdec_private *priv, const unsigned char *stream)\n{\n\tunsigned int length;\n\n\t// trace(\"> DRI marker\\n\");\n\n\tlength = be16_to_cpu(stream);\n\n#if SANITY_CHECK\n\tif (length != 4)\n\t\terror0(\"Length of DRI marker need to be 4\\n\");\n#endif\n\n\tpriv->restart_interval = be16_to_cpu(stream+2);\n\n#if DEBUG\n\ttrace(\"Restart interval = %d\\n\", priv->restart_interval);\n#endif\n\n\t//trace(\"< DRI marker\\n\");\n\n\treturn 0;\n}\n\n\n\nstatic void resync(struct jdec_private *priv)\n{\n\tint i;\n\n\t/* Init DC coefficients */\n\tfor (i=0; i<COMPONENTS; i++)\n\t\tpriv->component_infos[i].previous_DC = 0;\n\n\tpriv->reservoir = 0;\n\tpriv->nbits_in_reservoir = 0;\n\tif (priv->restart_interval > 0)\n\t\tpriv->restarts_to_go = priv->restart_interval;\n\telse\n\t\tpriv->restarts_to_go = -1;\n}\n\nstatic int find_next_rst_marker(struct jdec_private *priv)\n{\n\tint rst_marker_found = 0;\n\tint marker;\n\tconst unsigned char *stream = priv->stream;\n\n\t/* Parse marker */\n\twhile (!rst_marker_found)\n\t{\n\t\twhile (*stream++ != 0xff)\n\t\t{\n\t\t\tif (stream >= priv->stream_end)\n\t\t\t\terror0(\"EOF while search for a RST marker.\");\n\t\t}\n\t\t/* Skip any padding ff byte (this is normal) */\n\t\twhile (*stream == 0xff)\n\t\t\tstream++;\n\n\t\tmarker = *stream++;\n\t\tif ((RST+priv->last_rst_marker_seen) == marker)\n\t\t\trst_marker_found = 1;\n\t\telse if (marker >= RST && marker <= RST7)\n\t\t\terror0(\"Wrong Reset marker found, aborting\");\n\t\telse if (marker == EOI)\n\t\t\treturn 0;\n\t}\n\t// trace(\"RST Marker %d found at offset %d\\n\", priv->last_rst_marker_seen, stream - priv->stream_begin);\n\n\tpriv->stream = stream;\n\tpriv->last_rst_marker_seen++;\n\tpriv->last_rst_marker_seen &= 7;\n\n\treturn 0;\n}\n\nstatic int parse_JFIF(struct jdec_private *priv, const unsigned char *stream)\n{\n\tint chuck_len;\n\tint marker;\n\tint sos_marker_found = 0;\n\tint dht_marker_found = 0;\n\tconst unsigned char *next_chunck;\n\n\t/* Parse marker */\n\twhile (!sos_marker_found)\n\t{\n\t\tif (*stream++ != 0xff)\n\t\t\tgoto bogus_jpeg_format;\n\t\t/* Skip any padding ff byte (this is normal) */\n\t\twhile (*stream == 0xff)\n\t\t\tstream++;\n\n\t\tmarker = *stream++;\n\t\tchuck_len = be16_to_cpu(stream);\n\t\tnext_chunck = stream + chuck_len;\n\t\tswitch (marker)\n\t\t{\n\t\tcase SOF:\n\t\t\tif (parse_SOF(priv, stream) < 0)\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\tcase DQT:\n\t\t\tif (parse_DQT(priv, stream) < 0)\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\tcase SOS:\n\t\t\tif (parse_SOS(priv, stream) < 0)\n\t\t\t\treturn -1;\n\t\t\tsos_marker_found = 1;\n\t\t\tbreak;\n\t\tcase DHT:\n\t\t\tif (parse_DHT(priv, stream) < 0)\n\t\t\t\treturn -1;\n\t\t\tdht_marker_found = 1;\n\t\t\tbreak;\n\t\tcase DRI:\n\t\t\tif (parse_DRI(priv, stream) < 0)\n\t\t\t\treturn -1;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t// trace(\"> Unknown marker %2.2x\\n\", marker);\n\t\t\tbreak;\n\t\t}\n\n\t\tstream = next_chunck;\n\t}\n\n\tif (!dht_marker_found) {\n\t\t//trace(\"No Huffman table loaded, using the default one\\n\");\n\t\tbuild_default_huffman_tables(priv);\n\t}\n\n#ifdef SANITY_CHECK\n\tif (   (priv->component_infos[cY].Hfactor < priv->component_infos[cCb].Hfactor)\n\t\t|| (priv->component_infos[cY].Hfactor < priv->component_infos[cCr].Hfactor))\n\t\terror0(\"Horizontal sampling factor for Y should be greater than horitontal sampling factor for Cb or Cr\\n\");\n\tif (   (priv->component_infos[cY].Vfactor < priv->component_infos[cCb].Vfactor)\n\t\t|| (priv->component_infos[cY].Vfactor < priv->component_infos[cCr].Vfactor))\n\t\terror0(\"Vertical sampling factor for Y should be greater than vertical sampling factor for Cb or Cr\\n\");\n\tif (   (priv->component_infos[cCb].Hfactor!=1) \n\t\t|| (priv->component_infos[cCr].Hfactor!=1)\n\t\t|| (priv->component_infos[cCb].Vfactor!=1)\n\t\t|| (priv->component_infos[cCr].Vfactor!=1))\n\t\terror0(\"Sampling other than 1x1 for Cr and Cb is not supported\");\n#endif\n\n\treturn 0;\nbogus_jpeg_format:\n\t//trace(\"Bogus jpeg format\\n\");\n\treturn -1;\n}\n\n/*******************************************************************************\n*\n* Functions exported of the library.\n*\n* Note: Some applications can access directly to internal pointer of the\n* structure. It's is not recommended, but if you have many images to\n* uncompress with the same parameters, some functions can be called to speedup\n* the decoding.\n*\n******************************************************************************/\n\n/**\n* Allocate a new tinyjpeg decoder object.\n*\n* Before calling any other functions, an object need to be called.\n*/\nstruct jdec_private *tinyjpeg_init(void)\n{\n\tstruct jdec_private *priv;\n\n\tpriv = (struct jdec_private *)calloc(1, sizeof(struct jdec_private));\n\tif (priv == NULL)\n\t\treturn NULL;\n\treturn priv;\n}\n\n/**\n* Free a tinyjpeg object.\n*\n* No others function can be called after this one.\n*/\nvoid tinyjpeg_free(struct jdec_private *priv)\n{\n\tint i;\n\tfor (i=0; i<COMPONENTS; i++) {\n\t\tif (priv->components[i])\n\t\t\tfree(priv->components[i]);\n\t\tpriv->components[i] = NULL;\n\t}\n\tfree(priv);\n}\n\n/**\n* Initialize the tinyjpeg object and prepare the decoding of the stream.\n*\n* Check if the jpeg can be decoded with this jpeg decoder.\n* Fill some table used for preprocessing.\n*/\nint tinyjpeg_parse_header(struct jdec_private *priv, const unsigned char *buf, unsigned int size)\n{\n\tint ret;\n\n\t/* Identify the file */\n\tif ((buf[0] != 0xFF) || (buf[1] != SOI))\n\t\terror0(\"Not a JPG file ?\\n\");\n\n\tpriv->stream_begin = buf+2;\n\tpriv->stream_length = size-2;\n\tpriv->stream_end = priv->stream_begin + priv->stream_length;\n\n\tret = parse_JFIF(priv, priv->stream_begin);\n\n\treturn ret;\n}\n\nstatic const decode_MCU_fct decode_mcu_3comp_table[4] = {\n\tdecode_MCU_1x1_3planes,\n\tdecode_MCU_1x2_3planes,\n\tdecode_MCU_2x1_3planes,\n\tdecode_MCU_2x2_3planes,\n};\n\nstatic const decode_MCU_fct decode_mcu_1comp_table[4] = {\n\tdecode_MCU_1x1_1plane,\n\tdecode_MCU_1x2_1plane,\n\tdecode_MCU_2x1_1plane,\n\tdecode_MCU_2x2_1plane,\n};\n\nstatic const convert_colorspace_fct convert_colorspace_yuv420p[4] = {\n\tYCrCB_to_YUV420P_1x1,\n\tYCrCB_to_YUV420P_1x2,\n\tYCrCB_to_YUV420P_2x1,\n\tYCrCB_to_YUV420P_2x2,\n};\n\nstatic const convert_colorspace_fct convert_colorspace_rgb24[4] = {\n\tYCrCB_to_RGB24_1x1,\n\tYCrCB_to_RGB24_1x2,\n\tYCrCB_to_RGB24_2x1,\n\tYCrCB_to_RGB24_2x2,\n};\n\nstatic const convert_colorspace_fct convert_colorspace_bgr24[4] = {\n\tYCrCB_to_BGR24_1x1,\n\tYCrCB_to_BGR24_1x2,\n\tYCrCB_to_BGR24_2x1,\n\tYCrCB_to_BGR24_2x2,\n};\n\nstatic const convert_colorspace_fct convert_colorspace_grey[4] = {\n\tYCrCB_to_Grey_1x1,\n\tYCrCB_to_Grey_1x2,\n\tYCrCB_to_Grey_2x1,\n\tYCrCB_to_Grey_2x2,\n};\n\n/**\n* Decode and convert the jpeg image into @pixfmt@ image\n*\n* Note: components will be automaticaly allocated if no memory is attached.\n*/\nint tinyjpeg_decode(struct jdec_private *priv, int pixfmt)\n{\n\tunsigned int x, y, xstride_by_mcu, ystride_by_mcu;\n\tunsigned int bytes_per_blocklines[3], bytes_per_mcu[3];\n\tdecode_MCU_fct decode_MCU;\n\tconst decode_MCU_fct *decode_mcu_table;\n\tconst convert_colorspace_fct *colorspace_array_conv;\n\tconvert_colorspace_fct convert_to_pixfmt;\n\n\tif (setjmp(priv->jump_state))\n\t\treturn -1;\n\n\t/* To keep gcc happy initialize some array */\n\tbytes_per_mcu[1] = 0;\n\tbytes_per_mcu[2] = 0;\n\tbytes_per_blocklines[1] = 0;\n\tbytes_per_blocklines[2] = 0;\n\n\tdecode_mcu_table = decode_mcu_3comp_table;\n\tswitch (pixfmt) {\ncase TINYJPEG_FMT_YUV420P:\n\tcolorspace_array_conv = convert_colorspace_yuv420p;\n\tif (priv->components[0] == NULL)\n\t\tpriv->components[0] = (uint8_t *)malloc(priv->width * priv->height);\n\tif (priv->components[1] == NULL)\n\t\tpriv->components[1] = (uint8_t *)malloc(priv->width * priv->height/4);\n\tif (priv->components[2] == NULL)\n\t\tpriv->components[2] = (uint8_t *)malloc(priv->width * priv->height/4);\n\tbytes_per_blocklines[0] = priv->width;\n\tbytes_per_blocklines[1] = priv->width/4;\n\tbytes_per_blocklines[2] = priv->width/4;\n\tbytes_per_mcu[0] = 8;\n\tbytes_per_mcu[1] = 4;\n\tbytes_per_mcu[2] = 4;\n\tbreak;\n\ncase TINYJPEG_FMT_RGB24:\n\tcolorspace_array_conv = convert_colorspace_rgb24;\n\tif (priv->components[0] == NULL)\n\t\tpriv->components[0] = (uint8_t *)malloc(priv->width * priv->height * 3);\n\tbytes_per_blocklines[0] = priv->width * 3;\n\tbytes_per_mcu[0] = 3*8;\n\tbreak;\n\ncase TINYJPEG_FMT_BGR24:\n\tcolorspace_array_conv = convert_colorspace_bgr24;\n\tif (priv->components[0] == NULL)\n\t\tpriv->components[0] = (uint8_t *)malloc(priv->width * priv->height * 3);\n\tbytes_per_blocklines[0] = priv->width * 3;\n\tbytes_per_mcu[0] = 3*8;\n\tbreak;\n\ncase TINYJPEG_FMT_GREY:\n\tdecode_mcu_table = decode_mcu_1comp_table;\n\tcolorspace_array_conv = convert_colorspace_grey;\n\tif (priv->components[0] == NULL)\n\t\tpriv->components[0] = (uint8_t *)malloc(priv->width * priv->height);\n\tbytes_per_blocklines[0] = priv->width;\n\tbytes_per_mcu[0] = 8;\n\tbreak;\n\ndefault:\n\t//       trace(\"Bad pixel format\\n\");\n\treturn -1;\n\t}\n\n\txstride_by_mcu = ystride_by_mcu = 8;\n\tif ((priv->component_infos[cY].Hfactor | priv->component_infos[cY].Vfactor) == 1) {\n\t\tdecode_MCU = decode_mcu_table[0];\n\t\tconvert_to_pixfmt = colorspace_array_conv[0];\n\t\t//     trace(\"Use decode 1x1 sampling\\n\");\n\t} else if (priv->component_infos[cY].Hfactor == 1) {\n\t\tdecode_MCU = decode_mcu_table[1];\n\t\tconvert_to_pixfmt = colorspace_array_conv[1];\n\t\tystride_by_mcu = 16;\n\t\t//     trace(\"Use decode 1x2 sampling (not supported)\\n\");\n\t} else if (priv->component_infos[cY].Vfactor == 2) {\n\t\tdecode_MCU = decode_mcu_table[3];\n\t\tconvert_to_pixfmt = colorspace_array_conv[3];\n\t\txstride_by_mcu = 16;\n\t\tystride_by_mcu = 16;\n\t\t//     trace(\"Use decode 2x2 sampling\\n\");\n\t} else {\n\t\tdecode_MCU = decode_mcu_table[2];\n\t\tconvert_to_pixfmt = colorspace_array_conv[2];\n\t\txstride_by_mcu = 16;\n\t\t//     trace(\"Use decode 2x1 sampling\\n\");\n\t}\n\n\tresync(priv);\n\n\t/* Don't forget to that block can be either 8 or 16 lines */\n\tbytes_per_blocklines[0] *= ystride_by_mcu;\n\tbytes_per_blocklines[1] *= ystride_by_mcu;\n\tbytes_per_blocklines[2] *= ystride_by_mcu;\n\n\tbytes_per_mcu[0] *= xstride_by_mcu/8;\n\tbytes_per_mcu[1] *= xstride_by_mcu/8;\n\tbytes_per_mcu[2] *= xstride_by_mcu/8;\n\n\t/* Just the decode the image by macroblock (size is 8x8, 8x16, or 16x16) */\n\tfor (y=0; y < priv->height/ystride_by_mcu; y++)\n\t{\n\t\t//trace(\"Decoding row %d\\n\", y);\n\t\tpriv->plane[0] = priv->components[0] + (y * bytes_per_blocklines[0]);\n\t\tpriv->plane[1] = priv->components[1] + (y * bytes_per_blocklines[1]);\n\t\tpriv->plane[2] = priv->components[2] + (y * bytes_per_blocklines[2]);\n\t\tfor (x=0; x < priv->width; x+=xstride_by_mcu)\n\t\t{\n\t\t\tdecode_MCU(priv);\n\t\t\tconvert_to_pixfmt(priv);\n\t\t\tpriv->plane[0] += bytes_per_mcu[0];\n\t\t\tpriv->plane[1] += bytes_per_mcu[1];\n\t\t\tpriv->plane[2] += bytes_per_mcu[2];\n\t\t\tif (priv->restarts_to_go>0)\n\t\t\t{\n\t\t\t\tpriv->restarts_to_go--;\n\t\t\t\tif (priv->restarts_to_go == 0)\n\t\t\t\t{\n\t\t\t\t\tpriv->stream -= (priv->nbits_in_reservoir/8);\n\t\t\t\t\tresync(priv);\n\t\t\t\t\tif (find_next_rst_marker(priv) < 0)\n\t\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t//  trace(\"Input file size: %d\\n\", priv->stream_length+2);\n\t//  trace(\"Input bytes actually read: %d\\n\", priv->stream - priv->stream_begin + 2);\n\n\treturn 0;\n}\n\nconst char *tinyjpeg_get_errorstring(struct jdec_private *priv)\n{\n\t/* FIXME: the error string must be store in the context */\n\tpriv = priv;\n\treturn error_string;\n}\n\nvoid tinyjpeg_get_size(struct jdec_private *priv, unsigned int *width, unsigned int *height)\n{\n\t*width = priv->width;\n\t*height = priv->height;\n}\n\nint tinyjpeg_get_components(struct jdec_private *priv, unsigned char **components)\n{\n\tint i;\n\tfor (i=0; priv->components[i] && i<COMPONENTS; i++)\n\t\tcomponents[i] = priv->components[i];\n\treturn 0;\n}\n\nint tinyjpeg_set_components(struct jdec_private *priv, unsigned char **components, unsigned int ncomponents)\n{\n\tunsigned int i;\n\tif (ncomponents > COMPONENTS)\n\t\tncomponents = COMPONENTS;\n\tfor (i=0; i<ncomponents; i++)\n\t\tpriv->components[i] = components[i];\n\treturn 0;\n}\n\nint tinyjpeg_set_flags(struct jdec_private *priv, int flags)\n{\n\tint oldflags = priv->flags;\n\tpriv->flags = flags;\n\treturn oldflags;\n}\n\n"
  },
  {
    "path": "libIGraph/tinyjpeg.h",
    "content": "/*\n * Small jpeg decoder library (header file)\n *\n * Copyright (c) 2006, Luc Saillard <luc@saillard.org>\n * All rights reserved.\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * \n * - Redistributions of source code must retain the above copyright notice,\n *  this list of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright notice,\n *  this list of conditions and the following disclaimer in the documentation\n *  and/or other materials provided with the distribution.\n *\n * - Neither the name of the author nor the names of its contributors may be\n *  used to endorse or promote products derived from this software without\n *  specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n */\n\n\n#ifndef __JPEGDEC_H__\n#define __JPEGDEC_H__\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct jdec_private;\n\n/* Flags that can be set by any applications */\n#define TINYJPEG_FLAGS_MJPEG_TABLE\t(1<<1)\n\n/* Format accepted in outout */\nenum tinyjpeg_fmt {\n   TINYJPEG_FMT_GREY = 1,\n   TINYJPEG_FMT_BGR24,\n   TINYJPEG_FMT_RGB24,\n   TINYJPEG_FMT_YUV420P,\n};\n\nstruct jdec_private *tinyjpeg_init(void);\nvoid tinyjpeg_free(struct jdec_private *priv);\n\nint tinyjpeg_parse_header(struct jdec_private *priv, const unsigned char *buf, unsigned int size);\nint tinyjpeg_decode(struct jdec_private *priv, int pixel_format);\nconst char *tinyjpeg_get_errorstring(struct jdec_private *priv);\nvoid tinyjpeg_get_size(struct jdec_private *priv, unsigned int *width, unsigned int *height);\nint tinyjpeg_get_components(struct jdec_private *priv, unsigned char **components);\nint tinyjpeg_set_components(struct jdec_private *priv, unsigned char **components, unsigned int ncomponents);\nint tinyjpeg_set_flags(struct jdec_private *priv, int flags);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif\n\n\n\n"
  },
  {
    "path": "mini-demo-dna/HelloWorld/HelloWorld.csproj",
    "content": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n  <PropertyGroup>\n    <OutputType>Exe</OutputType>\n    <TargetFramework>netcoreapp2.0</TargetFramework>\n  </PropertyGroup>\n\n  <PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|AnyCPU'\">\n    <Optimize>true</Optimize>\n  </PropertyGroup>\n\n</Project>\n"
  },
  {
    "path": "mini-demo-dna/HelloWorld/Program.cs",
    "content": "﻿using System;\n\nnamespace HelloWorld\n{\n    class Program\n    {\n        // This method produces the IL:\n        //   LDC.I4.S 84\n        //   RET\n        static int GetNumber() => 84;\n\n        static int Main(string[] args)\n        {\n            // Console.WriteLine(...) is much too complex for this\n            // demo runtime, so comment it out.\n\n            //Console.WriteLine(\"Hello World!\");\n\n            // But it's fairly simple to interpret a return instruction with a value.\n            // This will cause the exit-code of the program to be the returned value.\n\n            // A release build of this code will produce just two IL instructions:\n            //   CALL GetNumber()\n            //   LDC.I4.S 42\n            //   ADD\n            //   RET\n            // The demo runtime is only able to execute these two instructions.\n\n            return GetNumber() + 42;\n        }\n    }\n}\n"
  },
  {
    "path": "mini-demo-dna/mini-demo-dna/main.c",
    "content": "#define _CRT_SECURE_NO_WARNINGS\n\n#include <stdlib.h>\n#include <stdarg.h>\n#include <stdio.h>\n#include <inttypes.h>\n#include <string.h>\n#include <io.h>\n#include <fcntl.h>\n\n#pragma pack(1)\n\n#define T_CALLOC(type) ((type*)calloc(1, sizeof(type)))\n#define PTR(p, ofs) ((void*)((char*)(p) + (ofs)))\n#define VAL(type, p, ofs) (*(type*)(PTR(p, ofs)))\n\nvoid Crash(char* pMsg, ...) {\n\tprintf(\"\\n\\n*** CRASH ***\\n\");\n\tva_list va;\n\tva_start(va, pMsg);\n\tvprintf(pMsg, va);\n\tva_end(va);\n\tprintf(\"\\n\\n(Press enter to exit)\\n\");\n\tgetchar();\n\texit(1);\n}\n\ntypedef struct tRVA tRVA;\nstruct tRVA {\n\tint baseAddress;\n\tint size;\n\tvoid* pData;\n\ttRVA* pNext;\n};\n\ntypedef struct tMetaDataTable tMetaDataTable;\nstruct tMetaDataTable {\n\tvoid **ppData;\n\tint count;\n};\n\n#define TABLE_ID(token) ((token) >> 24)\n#define TABLE_OFS(token) ((token) & 0x00ffffff)\n#define MAKE_TOKEN(tableId, ofs) ((((int)(tableId)) << 24) | (((int)(ofs)) & 0x00ffffff))\n#define GET_TABLE_ENTRY(type, pFile, token) (type*)(pFile->tables[TABLE_ID(token)].ppData[TABLE_OFS(token)])\n#define GET_STRING(pFile, ofs) ((pFile)->pStrings + (ofs))\n\ntypedef struct tFile tFile;\nstruct tFile {\n\ttRVA* pRVAs;\n\tint entryPointToken;\n\tchar *pStrings;\n\tchar *pUserStrings;\n\ttMetaDataTable tables[64];\n};\n\ntypedef struct tMD_Prefix tMD_Prefix;\nstruct tMD_Prefix {\n\ttFile *pFile;\n};\n\n#define TABLE_ID_METHODDEF 0x06\ntypedef struct tMD_MethodDef tMD_MethodDef;\nstruct tMD_MethodDef {\n\ttMD_Prefix prefix;\n\tint rva;\n\tshort implFlags;\n\tshort flags;\n\tshort nameIndex; // Strings index\n\tshort sigIndex; // Blob index\n\tshort paramListIndex; // tMD_Param index\n};\n\nint md_tableSizes[64] = {\n\t10, 6, 14, 0, 6, 0, 14, 0, // 0x00 - 0x07\n\t6, 0, 6, 0, 6, 0, 0, 0,    // 0x08 - 0x0f\n\t0, 2, 0, 0, 0, 0, 0, 0,    // 0x10 - 0x17\n\t0, 0, 0, 0, 0, 0, 0, 0,    // 0x18 - 0x1f\n\t22, 0, 0, 20               // 0x20 - 0x23\n};\n\n// Start coding here...\n\nvoid* RVA_FindData(tFile *pFile, int addr) {\n\ttRVA *pRVA = pFile->pRVAs;\n\twhile (pRVA != NULL) {\n\t\tif (addr >= pRVA->baseAddress && addr < pRVA->baseAddress + pRVA->size) {\n\t\t\treturn PTR(pRVA->pData, addr - pRVA->baseAddress);\n\t\t}\n\t\tpRVA = pRVA->pNext;\n\t}\n\treturn NULL;\n}\n\ntFile* LoadFile(char *pFilename) {\n\tprintf(\"Load file: '%s'\\n\", pFilename);\n\n\t// Load file\n\tint f = _open(pFilename, O_BINARY | O_RDONLY);\n\tint len = _lseek(f, 0, SEEK_END);\n\t_lseek(f, 0, SEEK_SET);\n\tvoid *pData = malloc(len);\n\t_read(f, pData, len);\n\t_close(f);\n\n\ttFile *pFile = T_CALLOC(tFile);\n\n\tif (VAL(char, pData, 0) != 'M' || VAL(char, pData, 1) != 'Z') Crash(\"Not an executable!\");\n\tprintf(\"Is an executable :)\\n\");\n\tvoid *pMSDOSHeader = pData;\n\tint lfanew = VAL(int, pMSDOSHeader, 0x3c);\n\tvoid *pPEHeader = PTR(pMSDOSHeader, lfanew + 4);\n\tif (VAL(short, pPEHeader, 0) != 0x14c) Crash(\"This is not a .NET executable!\");\n\tprintf(\"It is a .NET executable :)\\n\");\n\tvoid *pPEOptionalHeader = PTR(pPEHeader, 20);\n\tvoid *pSectionHeaders = PTR(pPEOptionalHeader, 224);\n\tint numSections = VAL(short, pPEHeader, 2);\n\tprintf(\"Number of sections: %i\\n\", numSections);\n\tfor (int i = 0; i < numSections; i++) {\n\t\tvoid *pSection = PTR(pSectionHeaders, i * 40);\n\t\ttRVA *pRVA = T_CALLOC(tRVA);\n\t\tpRVA->baseAddress = VAL(int, pSection, 12);\n\t\tpRVA->size = VAL(int, pSection, 8);\n\t\tpRVA->pData = calloc(1, pRVA->size);\n\t\tint rvaOfs = VAL(int, pSection, 20);\n\t\tmemcpy(pRVA->pData, PTR(pData, rvaOfs), min(pRVA->size, VAL(int, pSection, 16)));\n\t\tpRVA->pNext = pFile->pRVAs;\n\t\tpFile->pRVAs = pRVA;\n\t}\n\tprintf(\"Loaded sections :)\\n\");\n\t// Load CLI header\n\tvoid *pCLIHeader = RVA_FindData(pFile, VAL(int, pPEOptionalHeader, 208));\n\tprintf(\"Runtime version: %i.%i\\n\", VAL(short, pCLIHeader, 4), VAL(short, pCLIHeader, 6));\n\tpFile->entryPointToken = VAL(int, pCLIHeader, 20);\n\tprintf(\"entry-point token: 0x%08x\\n\", pFile->entryPointToken);\n\tvoid *pMetaData = RVA_FindData(pFile, VAL(int, pCLIHeader, 8));\n\tprintf(\"CLI version: '%s'\\n\", (char*)PTR(pMetaData, 16));\n\tint versionLen = VAL(int, pMetaData, 12);\n\tint ofs = 16 + versionLen;\n\tint StreamCount = VAL(short, pMetaData, ofs + 2);\n\tprintf(\"Metadata stream count: %i\\n\", StreamCount);\n\tofs += 4;\n\tfor (int i = 0; i < StreamCount; i++) {\n\t\tint streamOffset = VAL(int, pMetaData, ofs);\n\t\tint streamSize = VAL(int, pMetaData, ofs + 4);\n\t\tchar *pStreamName = PTR(pMetaData, ofs + 8);\n\t\tvoid *pStream = PTR(pMetaData, streamOffset);\n\t\tofs += 8 + ((strlen(pStreamName) + 4) & (~3));\n\t\tprintf(\"Stream found: '%s'\\n\", pStreamName);\n\t\tif (strcmp(pStreamName, \"#Strings\") == 0) {\n\t\t\tpFile->pStrings = pStream;\n\t\t}\n\t\tif (strcmp(pStreamName, \"#~\") == 0) {\n\t\t\t// Load tables\n\t\t\tlong long valid = VAL(long long, pStream, 8);\n\t\t\tint *pRowCounterPtr = PTR(pStream, 24);\n\t\t\tfor (long long i = 0, j = 1; i < 64; i++, j <<= 1) {\n\t\t\t\tif (valid & j) {\n\t\t\t\t\tpFile->tables[i].count = *pRowCounterPtr;\n\t\t\t\t\tpRowCounterPtr += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Load data\n\t\t\tvoid *pTableData = pRowCounterPtr;\n\t\t\tprintf(\"Loaded tables:\\n\");\n\t\t\tfor (int i = 0; i < 64; i++) {\n\t\t\t\tint count = pFile->tables[i].count;\n\t\t\t\tif (count != 0) {\n\t\t\t\t\tint tableSize = md_tableSizes[i];\n\t\t\t\t\tvoid **ppData = pFile->tables[i].ppData = malloc(sizeof(void*) * (count + 1));\n\t\t\t\t\tppData[0] = NULL;\n\t\t\t\t\tfor (int j = 0; j < count; j++) {\n\t\t\t\t\t\ttMD_Prefix *pPrefix = malloc(sizeof(tMD_Prefix) + tableSize);\n\t\t\t\t\t\tpPrefix->pFile = pFile;\n\t\t\t\t\t\tmemcpy(pPrefix + 1, pTableData, tableSize);\n\t\t\t\t\t\tppData[j + 1] = pPrefix;\n\t\t\t\t\t\tpTableData = PTR(pTableData, tableSize);\n\t\t\t\t\t}\n\t\t\t\t\tprintf(\"  Table 0x%02x: %i entries\\n\", i, count);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn pFile;\n}\n\ntMD_MethodDef* GetMethodByToken(tFile *pFile, int methodToken) {\n\tswitch (TABLE_ID(methodToken)) {\n\tcase TABLE_ID_METHODDEF:\n\t\treturn GET_TABLE_ENTRY(tMD_MethodDef, pFile, methodToken);\n\t}\n\tCrash(\"!!!!\");\n\treturn NULL;\n}\n\ntypedef struct tMethodState tMethodState;\nstruct tMethodState {\n\ttFile *pFile;\n\ttMD_MethodDef *pMethodDef;\n\tvoid *pIL;\n\tint ip;\n\tchar evalStack[32];\n\tint esp;\n};\n\ntMethodState* CreateMethodState(tMD_MethodDef *pMethodDef) {\n\ttMethodState *pMethodState = T_CALLOC(tMethodState);\n\tpMethodState->pFile = pMethodDef->prefix.pFile;\n\tpMethodState->pMethodDef = pMethodDef;\n\tvoid *pILHeader = RVA_FindData(pMethodDef->prefix.pFile, pMethodDef->rva);\n\tif ((VAL(char, pILHeader, 0) & 0x3) != 0x2) Crash(\"Can only understand Tiny IL Headers\");\n\tpMethodState->pIL = PTR(pILHeader, 1);\n\treturn pMethodState;\n}\n\nvoid Execute(tMethodState *pMethodState) {\n\ttFile *pFile = pMethodState->pFile;\n\tprintf(\"\\nExecuting method: '%s'\\n\", GET_STRING(pFile, pMethodState->pMethodDef->nameIndex));\n\tvoid *pIL = pMethodState->pIL;\n\tvoid *pEvalStack = pMethodState->evalStack;\n\tfor (;;) {\n\t\tunsigned char opcode = VAL(unsigned char, pIL, pMethodState->ip);\n\t\tpMethodState->ip += 1;\n\t\tprintf(\"Executing opcode: 0x%02x\\n\", opcode);\n\t\tswitch (opcode) {\n\t\tcase 0x1f: // LDC.I4.S\n\t\t{\n\t\t\t// Load int32 from short-form (signed byte).\n\t\t\tint value = VAL(char, pIL, pMethodState->ip);\n\t\t\tpMethodState->ip += 1;\n\t\t\t// Store in top of evaluation stack.\n\t\t\tVAL(int, pEvalStack, pMethodState->esp) = value;\n\t\t\tpMethodState->esp += 4;\n\t\t\tbreak;\n\t\t}\n\t\tcase 0x28: // CALL\n\t\t{\n\t\t\t// Load method-def|ref token from IL.\n\t\t\t// Only method-defs are handle currently. I.e. the method being called must in this assembly.\n\t\t\tint callToken = VAL(int, pIL, pMethodState->ip);\n\t\t\tpMethodState->ip += 4;\n\t\t\t// Load the method-definition from the metadata, and create a method state.\n\t\t\ttMD_MethodDef *pCallMethodDef = GetMethodByToken(pFile, callToken);\n\t\t\ttMethodState *pCallMethodState = CreateMethodState(pCallMethodDef);\n\t\t\t// Execute the method.\n\t\t\tExecute(pCallMethodState);\n\t\t\t// If it has a return-value, copy it to to evaluation-stack of this method.\n\t\t\tmemcpy(PTR(pEvalStack, pMethodState->esp), pCallMethodState->evalStack, pCallMethodState->esp);\n\t\t\tpMethodState->esp += pCallMethodState->esp;\n\t\t\tbreak;\n\t\t}\n\t\tcase 0x2a: // RET\n\t\t\tprintf(\"Executing method return from: '%s' \\n\\n\", GET_STRING(pFile, pMethodState->pMethodDef->nameIndex));\n\t\t\treturn;\n\t\tcase 0x58: // ADD\n\t\t{\n\t\t\t// Assume we're adding int32 values.\n\t\t\t// Read the top two int32 values from the evaluation stack, add them, then push back on to the evaluation stack.\n\t\t\tint value2 = VAL(int, pEvalStack, pMethodState->esp - 4);\n\t\t\tint value1 = VAL(int, pEvalStack, pMethodState->esp - 8);\n\t\t\tVAL(int, pEvalStack, pMethodState->esp - 8) = value1 + value2;\n\t\t\tpMethodState->esp -= 4;\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tCrash(\"Cannot (yet) execute opcode: 0x%02x\\n\", opcode);\n\t\t}\n\t}\n}\n\nint main(int argc, char** argp) {\n\ttFile *pFile = LoadFile(argp[1]);\n\t// Load entry-point method\n\ttMD_MethodDef *pEntryPointMethodDef = GetMethodByToken(pFile, pFile->entryPointToken);\n\tprintf(\"Entry-point method name: '%s'\\n\", GET_STRING(pFile, pEntryPointMethodDef->nameIndex));\n\t// Create entry-point method state\n\ttMethodState *pMethodState = CreateMethodState(pEntryPointMethodDef);\n\t// Execute entry-point method\n\tExecute(pMethodState);\n\n\tint exitCode;\n\tif (pMethodState->esp == 4)\n\t{\n\t\t// If an int32 value is left at position 0 in the evaluation stack, then this is the exit-code.\n\t\texitCode = VAL(int, pMethodState->evalStack, 0);\n\t\tprintf(\"Execution completed successfully. Exit-code: %i\", exitCode);\n\t}\n\telse\n\t{\n\t\texitCode = 0;\n\t\tprintf(\"Execution completed successfully. No exit-code\");\n\t}\n\n\tprintf(\"\\n\\n(Press enter to exit)\\n\");\n\tgetchar();\n\n\treturn exitCode;\n}\n"
  },
  {
    "path": "mini-demo-dna/mini-demo-dna.sln",
    "content": "﻿\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio 15\nVisualStudioVersion = 15.0.27703.2026\nMinimumVisualStudioVersion = 10.0.40219.1\nProject(\"{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}\") = \"HelloWorld\", \"HelloWorld\\HelloWorld.csproj\", \"{50017E25-6A22-4D3B-B89E-6AF742004D87}\"\nEndProject\nProject(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"mini-demo-dna\", \"mini-demo-dna\\mini-demo-dna.vcxproj\", \"{148C719C-A4BD-450E-8A2B-3664245E5345}\"\nEndProject\nGlobal\n\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n\t\tDebug|Any CPU = Debug|Any CPU\n\t\tDebug|x64 = Debug|x64\n\t\tDebug|x86 = Debug|x86\n\t\tRelease|Any CPU = Release|Any CPU\n\t\tRelease|x64 = Release|x64\n\t\tRelease|x86 = Release|x86\n\tEndGlobalSection\n\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Debug|Any CPU.Build.0 = Debug|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Debug|x64.ActiveCfg = Debug|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Debug|x64.Build.0 = Debug|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Debug|x86.ActiveCfg = Debug|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Debug|x86.Build.0 = Debug|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Release|Any CPU.ActiveCfg = Release|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Release|Any CPU.Build.0 = Release|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Release|x64.ActiveCfg = Release|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Release|x64.Build.0 = Release|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Release|x86.ActiveCfg = Release|Any CPU\n\t\t{50017E25-6A22-4D3B-B89E-6AF742004D87}.Release|x86.Build.0 = Release|Any CPU\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Debug|Any CPU.ActiveCfg = Debug|Win32\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Debug|x64.ActiveCfg = Debug|x64\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Debug|x64.Build.0 = Debug|x64\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Debug|x86.ActiveCfg = Debug|Win32\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Debug|x86.Build.0 = Debug|Win32\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Release|Any CPU.ActiveCfg = Release|Win32\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Release|x64.ActiveCfg = Release|x64\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Release|x64.Build.0 = Release|x64\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Release|x86.ActiveCfg = Release|Win32\n\t\t{148C719C-A4BD-450E-8A2B-3664245E5345}.Release|x86.Build.0 = Release|Win32\n\tEndGlobalSection\n\tGlobalSection(SolutionProperties) = preSolution\n\t\tHideSolutionNode = FALSE\n\tEndGlobalSection\n\tGlobalSection(ExtensibilityGlobals) = postSolution\n\t\tSolutionGuid = {F661AB6F-B151-49A9-B696-55215DA7E99F}\n\tEndGlobalSection\nEndGlobal\n"
  },
  {
    "path": "mini-demo-dna/readme.md",
    "content": "# mini-demo-dna\n\nmini-demo-dna is the smallest possible C code that is able to execute the simplest\npossible .NET executable.\n\nIn less than 250 lines of C it is able to load an executable built using the\nstandard Microsoft C# compiler. It is only able to execute an empty Main() method,\nbut demonstrates that creating your own .NET runtime may not be as complex as you\nimagine! There probably isn't any situation where you would actually *want* to\ncreate your own  .NET runtime, but it's fun to experiment :)\n\nThis code was live-coded from (almost) nothing at [NDC-Oslo](https://ndcoslo.com/)\n2018 in exactly one hour at the talk:\n[So you want to create your own .NET runtime](https://ndcoslo.com/talk/so-you-want-to-create-your-own-net-runtime/).\n\nThe code for the .NET runtime itself is all in\n[mini-demo-dna/main.c](https://github.com/chrisdunelm/DotNetAnywhere/blob/master/mini-demo-dna/mini-demo-dna/main.c)\n\nThe video will be available shortly...\n\nAll information required to understand/extend/improve this code is in the .NET\nspecification which is freely available:\n[EMCA-335](https://www.ecma-international.org/publications/standards/Ecma-335.htm)\n\nThis code is purely for demonstration, and is entirely unsuitable for any real use.\n\nEnjoy!\n"
  },
  {
    "path": "readme.markdown",
    "content": "Dot Net Anywhere\n================\nDot Net Anywhere is a interpreted .NET CIL runtime.\n\n-------\n\n# This project is inactive. No issues or PRs will be dealt with.\n\n*However! The code was used in initial prototypes of [Blazor](https://github.com/SteveSanderson/Blazor) IL-in-a-browser project :)*\n\n-------\n\nThe runtime itself is written in C and has been designed to be as small and portable as possible, allowing .NET software to be used on resource-constrained devices where it is not possible to run a full .NET runtime (e.g. [Mono][1]).\n\nHow To Build\n------------\nThe simplest way to build Dot Net Anywhere is using Visual Studio 2011 on Windows. Open and build both the solutions:\n\n* dna.sln\n* Managed.sln\n\nThis will create a 'Build/Debug/' directory which contains:\n\n* ***dna.exe***: The CIL interpreter runtime *(native executable)*\n* ***libIGraph.dll***: Low-levl graphics handling *(native library)*\n* ***FreeType.dll***: The [FreeType][2] font engine *(native library)*\n* ***/Fonts*** directory: Font .ttf files\n* ***corlib.dll***: Dot Net Anywhere implementation of mscorlib.dll *(CIL library)*\n* ***System.dll***:  Dot Net Anywhere implementation of System.dll *(CIL library)*\n* ***System.Core.dll***:  Dot Net Anywhere implementation of System.Core.dll *(CIL library)*\n* ***System.Drawing.dll***:  Dot Net Anywhere implementation of System.Drawing.dll; requires libIGraph.dll *(CIL library)*\n* ***CustomDevice.dll***: Defines a the user interface of a custom device *(CIL library)*\n* ***Snake.exe***: Demonstration game of snake *(CIL executable)*\n\nHow to use\n----------\n\nWhen at a command prompt in the Build/Debug directory:\n\n```\ndna.exe [<options>] <CIL executable> [<Cil executable arguments>]\n```\n\nSo, to run the included snake game:\n\n```\ndna.exe Snake.exe\n```\n\nThe Dot Net Anywhere interpreter can show all two levels of verbosity. Using the -v option shows initial .NET module load data and garbage collection information. Using -vv also shows all methods that are being JITted.\n\nOf course, the Snake.exe is a completely standard .NET executable file, so it can just be run using the normal Microsoft .NET runtime:\n\n```\nSnake.exe\n```\n\nThis game was originally written to run on some custom hardware that did not have a standard keyboard, hence the controls are little odd:\n\n* '6': Left\n* '7': Down\n* '8': Up\n* '9': Right\n\nSupported .NET runtime features\n-------------------------------\n\nThe interpreter and corlib currently implement the following .NET 2.0 CLR and language features:\n\n* Generics\n* Garbage collection and finalization\n* Weak references\n* Full exception handling - try/catch/finally\n* PInvoke; although it's not the most pleasant or fully-featured implementation possible, but it will work cross-platform without libffi\n* Interfaces\n* Delegates\n* Events\n* Nullable types\n* Single-dimensional arrays\n* Multi-threading; not using native threads, only actually runs in one native thread\n* Very limited read-only reflection; typeof(), .GetType(), Type.Name, Type.Namespace, Type.IsEnum(), \\<object\\>.ToString() only\n\n**Currently unsupported features**\n\n* Attributes\n* Most reflection\n* Multi-dimensional arrays\n* Unsafe code\n\nImplementation\n--------------\n\nThe Dot Net Anywhere interpreter JITs each method as required into an internal format, which is then interpreted using a [direct-threaded][3] interpreter. The JIT stage does a full stack-type analysis and explicitly stores type information within the internal format's opcodes, allowing considerably more efficient interpretation that if the CIL was directly interpreted.\n\nCustom platforms\n-------------------------\n\nDot Net Anywhere has been designed to be fairly simple to port to custom platforms.\n\ndna.exe and libIGraph.dll will need to be built for the platform. These are both written in C, and should build with most C compilers without problems. Two non-standard features are used:\n\n1. Zero-length arrays: *char c[0];*\n2. Computed goto: void *\\*ptr = ...; goto \\*ptr;* (this is not supported using the Visual Studio C compiler, so an assembly replacement is provided)\n\nThe only customisation that will generally be required is in the UI/input subsystem: The CustomDevice.dll managed library and the libIGraph.dll native library.\n\nThe embedded device that has been used for development has a 320x240 4-bit grey-scale screen and a 12-key keypad. This is all handled within the CustomDevice and libIGraph libraries, and will need to be customised for a device configuration.\n\nTo access the screen of the device, the CustomDevice class contains a method GetScreen() that returns a Graphics object that is the screen. If the device has a screen that is not a simple 2-D array of pixels then you will need to implement this differently.\n\n\n[1]: http://www.mono-project.com\n[2]: http://freetype.org\n[3]: https://en.wikipedia.org/wiki/Threaded_code#Direct_threading\n"
  }
]